From 06eebc76ce3fa24766531f6cebd74f838258238a Mon Sep 17 00:00:00 2001 From: syb8200 Date: Fri, 12 Jan 2024 02:13:32 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=95=B1=20=EB=B0=94=20actions=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/envelope/SentEnvelopeScreen.kt | 31 ++++--------------- .../SentEnvelopeDetailScreen.kt | 29 +++++------------ 2 files changed, 14 insertions(+), 46 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelope/SentEnvelopeScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelope/SentEnvelopeScreen.kt index c1894215..76566496 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelope/SentEnvelopeScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelope/SentEnvelopeScreen.kt @@ -13,20 +13,19 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.Icon import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.StrokeCap -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import com.susu.core.designsystem.component.appbar.SusuDefaultAppBar import com.susu.core.designsystem.component.appbar.icon.BackIcon +import com.susu.core.designsystem.component.appbar.icon.NotificationIcon +import com.susu.core.designsystem.component.appbar.icon.SearchIcon import com.susu.core.designsystem.component.badge.BadgeColor import com.susu.core.designsystem.component.badge.BadgeStyle import com.susu.core.designsystem.component.badge.SusuBadge @@ -37,7 +36,6 @@ import com.susu.core.designsystem.theme.Gray90 import com.susu.core.designsystem.theme.Orange20 import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.ui.extension.collectWithLifecycle -import com.susu.core.ui.extension.susuClickable import com.susu.feature.envelope.component.EnvelopeHistoryItem import com.susu.feature.sent.R @@ -62,8 +60,9 @@ fun SentEnvelopeRoute( @Composable fun SentEnvelopeScreen( modifier: Modifier = Modifier, - clickPadding: Dp = SusuTheme.spacing.spacing_xs, onClickBackIcon: () -> Unit = {}, + onClickSearchIcon: () -> Unit = {}, + onClickNotificationIcon: () -> Unit = {}, onClickEnvelopeDetail: () -> Unit = {}, ) { Box( @@ -78,26 +77,8 @@ fun SentEnvelopeScreen( }, title = "김철수", actions = { - Icon( - painter = painterResource(id = com.susu.core.designsystem.R.drawable.ic_appbar_search), - contentDescription = stringResource(id = com.susu.core.designsystem.R.string.content_description_search_icon), - modifier = modifier - .susuClickable( - rippleEnabled = false, - onClick = {}, - ) - .padding(clickPadding), - ) - Icon( - painter = painterResource(id = com.susu.core.designsystem.R.drawable.ic_appbar_notification), - contentDescription = stringResource(id = com.susu.core.designsystem.R.string.content_description_notification_icon), - modifier = modifier - .susuClickable( - rippleEnabled = false, - onClick = {}, - ) - .padding(clickPadding), - ) + SearchIcon(onClickSearchIcon) + NotificationIcon(onClickNotificationIcon) }, ) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopedetail/SentEnvelopeDetailScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopedetail/SentEnvelopeDetailScreen.kt index dced8a8b..b6e703d7 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopedetail/SentEnvelopeDetailScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopedetail/SentEnvelopeDetailScreen.kt @@ -12,15 +12,15 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.hilt.navigation.compose.hiltViewModel import com.susu.core.designsystem.component.appbar.SusuDefaultAppBar import com.susu.core.designsystem.component.appbar.icon.BackIcon +import com.susu.core.designsystem.component.appbar.icon.DeleteText +import com.susu.core.designsystem.component.appbar.icon.EditText import com.susu.core.designsystem.theme.Gray100 import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.ui.extension.collectWithLifecycle -import com.susu.core.ui.extension.susuClickable import com.susu.feature.envelopedetail.component.DetailItem @Composable @@ -43,7 +43,8 @@ fun SentEnvelopeDetailRoute( fun SentEnvelopeDetailScreen( modifier: Modifier = Modifier, onClickBackIcon: () -> Unit = {}, - + onClickEdit: () -> Unit = {}, + onClickDelete: () -> Unit = {}, ) { val scrollState = rememberScrollState() @@ -59,26 +60,12 @@ fun SentEnvelopeDetailScreen( ) }, actions = { - Text( - text = stringResource(id = com.susu.core.ui.R.string.word_edit), - style = SusuTheme.typography.title_xxs, - color = Gray100, - modifier = modifier - .susuClickable( - rippleEnabled = false, - onClick = {}, - ), + EditText( + onClick = onClickEdit, ) Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_m)) - Text( - text = stringResource(id = com.susu.core.ui.R.string.word_delete), - style = SusuTheme.typography.title_xxs, - color = Gray100, - modifier = modifier - .susuClickable( - rippleEnabled = false, - onClick = {}, - ), + DeleteText( + onClick = onClickDelete, ) Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_m)) },