From 07b45134e6650fb3c3ed3e0732e46eb7e207d011 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Wed, 17 Jan 2024 23:59:33 +0900 Subject: [PATCH 01/13] =?UTF-8?q?feat:=20MoneyContent=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/content/MoneyContent.kt | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt new file mode 100644 index 00000000..b2fbe111 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt @@ -0,0 +1,89 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.SmallButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.component.textfield.SusuPriceTextField +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.core.ui.extension.toMoneyFormat + +@OptIn(ExperimentalLayoutApi::class) +@Composable +fun MoneyContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl + ), +) { + val moneyList = listOf( + 10000, 30000, 50000, 100000, 500000, + ) + var clickedMoney by remember { mutableStateOf("") } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + Text( + text = "얼마를 보냈나요", + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SusuPriceTextField( + text = clickedMoney, + onTextChange = { clickedMoney = it }, + placeholder = "금액을 입력해주세요", + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxl), + ) + FlowRow( + horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + ) { + for (money in moneyList) { + SusuFilledButton( + color = FilledButtonColor.Orange, + style = SmallButtonStyle.height32, + text = "${money.toMoneyFormat()}원", + onClick = { + clickedMoney = money.toString() + }, + ) + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun MoneyContentPreview() { + SusuTheme { + MoneyContent() + } +} From 2c37b0e03d1d2be71800715792001db5f5937c43 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Wed, 17 Jan 2024 23:59:45 +0900 Subject: [PATCH 02/13] =?UTF-8?q?feat:=20InputContent=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/content/InputContent.kt | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt new file mode 100644 index 00000000..d01de36e --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt @@ -0,0 +1,111 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.textfield.SusuBasicTextField +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.Gray60 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.envelopeadd.content.component.FriendListItem + +@Composable +fun InputContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + name: String? = null, + titleText: String, + friendList: List = emptyList(), + placeholder: String, +) { + var textFieldContent by remember { mutableStateOf("") } + + val title = buildAnnotatedString { + withStyle(style = SpanStyle(color = Gray60)) { + append(name + "님의 ") + } + withStyle(style = SpanStyle(color = Gray100)) { + append(titleText) + } + } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + if (name == null) { + Text( + text = titleText, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + } else { + Text( + text = title, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + } + + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SusuBasicTextField( + text = textFieldContent, + onTextChange = { textFieldContent = it }, + placeholder = placeholder, + placeholderColor = Gray40, + modifier = modifier.fillMaxWidth(), + keyboardOptions = if (name == null) KeyboardOptions.Default else KeyboardOptions(keyboardType = KeyboardType.Number) + ) + Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) + + if (friendList.isNotEmpty()) { + // TODO: 친구 목록 서버 연동 + LazyColumn() { + items(friendList) { friend -> + FriendListItem(friend) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun NameContentPreview() { + SusuTheme { + val friendList = listOf("김철수", "국영수", "가나다") + + InputContent( + titleText = "누구에게 보냈나요", + placeholder = "이름을 입력해주세요", + friendList = friendList, + ) + } +} From c43ecaad98a634ece941e9c2723078b0599eaf52 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:00:07 +0900 Subject: [PATCH 03/13] =?UTF-8?q?feat:=20CategoryContent=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/content/CategoryContent.kt | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt new file mode 100644 index 00000000..fe520155 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt @@ -0,0 +1,111 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.GhostButtonColor +import com.susu.core.designsystem.component.button.MediumButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.component.button.SusuGhostButton +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray70 +import com.susu.core.designsystem.theme.SusuTheme + +@Composable +fun CategoryContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + titleText: String, + hasSubTitle: Boolean = false, + subTitleText: String = "", + categoryList: List, +) { + val scrollState = rememberScrollState() + var selectedItem by remember { mutableStateOf(-1) } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding) + .verticalScroll(scrollState), + ) { + Text( + text = titleText, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + if (hasSubTitle) { + Text( + text = subTitleText, + style = SusuTheme.typography.text_xs, + color = Gray70, + modifier = modifier.padding(top = SusuTheme.spacing.spacing_xxxxs) + ) + } + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxl), + ) + Column( + verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + ) { + categoryList.forEachIndexed { index, category -> + if (selectedItem == index) { + SusuFilledButton( + color = FilledButtonColor.Orange, + style = MediumButtonStyle.height60, + text = category, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } else { + SusuGhostButton( + color = GhostButtonColor.Black, + style = MediumButtonStyle.height60, + text = category, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun CategoryContentPreview() { + val categoryList = mutableListOf("친구", "가족", "친척", "동료", "직접 입력") + + SusuTheme { + CategoryContent( + titleText = "나와는\n어떤 사이 인가요", + categoryList = categoryList, + hasSubTitle = true, + subTitleText = "복수로 선택하셔도 좋아요" + ) + } +} From 9471a5e865b2a237bbc3daafd56fcbd74bceb86d Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:00:22 +0900 Subject: [PATCH 04/13] =?UTF-8?q?feat:=20DateContent=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/content/DateContent.kt | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt new file mode 100644 index 00000000..e120f4f0 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt @@ -0,0 +1,97 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.susu.core.designsystem.component.bottomsheet.datepicker.SusuDatePickerBottomSheet +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray60 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.core.ui.extension.susuClickable +import com.susu.feature.envelopeadd.content.component.SelectDateRow + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun DateContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + titleText: String, + year: Int? = null, + month: Int? = null, + day: Int? = null, + name: String, +) { + var isSheetOpen by remember { mutableStateOf(false) } + + val title = buildAnnotatedString { + withStyle(style = SpanStyle(color = Gray60)) { + append(name + "님에게") + } + withStyle(style = SpanStyle(color = Gray100)) { + append(titleText) + } + } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + Text( + text = title, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SelectDateRow( + year = year, + month = month, + day = day, + modifier = modifier.susuClickable( + rippleEnabled = false, + onClick = { isSheetOpen = true }, + ) + ) + } + + // DatePickerBottomSheet + if (isSheetOpen) { + SusuDatePickerBottomSheet( + maximumContainerHeight = 346.dp, + onDismissRequest = { _, _, _ -> isSheetOpen = false }, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun DateContentPreview() { + SusuTheme { + DateContent( + titleText = "언제 보냈나요", + name = "김철수", + ) + } +} From 3cb5ce320973f4a289c3561ca789c7c8b6c6a5aa Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:01:01 +0900 Subject: [PATCH 05/13] =?UTF-8?q?feat:=20FriendListItem=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/component/FriendListItem.kt | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/FriendListItem.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/FriendListItem.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/FriendListItem.kt new file mode 100644 index 00000000..b526db65 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/FriendListItem.kt @@ -0,0 +1,67 @@ +package com.susu.feature.envelopeadd.content.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.Gray60 +import com.susu.core.designsystem.theme.SusuTheme + +@Composable +fun FriendListItem( + friend: String, + modifier: Modifier = Modifier, +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding( + vertical = SusuTheme.spacing.spacing_s, + ), + horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + verticalAlignment = Alignment.CenterVertically, + ) { + Text( + text = friend, + style = SusuTheme.typography.title_xs, + color = Gray100, + ) + Text( + text = "친구", + style = SusuTheme.typography.title_xs, + color = Gray60, + ) + Text( + text = "결혼식", + style = SusuTheme.typography.text_xs, + color = Gray40, + ) + Text( + text = "2022.01.11", + style = SusuTheme.typography.text_xs, + color = Gray40, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun FriendListItemPreview() { + val friendList = listOf("김철수", "국영수", "가나다") + + SusuTheme { + Column { + for (friend in friendList) { + FriendListItem(friend = friend) + } + } + } +} From 56c12f5a355b4b27f289fd9b4dd687771cfc7896 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:01:19 +0900 Subject: [PATCH 06/13] =?UTF-8?q?feat:=20SelectDateRow=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/component/SelectDateRow.kt | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/SelectDateRow.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/SelectDateRow.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/SelectDateRow.kt new file mode 100644 index 00000000..5e9fad6e --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/component/SelectDateRow.kt @@ -0,0 +1,69 @@ +package com.susu.feature.envelopeadd.content.component + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray30 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.core.ui.util.AnnotatedText +import com.susu.feature.sent.R +import java.time.LocalDateTime + +private val currentDate = LocalDateTime.now() + +@Composable +fun SelectDateRow( + modifier: Modifier = Modifier, + year: Int? = null, + month: Int? = null, + day: Int? = null, +) { + Row( + modifier = modifier, + horizontalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + verticalAlignment = Alignment.Bottom, + ) { + if (year == null || month == null || day == null) { + AnnotatedText( + originalText = stringResource( + R.string.sent_envelope_add_date, + currentDate.year, + currentDate.month.value, + currentDate.dayOfMonth, + ), + targetTextList = listOf( + currentDate.year.toString(), + currentDate.month.value.toString(), + currentDate.dayOfMonth.toString(), + ), + originalTextStyle = SusuTheme.typography.title_xl, + spanStyle = SusuTheme.typography.title_xl.copy(Gray30).toSpanStyle(), + ) + } else { + Text( + text = stringResource( + R.string.sent_envelope_add_date, + year, + month, + day, + ), + style = SusuTheme.typography.title_xl, + color = Gray100, + ) + } + } +} + +@Preview +@Composable +fun SelectDateRowPreview() { + SusuTheme { + SelectDateRow() + } +} From 4c367b0e37a068ebcc63cbe50a957235411a869b Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:01:37 +0900 Subject: [PATCH 07/13] =?UTF-8?q?feat:=20SentEnvelopeAddScreen=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/SentEnvelopeAddScreen.kt | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt new file mode 100644 index 00000000..1a4b1e5f --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -0,0 +1,139 @@ +package com.susu.feature.envelopeadd + +import androidx.compose.animation.AnimatedContent +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.imePadding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.appbar.SusuProgressAppBar +import com.susu.core.designsystem.component.appbar.icon.BackIcon +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.MediumButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.core.ui.extension.susuDefaultAnimatedContentTransitionSpec +import com.susu.feature.envelopeadd.content.CategoryContent +import com.susu.feature.envelopeadd.content.DateContent +import com.susu.feature.envelopeadd.content.InputContent +import com.susu.feature.envelopeadd.content.MoneyContent + +enum class EnvelopeAddStep { + MONEY, + NAME, + RELATIONSHIP, + EVENT, + DATE, + MORE, + VISITED, + PRESENT, + MEMO, + PHONE, +} + +@Composable +fun SentEnvelopeAddScreen( + modifier: Modifier = Modifier, + currentStep: EnvelopeAddStep = EnvelopeAddStep.MONEY, + onClickBack: () -> Unit = {}, + onClickNext: () -> Unit = {}, +) { + // TODO: 수정 필요 + val categoryList = listOf("친구", "가족", "친척", "동료", "직접 입력") + val friendList = listOf("김철수", "국영수", "신짱구", "홍길동") + val eventList = listOf("결혼식", "돌잔치", "장례식", "생일 기념일", "직접 입력") + val moreList = listOf("방문여부", "선물", "메모", "보낸 이의 연락처") + val visitedList = listOf("예", "아니요") + + Column( + modifier = modifier + .background(SusuTheme.colorScheme.background15) + .fillMaxSize(), + ) { + SusuProgressAppBar( + leftIcon = { + BackIcon( + onClick = onClickBack, + ) + }, + currentStep = currentStep.ordinal + 1, + entireStep = EnvelopeAddStep.entries.size, + ) + AnimatedContent( + modifier = modifier.weight(1f), + targetState = currentStep, + label = "SentEnvelopeAddScreen", + transitionSpec = { + susuDefaultAnimatedContentTransitionSpec( + leftDirectionCondition = targetState.ordinal > initialState.ordinal, + ) + }, + ) { targetState -> + when (targetState) { + EnvelopeAddStep.MONEY -> MoneyContent() + EnvelopeAddStep.NAME -> InputContent( + titleText = "누구에게 보냈나요", + placeholder = "이름을 입력해주세요", + friendList = friendList + ) + EnvelopeAddStep.RELATIONSHIP -> CategoryContent( + titleText = "나와는\n어떤 사이 인가요", + categoryList = categoryList, + ) + EnvelopeAddStep.EVENT -> CategoryContent( + titleText = "어떤 경조였나요", + categoryList = eventList, + ) + EnvelopeAddStep.DATE -> DateContent( + titleText = "언제 보냈나요", + name = "김철수", + ) + EnvelopeAddStep.MORE -> CategoryContent( + titleText = "더 기록할 내용이 있다면 알려주세요", + categoryList = moreList, + hasSubTitle = true, + subTitleText = "복수로 선택하셔도 좋아요", + ) + EnvelopeAddStep.VISITED -> CategoryContent( + titleText = "방문했나요?", + categoryList = visitedList + ) + EnvelopeAddStep.PRESENT -> InputContent( + titleText = "보낸 선물을 알려주세요", + placeholder = "무엇을 선물했나요" + ) + EnvelopeAddStep.PHONE -> InputContent( + titleText = "연락처를 남겨주세요", + placeholder = "01012345678", + name = "김철수" + ) + EnvelopeAddStep.MEMO -> InputContent( + titleText = "추가로 남기실 내용이 있나요", + placeholder = "입력해주세요" + ) + } + } + SusuFilledButton( + color = FilledButtonColor.Black, + style = MediumButtonStyle.height60, + shape = RectangleShape, + text = "다음", + onClick = onClickNext, + modifier = modifier + .fillMaxWidth() + .imePadding(), + ) + } +} + +@Preview +@Composable +fun SentEnvelopeAddScreenPreview() { + SusuTheme { + SentEnvelopeAddScreen() + } +} From b3833b145f5d03cf13b534fccae8032fb7fd1233 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 00:24:37 +0900 Subject: [PATCH 08/13] =?UTF-8?q?chore:=20strings=20=EC=B6=94=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/SentEnvelopeAddScreen.kt | 39 ++++++++++--------- .../envelopeadd/content/DateContent.kt | 8 ++-- .../envelopeadd/content/MoneyContent.kt | 8 ++-- feature/sent/src/main/res/values/strings.xml | 20 ++++++++++ 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt index 1a4b1e5f..686b8f97 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.imePadding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.susu.core.designsystem.component.appbar.SusuProgressAppBar import com.susu.core.designsystem.component.appbar.icon.BackIcon @@ -21,6 +22,7 @@ import com.susu.feature.envelopeadd.content.CategoryContent import com.susu.feature.envelopeadd.content.DateContent import com.susu.feature.envelopeadd.content.InputContent import com.susu.feature.envelopeadd.content.MoneyContent +import com.susu.feature.sent.R enum class EnvelopeAddStep { MONEY, @@ -76,44 +78,43 @@ fun SentEnvelopeAddScreen( when (targetState) { EnvelopeAddStep.MONEY -> MoneyContent() EnvelopeAddStep.NAME -> InputContent( - titleText = "누구에게 보냈나요", - placeholder = "이름을 입력해주세요", - friendList = friendList + titleText = stringResource(R.string.sent_envelope_add_name_title), + placeholder = stringResource(R.string.sent_envelope_add_name_placeholder), + friendList = friendList, ) EnvelopeAddStep.RELATIONSHIP -> CategoryContent( - titleText = "나와는\n어떤 사이 인가요", + titleText = stringResource(R.string.sent_envelope_add_relationship_title), categoryList = categoryList, ) EnvelopeAddStep.EVENT -> CategoryContent( - titleText = "어떤 경조였나요", + titleText = stringResource(R.string.sent_envelope_add_event_title), categoryList = eventList, ) EnvelopeAddStep.DATE -> DateContent( - titleText = "언제 보냈나요", - name = "김철수", + name = "김철수" ) EnvelopeAddStep.MORE -> CategoryContent( - titleText = "더 기록할 내용이 있다면 알려주세요", + titleText = stringResource(R.string.sent_envelope_add_more_title), categoryList = moreList, hasSubTitle = true, - subTitleText = "복수로 선택하셔도 좋아요", + subTitleText = stringResource(R.string.sent_envelope_add_more_subtitle), ) EnvelopeAddStep.VISITED -> CategoryContent( - titleText = "방문했나요?", - categoryList = visitedList + titleText = stringResource(R.string.sent_envelope_add_visited_title), + categoryList = visitedList, ) EnvelopeAddStep.PRESENT -> InputContent( - titleText = "보낸 선물을 알려주세요", - placeholder = "무엇을 선물했나요" + titleText = stringResource(R.string.sent_envelope_add_present_title), + placeholder = stringResource(R.string.sent_envelope_add_present_placeholder), ) EnvelopeAddStep.PHONE -> InputContent( - titleText = "연락처를 남겨주세요", - placeholder = "01012345678", - name = "김철수" + titleText = stringResource(R.string.sent_envelope_add_phone_title), + placeholder = stringResource(R.string.sent_envelope_add_phone_placeholder), + name = "김철수", ) EnvelopeAddStep.MEMO -> InputContent( - titleText = "추가로 남기실 내용이 있나요", - placeholder = "입력해주세요" + titleText = stringResource(R.string.sent_envelope_add_memo_title), + placeholder = stringResource(R.string.sent_envelope_add_memo_placeholder), ) } } @@ -121,7 +122,7 @@ fun SentEnvelopeAddScreen( color = FilledButtonColor.Black, style = MediumButtonStyle.height60, shape = RectangleShape, - text = "다음", + text = stringResource(R.string.sent_envelope_add_next), onClick = onClickNext, modifier = modifier .fillMaxWidth() diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt index e120f4f0..bd647583 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.withStyle @@ -25,6 +26,7 @@ import com.susu.core.designsystem.theme.Gray60 import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.ui.extension.susuClickable import com.susu.feature.envelopeadd.content.component.SelectDateRow +import com.susu.feature.sent.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -34,7 +36,6 @@ fun DateContent( horizontal = SusuTheme.spacing.spacing_m, vertical = SusuTheme.spacing.spacing_xl, ), - titleText: String, year: Int? = null, month: Int? = null, day: Int? = null, @@ -44,10 +45,10 @@ fun DateContent( val title = buildAnnotatedString { withStyle(style = SpanStyle(color = Gray60)) { - append(name + "님에게") + append(name + stringResource(R.string.sent_envelope_add_date_to)) } withStyle(style = SpanStyle(color = Gray100)) { - append(titleText) + append(stringResource(R.string.sent_envelope_add_date_title)) } } @@ -90,7 +91,6 @@ fun DateContent( fun DateContentPreview() { SusuTheme { DateContent( - titleText = "언제 보냈나요", name = "김철수", ) } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt index b2fbe111..fbced913 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt @@ -16,6 +16,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.susu.core.designsystem.component.button.FilledButtonColor import com.susu.core.designsystem.component.button.SmallButtonStyle @@ -24,6 +25,7 @@ import com.susu.core.designsystem.component.textfield.SusuPriceTextField import com.susu.core.designsystem.theme.Gray100 import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.ui.extension.toMoneyFormat +import com.susu.feature.sent.R @OptIn(ExperimentalLayoutApi::class) @Composable @@ -45,7 +47,7 @@ fun MoneyContent( .padding(padding), ) { Text( - text = "얼마를 보냈나요", + text = stringResource(R.string.sent_envelope_add_money_title), style = SusuTheme.typography.title_m, color = Gray100, ) @@ -56,7 +58,7 @@ fun MoneyContent( SusuPriceTextField( text = clickedMoney, onTextChange = { clickedMoney = it }, - placeholder = "금액을 입력해주세요", + placeholder = stringResource(R.string.sent_envelope_add_money_placeholder), ) Spacer( modifier = modifier @@ -70,7 +72,7 @@ fun MoneyContent( SusuFilledButton( color = FilledButtonColor.Orange, style = SmallButtonStyle.height32, - text = "${money.toMoneyFormat()}원", + text = money.toMoneyFormat() + stringResource(R.string.sent_envelope_add_money_won), onClick = { clickedMoney = money.toString() }, diff --git a/feature/sent/src/main/res/values/strings.xml b/feature/sent/src/main/res/values/strings.xml index 9e8228ef..5308c8d6 100644 --- a/feature/sent/src/main/res/values/strings.xml +++ b/feature/sent/src/main/res/values/strings.xml @@ -31,4 +31,24 @@ 01012345678 입력해주세요 저장 + %d년 %d월 %d일 + 누구에게 보냈나요 + 이름을 입력해주세요 + 나와는\n어떤 사이 인가요 + 어떤 경조사였나요 + 언제 보냈나요 + 더 기록할 내용이 있다면 알려주세요 + 복수로 선택하셔도 좋아요 + 방문했나요? + 보낸 선물을 알려주세요 + 무엇을 선물했나요 + 연락처를 남겨주세요 + 01012345678 + 추가로 남기실 내용이 있나요 + 입력해주세요 + 다음 + 얼마를 보냈나요 + 금액을 입력해주세요 + + 님에게 From 9fbb003b93a047e66dbea190d61379a1a04ad5b4 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 01:37:04 +0900 Subject: [PATCH 09/13] =?UTF-8?q?feat:=20SentEnvelopeAddScreen=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../susu/feature/navigator/MainNavigator.kt | 5 +++ .../com/susu/feature/navigator/MainScreen.kt | 1 + .../envelopeadd/SentEnvelopeAddScreen.kt | 41 ++++++++++++++++++- .../java/com/susu/feature/sent/SentScreen.kt | 5 ++- .../feature/sent/navigation/SentNavigation.kt | 14 +++++++ 5 files changed, 64 insertions(+), 2 deletions(-) diff --git a/feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt b/feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt index 1ca4d6ff..7b8312e0 100644 --- a/feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt +++ b/feature/navigator/src/main/java/com/susu/feature/navigator/MainNavigator.kt @@ -23,6 +23,7 @@ import com.susu.feature.received.navigation.navigateReceived import com.susu.feature.sent.navigation.SentRoute import com.susu.feature.sent.navigation.navigateSent import com.susu.feature.sent.navigation.navigateSentEnvelope +import com.susu.feature.sent.navigation.navigateSentEnvelopeAdd import com.susu.feature.sent.navigation.navigateSentEnvelopeDetail import com.susu.feature.sent.navigation.navigateSentEnvelopeEdit import com.susu.feature.statistics.navigation.navigateStatistics @@ -93,6 +94,10 @@ internal class MainNavigator( navController.navigateSentEnvelopeEdit() } + fun navigateSentEnvelopeAdd() { + navController.navigateSentEnvelopeAdd() + } + fun navigateLogin() { navController.navigate(LoginSignupRoute.Parent.Login.route) { popUpTo(id = navController.graph.id) { diff --git a/feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt b/feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt index efadbaf9..014dfc91 100644 --- a/feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt +++ b/feature/navigator/src/main/java/com/susu/feature/navigator/MainScreen.kt @@ -70,6 +70,7 @@ internal fun MainScreen( navigateSentEnvelope = navigator::navigateSentEnvelope, navigateSentEnvelopeDetail = navigator::navigateSentEnvelopeDetail, navigateSentEnvelopeEdit = navigator::navigateSentEnvelopeEdit, + navigateSentEnvelopeAdd = navigator::navigateSentEnvelopeAdd, ) receivedNavGraph( diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt index 686b8f97..b4831782 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -7,6 +7,10 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.res.stringResource @@ -37,6 +41,33 @@ enum class EnvelopeAddStep { PHONE, } +@Composable +fun SentEnvelopeAddRoute( + popBackStack: () -> Unit, +) { + var currentStep by remember { mutableStateOf(EnvelopeAddStep.MONEY) } + + SentEnvelopeAddScreen( + currentStep = currentStep, + onClickBack = popBackStack, + onClickNext = { + // TODO: 수정 필요 (MORE 이후 분리 필요) + currentStep = when (currentStep) { + EnvelopeAddStep.MONEY -> EnvelopeAddStep.NAME + EnvelopeAddStep.NAME -> EnvelopeAddStep.RELATIONSHIP + EnvelopeAddStep.RELATIONSHIP -> EnvelopeAddStep.EVENT + EnvelopeAddStep.EVENT -> EnvelopeAddStep.DATE + EnvelopeAddStep.DATE -> EnvelopeAddStep.MORE + EnvelopeAddStep.MORE -> EnvelopeAddStep.VISITED + EnvelopeAddStep.VISITED -> EnvelopeAddStep.PRESENT + EnvelopeAddStep.PRESENT -> EnvelopeAddStep.PHONE + EnvelopeAddStep.PHONE -> EnvelopeAddStep.MEMO + else -> EnvelopeAddStep.MEMO + } + }, + ) +} + @Composable fun SentEnvelopeAddScreen( modifier: Modifier = Modifier, @@ -82,36 +113,44 @@ fun SentEnvelopeAddScreen( placeholder = stringResource(R.string.sent_envelope_add_name_placeholder), friendList = friendList, ) + EnvelopeAddStep.RELATIONSHIP -> CategoryContent( titleText = stringResource(R.string.sent_envelope_add_relationship_title), categoryList = categoryList, ) + EnvelopeAddStep.EVENT -> CategoryContent( titleText = stringResource(R.string.sent_envelope_add_event_title), categoryList = eventList, ) + EnvelopeAddStep.DATE -> DateContent( - name = "김철수" + name = "김철수", ) + EnvelopeAddStep.MORE -> CategoryContent( titleText = stringResource(R.string.sent_envelope_add_more_title), categoryList = moreList, hasSubTitle = true, subTitleText = stringResource(R.string.sent_envelope_add_more_subtitle), ) + EnvelopeAddStep.VISITED -> CategoryContent( titleText = stringResource(R.string.sent_envelope_add_visited_title), categoryList = visitedList, ) + EnvelopeAddStep.PRESENT -> InputContent( titleText = stringResource(R.string.sent_envelope_add_present_title), placeholder = stringResource(R.string.sent_envelope_add_present_placeholder), ) + EnvelopeAddStep.PHONE -> InputContent( titleText = stringResource(R.string.sent_envelope_add_phone_title), placeholder = stringResource(R.string.sent_envelope_add_phone_placeholder), name = "김철수", ) + EnvelopeAddStep.MEMO -> InputContent( titleText = stringResource(R.string.sent_envelope_add_memo_title), placeholder = stringResource(R.string.sent_envelope_add_memo_placeholder), diff --git a/feature/sent/src/main/java/com/susu/feature/sent/SentScreen.kt b/feature/sent/src/main/java/com/susu/feature/sent/SentScreen.kt index f3d46821..e824e0c2 100644 --- a/feature/sent/src/main/java/com/susu/feature/sent/SentScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/sent/SentScreen.kt @@ -42,10 +42,12 @@ import com.susu.feature.sent.component.SentCard fun SentRoute( padding: PaddingValues, navigateSentEnvelope: () -> Unit, + navigateSentEnvelopeAdd: () -> Unit, ) { SentScreen( padding = padding, onClickHistoryShowAll = navigateSentEnvelope, + onClickAddEnvelope = navigateSentEnvelopeAdd, ) } @@ -56,6 +58,7 @@ fun SentScreen( onClickSearchIcon: () -> Unit = {}, onClickNotificationIcon: () -> Unit = {}, onClickHistoryShowAll: () -> Unit = {}, + onClickAddEnvelope: () -> Unit = {}, ) { // TODO: 수정 필요 (확인을 위해 false로 설정) var isEmpty by remember { mutableStateOf(false) } @@ -108,7 +111,7 @@ fun SentScreen( modifier = modifier .align(Alignment.BottomEnd) .padding(SusuTheme.spacing.spacing_l), - onClick = {}, + onClick = onClickAddEnvelope, ) } } diff --git a/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt b/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt index 6e10eae8..564803c0 100644 --- a/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt +++ b/feature/sent/src/main/java/com/susu/feature/sent/navigation/SentNavigation.kt @@ -6,6 +6,7 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.susu.feature.envelope.SentEnvelopeRoute +import com.susu.feature.envelopeadd.SentEnvelopeAddRoute import com.susu.feature.envelopedetail.SentEnvelopeDetailRoute import com.susu.feature.envelopeedit.SentEnvelopeEditRoute import com.susu.feature.sent.SentRoute @@ -26,17 +27,23 @@ fun NavController.navigateSentEnvelopeEdit() { navigate(SentRoute.sentEnvelopeEditRoute) } +fun NavController.navigateSentEnvelopeAdd() { + navigate(SentRoute.sentEnvelopeAddRoute) +} + fun NavGraphBuilder.sentNavGraph( padding: PaddingValues, popBackStack: () -> Unit, navigateSentEnvelope: () -> Unit, navigateSentEnvelopeDetail: () -> Unit, navigateSentEnvelopeEdit: () -> Unit, + navigateSentEnvelopeAdd: () -> Unit, ) { composable(route = SentRoute.route) { SentRoute( padding = padding, navigateSentEnvelope = navigateSentEnvelope, + navigateSentEnvelopeAdd = navigateSentEnvelopeAdd, ) } @@ -60,6 +67,12 @@ fun NavGraphBuilder.sentNavGraph( navigateSentEnvelopeDetail = navigateSentEnvelopeDetail, ) } + + composable(route = SentRoute.sentEnvelopeAddRoute) { + SentEnvelopeAddRoute( + popBackStack = popBackStack, + ) + } } object SentRoute { @@ -67,4 +80,5 @@ object SentRoute { const val sentEnvelopeRoute = "sent-envelope" const val sentEnvelopeDetailRoute = "sent-envelope-detail" const val sentEnvelopeEditRoute = "sent-envelope-edit" + const val sentEnvelopeAddRoute = "sent-envelope-add" } From 92aa76171ecd64eef28dc99e05206f990d38747d Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 02:16:55 +0900 Subject: [PATCH 10/13] =?UTF-8?q?feat:=20=EC=B6=94=EA=B0=80=20strings=20?= =?UTF-8?q?=EC=B6=94=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/content/CategoryContent.kt | 42 +++++++++++++++---- .../envelopeadd/content/InputContent.kt | 4 +- feature/sent/src/main/res/values/strings.xml | 2 + 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt index fe520155..1fe87ba2 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt @@ -17,6 +17,10 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.withStyle import androidx.compose.ui.tooling.preview.Preview import com.susu.core.designsystem.component.button.FilledButtonColor import com.susu.core.designsystem.component.button.GhostButtonColor @@ -24,8 +28,10 @@ import com.susu.core.designsystem.component.button.MediumButtonStyle import com.susu.core.designsystem.component.button.SusuFilledButton import com.susu.core.designsystem.component.button.SusuGhostButton import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray60 import com.susu.core.designsystem.theme.Gray70 import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R @Composable fun CategoryContent( @@ -34,6 +40,7 @@ fun CategoryContent( horizontal = SusuTheme.spacing.spacing_m, vertical = SusuTheme.spacing.spacing_xl, ), + event: String? = null, titleText: String, hasSubTitle: Boolean = false, subTitleText: String = "", @@ -42,17 +49,35 @@ fun CategoryContent( val scrollState = rememberScrollState() var selectedItem by remember { mutableStateOf(-1) } + val title = buildAnnotatedString { + withStyle(style = SpanStyle(color = Gray60)) { + append(event + stringResource(R.string.sent_envelope_add_visited_to)) + } + withStyle(style = SpanStyle(color = Gray100)) { + append(titleText) + } + } + Column( modifier = modifier .fillMaxSize() .padding(padding) .verticalScroll(scrollState), ) { - Text( - text = titleText, - style = SusuTheme.typography.title_m, - color = Gray100, - ) + if (event == null) { + Text( + text = titleText, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + } else { + Text( + text = title, + style = SusuTheme.typography.title_m, + color = Gray100, + ) + } + if (hasSubTitle) { Text( text = subTitleText, @@ -102,10 +127,11 @@ fun CategoryContentPreview() { SusuTheme { CategoryContent( - titleText = "나와는\n어떤 사이 인가요", + event = "결혼식", + titleText = "방문했나요?", categoryList = categoryList, - hasSubTitle = true, - subTitleText = "복수로 선택하셔도 좋아요" + hasSubTitle = false, +// subTitleText = "복수로 선택하셔도 좋아요" ) } } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt index d01de36e..6b60b4b7 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt @@ -17,6 +17,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.input.KeyboardType @@ -28,6 +29,7 @@ import com.susu.core.designsystem.theme.Gray40 import com.susu.core.designsystem.theme.Gray60 import com.susu.core.designsystem.theme.SusuTheme import com.susu.feature.envelopeadd.content.component.FriendListItem +import com.susu.feature.sent.R @Composable fun InputContent( @@ -45,7 +47,7 @@ fun InputContent( val title = buildAnnotatedString { withStyle(style = SpanStyle(color = Gray60)) { - append(name + "님의 ") + append(name + stringResource(R.string.sent_envelope_add_phone_to)) } withStyle(style = SpanStyle(color = Gray100)) { append(titleText) diff --git a/feature/sent/src/main/res/values/strings.xml b/feature/sent/src/main/res/values/strings.xml index 5308c8d6..a1ce7b4d 100644 --- a/feature/sent/src/main/res/values/strings.xml +++ b/feature/sent/src/main/res/values/strings.xml @@ -51,4 +51,6 @@ 금액을 입력해주세요 님에게 + "님의 " + "을 " From d1c062139820939000d9ebb61c9a180ad6c7c3e0 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 02:39:10 +0900 Subject: [PATCH 11/13] =?UTF-8?q?chore:=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=A0=95=EB=A6=AC=20=EB=B0=8F=20Preview=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/SentEnvelopeAddScreen.kt | 3 +- .../envelopeadd/content/CategoryContent.kt | 55 ++++++++++++++++--- .../envelopeadd/content/InputContent.kt | 34 ++++++++++++ 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt index b4831782..59ed345a 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -37,8 +37,8 @@ enum class EnvelopeAddStep { MORE, VISITED, PRESENT, - MEMO, PHONE, + MEMO, } @Composable @@ -131,7 +131,6 @@ fun SentEnvelopeAddScreen( EnvelopeAddStep.MORE -> CategoryContent( titleText = stringResource(R.string.sent_envelope_add_more_title), categoryList = moreList, - hasSubTitle = true, subTitleText = stringResource(R.string.sent_envelope_add_more_subtitle), ) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt index 1fe87ba2..ec155974 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt @@ -42,8 +42,7 @@ fun CategoryContent( ), event: String? = null, titleText: String, - hasSubTitle: Boolean = false, - subTitleText: String = "", + subTitleText: String? = null, categoryList: List, ) { val scrollState = rememberScrollState() @@ -78,7 +77,7 @@ fun CategoryContent( ) } - if (hasSubTitle) { + if (subTitleText != null) { Text( text = subTitleText, style = SusuTheme.typography.text_xs, @@ -122,16 +121,56 @@ fun CategoryContent( @Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) @Composable -fun CategoryContentPreview() { - val categoryList = mutableListOf("친구", "가족", "친척", "동료", "직접 입력") +fun RelationshipContentPreview() { + val relationshipList = mutableListOf("친구", "가족", "친척", "동료", "직접 입력") + + SusuTheme { + CategoryContent( + titleText = "나와는\n어떤 사이 인가요", + categoryList = relationshipList, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun EventContentPreview() { + val eventList = mutableListOf("결혼식", "돌잔치", "장례식", "생일 기념일", "직접 입력") + + SusuTheme { + CategoryContent( + titleText = "어떤 경조사였나요", + categoryList = eventList, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun MoreContentPreview() { + val moreList = mutableListOf("방문여부", "선물", "메모", "받은 이의 연락처") + + SusuTheme { + CategoryContent( + titleText = "더 기록할 내용이 있다면 알려주세요", + subTitleText = "복수로 선택하셔도 좋아요", + categoryList = moreList, + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun VisitedContentPreview() { + val visitedList = mutableListOf("예", "아니요") SusuTheme { CategoryContent( event = "결혼식", titleText = "방문했나요?", - categoryList = categoryList, - hasSubTitle = false, -// subTitleText = "복수로 선택하셔도 좋아요" + categoryList = visitedList, ) } } + + diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt index 6b60b4b7..4a70c450 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt @@ -111,3 +111,37 @@ fun NameContentPreview() { ) } } + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun PresentContentPreview() { + SusuTheme { + InputContent( + titleText = "보낸 선물을 알려주세요", + placeholder = "무엇을 선물했나요", + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun PhoneContentPreview() { + SusuTheme { + InputContent( + name = "김철수", + titleText = "연락처를 남겨주세요", + placeholder = "01012345678", + ) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun MemoContentPreview() { + SusuTheme { + InputContent( + titleText = "추가로 남기실 내용이 있나요", + placeholder = "입력해주세요", + ) + } +} From 04b2b8f69dcdf88974258e51c44f66fee9809d21 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 02:41:40 +0900 Subject: [PATCH 12/13] =?UTF-8?q?chore:=20ktlintFormat=20=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../susu/feature/envelopeadd/content/CategoryContent.kt | 4 +--- .../com/susu/feature/envelopeadd/content/DateContent.kt | 2 +- .../com/susu/feature/envelopeadd/content/InputContent.kt | 4 ++-- .../com/susu/feature/envelopeadd/content/MoneyContent.kt | 8 ++++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt index ec155974..58431217 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt @@ -82,7 +82,7 @@ fun CategoryContent( text = subTitleText, style = SusuTheme.typography.text_xs, color = Gray70, - modifier = modifier.padding(top = SusuTheme.spacing.spacing_xxxxs) + modifier = modifier.padding(top = SusuTheme.spacing.spacing_xxxxs), ) } Spacer( @@ -172,5 +172,3 @@ fun VisitedContentPreview() { ) } } - - diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt index bd647583..48e758de 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/DateContent.kt @@ -73,7 +73,7 @@ fun DateContent( modifier = modifier.susuClickable( rippleEnabled = false, onClick = { isSheetOpen = true }, - ) + ), ) } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt index 4a70c450..317eeb32 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt @@ -83,13 +83,13 @@ fun InputContent( placeholder = placeholder, placeholderColor = Gray40, modifier = modifier.fillMaxWidth(), - keyboardOptions = if (name == null) KeyboardOptions.Default else KeyboardOptions(keyboardType = KeyboardType.Number) + keyboardOptions = if (name == null) KeyboardOptions.Default else KeyboardOptions(keyboardType = KeyboardType.Number), ) Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) if (friendList.isNotEmpty()) { // TODO: 친구 목록 서버 연동 - LazyColumn() { + LazyColumn { items(friendList) { friend -> FriendListItem(friend) } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt index fbced913..36f5e617 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoneyContent.kt @@ -33,11 +33,15 @@ fun MoneyContent( modifier: Modifier = Modifier, padding: PaddingValues = PaddingValues( horizontal = SusuTheme.spacing.spacing_m, - vertical = SusuTheme.spacing.spacing_xl + vertical = SusuTheme.spacing.spacing_xl, ), ) { val moneyList = listOf( - 10000, 30000, 50000, 100000, 500000, + 10000, + 30000, + 50000, + 100000, + 500000, ) var clickedMoney by remember { mutableStateOf("") } From 25d7c35fd65a70b3d9fbdc2efabee26698adbc17 Mon Sep 17 00:00:00 2001 From: syb8200 Date: Thu, 18 Jan 2024 22:59:43 +0900 Subject: [PATCH 13/13] =?UTF-8?q?refactor:=20=ED=94=BC=EB=93=9C=EB=B0=B1?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=20(=ED=99=94=EB=A9=B4=20=EB=B3=84=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../envelopeadd/SentEnvelopeAddScreen.kt | 68 ++++------- .../envelopeadd/content/EventContent.kt | 96 ++++++++++++++++ .../envelopeadd/content/MemoContent.kt | 66 +++++++++++ .../envelopeadd/content/MoreContent.kt | 106 ++++++++++++++++++ .../envelopeadd/content/NameContent.kt | 81 +++++++++++++ .../{InputContent.kt => PhoneContent.kt} | 92 +++------------ .../envelopeadd/content/PresentContent.kt | 66 +++++++++++ .../content/RelationshipContent.kt | 96 ++++++++++++++++ .../{CategoryContent.kt => VisitedContent.kt} | 95 +++------------- 9 files changed, 560 insertions(+), 206 deletions(-) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/EventContent.kt create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MemoContent.kt create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoreContent.kt create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/NameContent.kt rename feature/sent/src/main/java/com/susu/feature/envelopeadd/content/{InputContent.kt => PhoneContent.kt} (50%) create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PresentContent.kt create mode 100644 feature/sent/src/main/java/com/susu/feature/envelopeadd/content/RelationshipContent.kt rename feature/sent/src/main/java/com/susu/feature/envelopeadd/content/{CategoryContent.kt => VisitedContent.kt} (57%) diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt index 59ed345a..7999209c 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/SentEnvelopeAddScreen.kt @@ -22,10 +22,16 @@ import com.susu.core.designsystem.component.button.MediumButtonStyle import com.susu.core.designsystem.component.button.SusuFilledButton import com.susu.core.designsystem.theme.SusuTheme import com.susu.core.ui.extension.susuDefaultAnimatedContentTransitionSpec -import com.susu.feature.envelopeadd.content.CategoryContent import com.susu.feature.envelopeadd.content.DateContent -import com.susu.feature.envelopeadd.content.InputContent +import com.susu.feature.envelopeadd.content.EventContent +import com.susu.feature.envelopeadd.content.MemoContent import com.susu.feature.envelopeadd.content.MoneyContent +import com.susu.feature.envelopeadd.content.MoreContent +import com.susu.feature.envelopeadd.content.NameContent +import com.susu.feature.envelopeadd.content.PhoneContent +import com.susu.feature.envelopeadd.content.PresentContent +import com.susu.feature.envelopeadd.content.RelationshipContent +import com.susu.feature.envelopeadd.content.VisitedContent import com.susu.feature.sent.R enum class EnvelopeAddStep { @@ -76,7 +82,7 @@ fun SentEnvelopeAddScreen( onClickNext: () -> Unit = {}, ) { // TODO: 수정 필요 - val categoryList = listOf("친구", "가족", "친척", "동료", "직접 입력") + val relationshipList = listOf("친구", "가족", "친척", "동료", "직접 입력") val friendList = listOf("김철수", "국영수", "신짱구", "홍길동") val eventList = listOf("결혼식", "돌잔치", "장례식", "생일 기념일", "직접 입력") val moreList = listOf("방문여부", "선물", "메모", "보낸 이의 연락처") @@ -108,52 +114,18 @@ fun SentEnvelopeAddScreen( ) { targetState -> when (targetState) { EnvelopeAddStep.MONEY -> MoneyContent() - EnvelopeAddStep.NAME -> InputContent( - titleText = stringResource(R.string.sent_envelope_add_name_title), - placeholder = stringResource(R.string.sent_envelope_add_name_placeholder), - friendList = friendList, - ) - - EnvelopeAddStep.RELATIONSHIP -> CategoryContent( - titleText = stringResource(R.string.sent_envelope_add_relationship_title), - categoryList = categoryList, - ) - - EnvelopeAddStep.EVENT -> CategoryContent( - titleText = stringResource(R.string.sent_envelope_add_event_title), - categoryList = eventList, - ) - - EnvelopeAddStep.DATE -> DateContent( - name = "김철수", - ) - - EnvelopeAddStep.MORE -> CategoryContent( - titleText = stringResource(R.string.sent_envelope_add_more_title), - categoryList = moreList, - subTitleText = stringResource(R.string.sent_envelope_add_more_subtitle), - ) - - EnvelopeAddStep.VISITED -> CategoryContent( - titleText = stringResource(R.string.sent_envelope_add_visited_title), - categoryList = visitedList, - ) - - EnvelopeAddStep.PRESENT -> InputContent( - titleText = stringResource(R.string.sent_envelope_add_present_title), - placeholder = stringResource(R.string.sent_envelope_add_present_placeholder), - ) - - EnvelopeAddStep.PHONE -> InputContent( - titleText = stringResource(R.string.sent_envelope_add_phone_title), - placeholder = stringResource(R.string.sent_envelope_add_phone_placeholder), - name = "김철수", - ) - - EnvelopeAddStep.MEMO -> InputContent( - titleText = stringResource(R.string.sent_envelope_add_memo_title), - placeholder = stringResource(R.string.sent_envelope_add_memo_placeholder), + EnvelopeAddStep.NAME -> NameContent(friendList = friendList) + EnvelopeAddStep.RELATIONSHIP -> RelationshipContent(relationshipList = relationshipList) + EnvelopeAddStep.EVENT -> EventContent(eventList = eventList) + EnvelopeAddStep.DATE -> DateContent(name = "김철수") + EnvelopeAddStep.MORE -> MoreContent(moreList = moreList) + EnvelopeAddStep.VISITED -> VisitedContent( + event = "결혼식", + visitedList = visitedList, ) + EnvelopeAddStep.PRESENT -> PresentContent() + EnvelopeAddStep.PHONE -> PhoneContent(name = "김철수") + EnvelopeAddStep.MEMO -> MemoContent() } } SusuFilledButton( diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/EventContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/EventContent.kt new file mode 100644 index 00000000..10d3b3cf --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/EventContent.kt @@ -0,0 +1,96 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.GhostButtonColor +import com.susu.core.designsystem.component.button.MediumButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.component.button.SusuGhostButton +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R + +@Composable +fun EventContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + eventList: List, +) { + val scrollState = rememberScrollState() + var selectedItem by remember { mutableStateOf(-1) } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding) + .verticalScroll(scrollState), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_relationship_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxl), + ) + Column( + verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + ) { + eventList.forEachIndexed { index, event -> + if (selectedItem == index) { + SusuFilledButton( + color = FilledButtonColor.Orange, + style = MediumButtonStyle.height60, + text = event, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } else { + SusuGhostButton( + color = GhostButtonColor.Black, + style = MediumButtonStyle.height60, + text = event, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun EventContentPreview() { + val eventList = mutableListOf("결혼식", "돌잔치", "장례식", "생일 기념일", "직접 입력") + + SusuTheme { + EventContent(eventList = eventList) + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MemoContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MemoContent.kt new file mode 100644 index 00000000..bdbffa06 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MemoContent.kt @@ -0,0 +1,66 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.textfield.SusuBasicTextField +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R + +@Composable +fun MemoContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), +) { + var memo by remember { mutableStateOf("") } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_memo_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SusuBasicTextField( + text = memo, + onTextChange = { memo = it }, + placeholder = stringResource(id = R.string.sent_envelope_add_memo_placeholder), + placeholderColor = Gray40, + modifier = modifier.fillMaxWidth(), + ) + Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun MemoContentPreview() { + SusuTheme { + MemoContent() + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoreContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoreContent.kt new file mode 100644 index 00000000..ea9ce8f4 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/MoreContent.kt @@ -0,0 +1,106 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.GhostButtonColor +import com.susu.core.designsystem.component.button.MediumButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.component.button.SusuGhostButton +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray70 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R + +@Composable +fun MoreContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + moreList: List, +) { + val scrollState = rememberScrollState() + var selectedItem by remember { mutableStateOf(-1) } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding) + .verticalScroll(scrollState), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_more_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxxxs), + ) + Text( + text = stringResource(id = R.string.sent_envelope_add_more_subtitle), + style = SusuTheme.typography.text_xs, + color = Gray70, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxl), + ) + Column( + verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + ) { + moreList.forEachIndexed { index, category -> + if (selectedItem == index) { + SusuFilledButton( + color = FilledButtonColor.Orange, + style = MediumButtonStyle.height60, + text = category, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } else { + SusuGhostButton( + color = GhostButtonColor.Black, + style = MediumButtonStyle.height60, + text = category, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun MoreContentPreview() { + val moreList = mutableListOf("방문여부", "선물", "메모", "받은 이의 연락처") + + SusuTheme { + MoreContent(moreList = moreList) + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/NameContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/NameContent.kt new file mode 100644 index 00000000..5be6dfd1 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/NameContent.kt @@ -0,0 +1,81 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.textfield.SusuBasicTextField +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.envelopeadd.content.component.FriendListItem +import com.susu.feature.sent.R + +@Composable +fun NameContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + friendList: List = emptyList(), +) { + var name by remember { mutableStateOf("") } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_name_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SusuBasicTextField( + text = name, + onTextChange = { name = it }, + placeholder = stringResource(id = R.string.sent_envelope_add_name_placeholder), + placeholderColor = Gray40, + modifier = modifier.fillMaxWidth(), + ) + Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) + + if (friendList.isNotEmpty()) { + // TODO: 친구 목록 서버 연동 + LazyColumn { + items(friendList) { friend -> + FriendListItem(friend) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun NameContentPreview() { + SusuTheme { + val friendList = listOf("김철수", "국영수", "가나다") + + NameContent(friendList = friendList) + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PhoneContent.kt similarity index 50% rename from feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt rename to feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PhoneContent.kt index 317eeb32..58f52fa8 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/InputContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PhoneContent.kt @@ -7,8 +7,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.items import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -28,29 +26,25 @@ import com.susu.core.designsystem.theme.Gray100 import com.susu.core.designsystem.theme.Gray40 import com.susu.core.designsystem.theme.Gray60 import com.susu.core.designsystem.theme.SusuTheme -import com.susu.feature.envelopeadd.content.component.FriendListItem import com.susu.feature.sent.R @Composable -fun InputContent( +fun PhoneContent( modifier: Modifier = Modifier, padding: PaddingValues = PaddingValues( horizontal = SusuTheme.spacing.spacing_m, vertical = SusuTheme.spacing.spacing_xl, ), - name: String? = null, - titleText: String, - friendList: List = emptyList(), - placeholder: String, + name: String, ) { - var textFieldContent by remember { mutableStateOf("") } + var phoneNumber by remember { mutableStateOf("") } val title = buildAnnotatedString { withStyle(style = SpanStyle(color = Gray60)) { append(name + stringResource(R.string.sent_envelope_add_phone_to)) } withStyle(style = SpanStyle(color = Gray100)) { - append(titleText) + append(stringResource(id = R.string.sent_envelope_add_phone_title)) } } @@ -59,67 +53,24 @@ fun InputContent( .fillMaxSize() .padding(padding), ) { - if (name == null) { - Text( - text = titleText, - style = SusuTheme.typography.title_m, - color = Gray100, - ) - } else { - Text( - text = title, - style = SusuTheme.typography.title_m, - color = Gray100, - ) - } - + Text( + text = title, + style = SusuTheme.typography.title_m, + color = Gray100, + ) Spacer( modifier = modifier .size(SusuTheme.spacing.spacing_m), ) SusuBasicTextField( - text = textFieldContent, - onTextChange = { textFieldContent = it }, - placeholder = placeholder, + text = phoneNumber, + onTextChange = { phoneNumber = it }, + placeholder = stringResource(id = R.string.sent_envelope_add_phone_placeholder), placeholderColor = Gray40, modifier = modifier.fillMaxWidth(), - keyboardOptions = if (name == null) KeyboardOptions.Default else KeyboardOptions(keyboardType = KeyboardType.Number), + keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), ) Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) - - if (friendList.isNotEmpty()) { - // TODO: 친구 목록 서버 연동 - LazyColumn { - items(friendList) { friend -> - FriendListItem(friend) - } - } - } - } -} - -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun NameContentPreview() { - SusuTheme { - val friendList = listOf("김철수", "국영수", "가나다") - - InputContent( - titleText = "누구에게 보냈나요", - placeholder = "이름을 입력해주세요", - friendList = friendList, - ) - } -} - -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun PresentContentPreview() { - SusuTheme { - InputContent( - titleText = "보낸 선물을 알려주세요", - placeholder = "무엇을 선물했나요", - ) } } @@ -127,21 +78,6 @@ fun PresentContentPreview() { @Composable fun PhoneContentPreview() { SusuTheme { - InputContent( - name = "김철수", - titleText = "연락처를 남겨주세요", - placeholder = "01012345678", - ) - } -} - -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun MemoContentPreview() { - SusuTheme { - InputContent( - titleText = "추가로 남기실 내용이 있나요", - placeholder = "입력해주세요", - ) + PhoneContent(name = "김철수") } } diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PresentContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PresentContent.kt new file mode 100644 index 00000000..00863eea --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/PresentContent.kt @@ -0,0 +1,66 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.textfield.SusuBasicTextField +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.Gray40 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R + +@Composable +fun PresentContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), +) { + var sentPresent by remember { mutableStateOf("") } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_present_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_m), + ) + SusuBasicTextField( + text = sentPresent, + onTextChange = { sentPresent = it }, + placeholder = stringResource(id = R.string.sent_envelope_add_present_placeholder), + placeholderColor = Gray40, + modifier = modifier.fillMaxWidth(), + ) + Spacer(modifier = modifier.size(SusuTheme.spacing.spacing_xl)) + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun PresentContentPreview() { + SusuTheme { + PresentContent() + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/RelationshipContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/RelationshipContent.kt new file mode 100644 index 00000000..cfbeece1 --- /dev/null +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/RelationshipContent.kt @@ -0,0 +1,96 @@ +package com.susu.feature.envelopeadd.content + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import com.susu.core.designsystem.component.button.FilledButtonColor +import com.susu.core.designsystem.component.button.GhostButtonColor +import com.susu.core.designsystem.component.button.MediumButtonStyle +import com.susu.core.designsystem.component.button.SusuFilledButton +import com.susu.core.designsystem.component.button.SusuGhostButton +import com.susu.core.designsystem.theme.Gray100 +import com.susu.core.designsystem.theme.SusuTheme +import com.susu.feature.sent.R + +@Composable +fun RelationshipContent( + modifier: Modifier = Modifier, + padding: PaddingValues = PaddingValues( + horizontal = SusuTheme.spacing.spacing_m, + vertical = SusuTheme.spacing.spacing_xl, + ), + relationshipList: List, +) { + val scrollState = rememberScrollState() + var selectedItem by remember { mutableStateOf(-1) } + + Column( + modifier = modifier + .fillMaxSize() + .padding(padding) + .verticalScroll(scrollState), + ) { + Text( + text = stringResource(id = R.string.sent_envelope_add_relationship_title), + style = SusuTheme.typography.title_m, + color = Gray100, + ) + Spacer( + modifier = modifier + .size(SusuTheme.spacing.spacing_xxl), + ) + Column( + verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), + ) { + relationshipList.forEachIndexed { index, relationship -> + if (selectedItem == index) { + SusuFilledButton( + color = FilledButtonColor.Orange, + style = MediumButtonStyle.height60, + text = relationship, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } else { + SusuGhostButton( + color = GhostButtonColor.Black, + style = MediumButtonStyle.height60, + text = relationship, + onClick = { + selectedItem = index + }, + modifier = modifier.fillMaxWidth(), + ) + } + } + } + } +} + +@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) +@Composable +fun RelationshipContentPreview() { + val relationshipList = mutableListOf("친구", "가족", "친척", "동료", "직접 입력") + + SusuTheme { + RelationshipContent(relationshipList = relationshipList) + } +} diff --git a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/VisitedContent.kt similarity index 57% rename from feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt rename to feature/sent/src/main/java/com/susu/feature/envelopeadd/content/VisitedContent.kt index 58431217..896c106f 100644 --- a/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/CategoryContent.kt +++ b/feature/sent/src/main/java/com/susu/feature/envelopeadd/content/VisitedContent.kt @@ -8,8 +8,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -29,23 +27,19 @@ import com.susu.core.designsystem.component.button.SusuFilledButton import com.susu.core.designsystem.component.button.SusuGhostButton import com.susu.core.designsystem.theme.Gray100 import com.susu.core.designsystem.theme.Gray60 -import com.susu.core.designsystem.theme.Gray70 import com.susu.core.designsystem.theme.SusuTheme import com.susu.feature.sent.R @Composable -fun CategoryContent( +fun VisitedContent( modifier: Modifier = Modifier, padding: PaddingValues = PaddingValues( horizontal = SusuTheme.spacing.spacing_m, vertical = SusuTheme.spacing.spacing_xl, ), - event: String? = null, - titleText: String, - subTitleText: String? = null, - categoryList: List, + event: String, + visitedList: List, ) { - val scrollState = rememberScrollState() var selectedItem by remember { mutableStateOf(-1) } val title = buildAnnotatedString { @@ -53,38 +47,20 @@ fun CategoryContent( append(event + stringResource(R.string.sent_envelope_add_visited_to)) } withStyle(style = SpanStyle(color = Gray100)) { - append(titleText) + append(stringResource(id = R.string.sent_envelope_add_visited_title)) } } Column( modifier = modifier .fillMaxSize() - .padding(padding) - .verticalScroll(scrollState), + .padding(padding), ) { - if (event == null) { - Text( - text = titleText, - style = SusuTheme.typography.title_m, - color = Gray100, - ) - } else { - Text( - text = title, - style = SusuTheme.typography.title_m, - color = Gray100, - ) - } - - if (subTitleText != null) { - Text( - text = subTitleText, - style = SusuTheme.typography.text_xs, - color = Gray70, - modifier = modifier.padding(top = SusuTheme.spacing.spacing_xxxxs), - ) - } + Text( + text = title, + style = SusuTheme.typography.title_m, + color = Gray100, + ) Spacer( modifier = modifier .size(SusuTheme.spacing.spacing_xxl), @@ -92,12 +68,12 @@ fun CategoryContent( Column( verticalArrangement = Arrangement.spacedBy(SusuTheme.spacing.spacing_xxs), ) { - categoryList.forEachIndexed { index, category -> + visitedList.forEachIndexed { index, answer -> if (selectedItem == index) { SusuFilledButton( color = FilledButtonColor.Orange, style = MediumButtonStyle.height60, - text = category, + text = answer, onClick = { selectedItem = index }, @@ -107,7 +83,7 @@ fun CategoryContent( SusuGhostButton( color = GhostButtonColor.Black, style = MediumButtonStyle.height60, - text = category, + text = answer, onClick = { selectedItem = index }, @@ -119,56 +95,15 @@ fun CategoryContent( } } -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun RelationshipContentPreview() { - val relationshipList = mutableListOf("친구", "가족", "친척", "동료", "직접 입력") - - SusuTheme { - CategoryContent( - titleText = "나와는\n어떤 사이 인가요", - categoryList = relationshipList, - ) - } -} - -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun EventContentPreview() { - val eventList = mutableListOf("결혼식", "돌잔치", "장례식", "생일 기념일", "직접 입력") - - SusuTheme { - CategoryContent( - titleText = "어떤 경조사였나요", - categoryList = eventList, - ) - } -} - -@Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) -@Composable -fun MoreContentPreview() { - val moreList = mutableListOf("방문여부", "선물", "메모", "받은 이의 연락처") - - SusuTheme { - CategoryContent( - titleText = "더 기록할 내용이 있다면 알려주세요", - subTitleText = "복수로 선택하셔도 좋아요", - categoryList = moreList, - ) - } -} - @Preview(showBackground = true, backgroundColor = 0xFFF6F6F6) @Composable fun VisitedContentPreview() { val visitedList = mutableListOf("예", "아니요") SusuTheme { - CategoryContent( + VisitedContent( event = "결혼식", - titleText = "방문했나요?", - categoryList = visitedList, + visitedList = visitedList, ) } }