Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package com.sopt.clody.presentation.ui.auth.component.button

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
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.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.sopt.clody.R
import com.sopt.clody.ui.theme.ClodyTheme

@Composable
fun GoogleButton(
text: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Button(
onClick = onClick,
colors = ButtonDefaults.buttonColors(containerColor = ClodyTheme.colors.gray08),
shape = RoundedCornerShape(10.dp),
modifier = modifier
.fillMaxWidth()
.height(48.dp)
.padding(horizontal = 24.dp),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P5
없애도 똑같지 않을까염?
그리고 만약 내부여백이 필요하면
contentPadding = PaddingValues(horizontal = 24.dp)
요게 더 좋을 것 같습니다잉

) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
modifier = Modifier.fillMaxSize(),
) {
Image(
painter = painterResource(id = R.drawable.img_google_button_logo),
contentDescription = null,
modifier = Modifier.size(24.dp),
)
Spacer(modifier = Modifier.width(10.dp))
Text(
text = text,
style = ClodyTheme.typography.body2SemiBold,
color = ClodyTheme.colors.gray01,
)
}
}
}

@Preview(showBackground = true)
@Composable
private fun GoogleButtonPreview() {
GoogleButton(
text = "Sign Up With Google",
onClick = { /*TODO*/ },
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fun BottomSheetTimePicker(
.padding(top = 16.dp, bottom = 30.dp),
) {
Text(
stringResource(id = R.string.time_picker_title),
stringResource(id = R.string.bottom_sheet_time_reminder_picker_title),
style = ClodyTheme.typography.head4,
color = ClodyTheme.colors.gray01,
modifier = Modifier.align(Alignment.Center),
Expand Down Expand Up @@ -143,7 +143,7 @@ fun BottomSheetTimePicker(
onRemindTimeSelected(selectedPeriod, selectedHour, selectedMinute)
onDismissRequest()
},
text = stringResource(R.string.time_reminder_complete_button),
text = stringResource(R.string.bottom_sheet_year_month_picker_btn_confirm),
enabled = true,
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.sopt.clody.presentation.ui.auth.guide
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -51,33 +50,28 @@ fun GuideRoute(
GuideScreen(onNextButtonClick = navigateToHome)
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun GuideScreen(
onNextButtonClick: () -> Unit,
) {
val pages = listOf(
BoardingPage(
title = stringResource(R.string.guide_page1_title),
subtitle = stringResource(R.string.guide_page1_subtitle),
description = stringResource(R.string.guide_page1_description),
imageRes = R.drawable.img_guide_first,
),
BoardingPage(
title = stringResource(R.string.guide_page2_title),
subtitle = stringResource(R.string.guide_page2_subtitle),
description = stringResource(R.string.guide_page2_description),
imageRes = R.drawable.img_guide_second,
),
BoardingPage(
title = stringResource(R.string.guide_page3_title),
subtitle = stringResource(R.string.guide_page3_subtitle),
description = stringResource(R.string.guide_page3_description),
imageRes = R.drawable.img_guide_third,
),
BoardingPage(
title = stringResource(R.string.guide_page4_title),
subtitle = stringResource(R.string.guide_page4_subtitle),
description = stringResource(R.string.guide_page4_description),
imageRes = R.drawable.img_guide_fourth,
),
Expand Down Expand Up @@ -106,9 +100,9 @@ fun GuideScreen(
}
},
text = if (pagerState.currentPage < pages.size - 1) {
stringResource(id = R.string.guide_next)
stringResource(id = R.string.guide_btn_next)
} else {
stringResource(id = R.string.guide_start)
stringResource(id = R.string.guide_btn_start)
},
enabled = true,
)
Expand Down Expand Up @@ -140,12 +134,6 @@ fun GuideScreen(
color = ClodyTheme.colors.gray01,
textAlign = TextAlign.Center,
)
Text(
text = pages[page].subtitle,
style = ClodyTheme.typography.head1,
color = ClodyTheme.colors.gray01,
textAlign = TextAlign.Center,
)
Spacer(modifier = Modifier.heightForScreenPercentage(0.02f))
Text(
text = pages[page].description,
Expand Down Expand Up @@ -194,7 +182,6 @@ fun GuideScreen(

data class BoardingPage(
val title: String,
val subtitle: String,
val description: String,
val imageRes: Int,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fun NickNamePage(
focusManager.clearFocus()
onCompleteClick()
},
text = stringResource(R.string.nickname_next),
text = stringResource(R.string.nickname_btn_next),
enabled = nickname.isNotEmpty() && isValidNickname,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.sopt.clody.presentation.utils.base.BasePreview
import com.sopt.clody.presentation.utils.base.ClodyPreview
import com.sopt.clody.presentation.utils.extension.heightForScreenPercentage
import com.sopt.clody.ui.theme.ClodyTheme
import java.util.Locale

@Composable
fun TermsOfServicePage(
Expand All @@ -45,6 +46,10 @@ fun TermsOfServicePage(
navigateToWebView: (String) -> Unit,
) {
val isAgreeButtonEnabled = serviceChecked && privacyChecked
val currentLang = Locale.getDefault().language

val termsOfService = if (currentLang == "ko") SettingOptionUrls.TERMS_OF_SERVICE_URL.krUrl else SettingOptionUrls.TERMS_OF_SERVICE_URL.enUrl
val privacyPolicy = if (currentLang == "ko") SettingOptionUrls.PRIVACY_POLICY_URL.krUrl else SettingOptionUrls.PRIVACY_POLICY_URL.enUrl

Scaffold(
topBar = {
Expand All @@ -68,7 +73,7 @@ fun TermsOfServicePage(
.padding(horizontal = 24.dp)
.padding(bottom = 28.dp),
onClick = onAgreeClick,
text = stringResource(R.string.terms_next),
text = stringResource(R.string.terms_btn_next),
enabled = isAgreeButtonEnabled,
)
},
Expand Down Expand Up @@ -105,21 +110,21 @@ fun TermsOfServicePage(
uncheckedImageRes = R.drawable.ic_terms_check_off_25,
)
}
Spacer(modifier = Modifier.height(16.dp))
Spacer(modifier = Modifier.height(18.dp))
HorizontalDivider(color = ClodyTheme.colors.gray07, thickness = 1.dp)
Spacer(modifier = Modifier.height(16.dp))
TermsCheckboxRow(
text = stringResource(R.string.terms_service_use),
checked = serviceChecked,
onCheckedChange = onToggleService,
onClickMore = { navigateToWebView(SettingOptionUrls.TERMS_OF_SERVICE_URL) },
onClickMore = { navigateToWebView(termsOfService) },
)
Spacer(modifier = Modifier.height(8.dp))
Spacer(modifier = Modifier.height(24.dp))
TermsCheckboxRow(
text = stringResource(R.string.terms_service_privacy),
checked = privacyChecked,
onCheckedChange = onTogglePrivacy,
onClickMore = { navigateToWebView(SettingOptionUrls.PRIVACY_POLICY_URL) },
onClickMore = { navigateToWebView(privacyPolicy) },
)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ fun TimeReminderScreen(
) {
ClodyButton(
onClick = onCompleteClick,
text = stringResource(id = R.string.time_reminder_complete_button),
text = stringResource(id = R.string.time_reminder_btn_complete),
enabled = true,
modifier = Modifier.fillMaxWidth(),
)
Spacer(modifier = Modifier.height(LocalConfiguration.current.screenHeightDp.dp * 0.015f))
Text(
text = stringResource(id = R.string.time_reminder_next_setting_button),
text = stringResource(id = R.string.time_reminder_btn_skip),
modifier = Modifier
.clickable(
onClick = onStartClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun FailureScreen(
colors = ButtonDefaults.buttonColors(ClodyTheme.colors.mainYellow),
) {
Text(
text = stringResource(R.string.failure_screen_refresh_btn),
text = stringResource(R.string.failure_screen_btn_refresh),
modifier = Modifier.padding(6.dp),
color = ClodyTheme.colors.gray01,
style = ClodyTheme.typography.body2SemiBold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun DiaryDeleteBottomSheetItem(
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = stringResource(R.string.bottom_sheet_delete_button),
text = stringResource(R.string.bottom_sheet_diary_delete),
style = ClodyTheme.typography.body4SemiBold,
color = ClodyTheme.colors.gray01,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun FailureDialog(
colors = ButtonDefaults.buttonColors(ClodyTheme.colors.mainYellow),
) {
Text(
text = stringResource(R.string.failure_dialog_confirm_btn),
text = stringResource(R.string.failure_dialog_btn_confirm),
color = ClodyTheme.colors.gray02,
style = ClodyTheme.typography.body3SemiBold,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fun YearMonthPicker(
.padding(top = 16.dp, bottom = 30.dp),
) {
Text(
text = stringResource(R.string.year_month_picker_title),
text = stringResource(R.string.bottom_sheet_year_month_picker_title),
style = ClodyTheme.typography.body2SemiBold,
color = ClodyTheme.colors.gray01,
modifier = Modifier.align(Alignment.Center),
Expand Down Expand Up @@ -133,7 +133,7 @@ fun YearMonthPicker(
onYearMonthSelected(year, month)
onDismissRequest()
},
text = stringResource(R.string.year_month_picker_confirm),
text = stringResource(R.string.bottom_sheet_year_month_picker_btn_confirm),
enabled = true,
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ fun DailyDiaryCard(
verticalAlignment = Alignment.Bottom,
) {
Text(
text = stringResource(R.string.diarylist_daily_diary_day, day),
text = stringResource(R.string.diary_list_daily_diary_day, day),
modifier = Modifier
.padding(end = 2.dp),
color = ClodyTheme.colors.gray01,
style = ClodyTheme.typography.body2SemiBold,
)
Text(
text = stringResource(R.string.diarylist_daily_diary_day_of_week, dayOfWeek),
text = stringResource(R.string.diary_list_daily_diary_day_of_week, dayOfWeek),
color = ClodyTheme.colors.gray04,
style = ClodyTheme.typography.body4Medium,
)
Expand Down Expand Up @@ -155,7 +155,7 @@ fun ReplyDiaryButton(
contentPadding = PaddingValues(0.dp),
) {
Text(
text = stringResource(R.string.diarylist_check_reply),
text = stringResource(R.string.diary_list_btn_reply),
modifier = Modifier
.padding(horizontal = 10.dp, vertical = 2.dp),
style = ClodyTheme.typography.detail1SemiBold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fun DiaryListTopAppBar(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = stringResource(R.string.diarylist_selected_year_month, selectedYear, selectedMonth),
text = stringResource(R.string.diary_list_selected_year_month, selectedYear, selectedMonth),
color = ClodyTheme.colors.gray01,
style = ClodyTheme.typography.head4,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ fun DiaryListScreen(

if (diaryDeleteDialogState) {
ClodyDialog(
titleMassage = stringResource(R.string.diary_delete_dialog_title),
descriptionMassage = stringResource(R.string.diary_delete_dialog_description),
confirmOption = stringResource(R.string.diary_delete_dialog_confirm_option),
dismissOption = stringResource(R.string.diary_delete_dialog_dismiss_option),
titleMassage = stringResource(R.string.dialog_diary_delete_title),
descriptionMassage = stringResource(R.string.dialog_diary_delete_description),
confirmOption = stringResource(R.string.dialog_diary_delete_confirm),
dismissOption = stringResource(R.string.dialog_diary_delete_dismiss),
confirmAction = {
onClickDiaryDelete(selectedDiaryDate.year, selectedDiaryDate.month, selectedDiaryDate.day)
dismissDiaryDeleteDialog()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fun DailyDiaryListItem(
)
Text(
text = stringResource(
id = R.string.daily_diary_day_of_week_format,
id = R.string.home_daily_diary_day_of_week,
dayOfWeek.toKoreanShortLabel(),
),
style = ClodyTheme.typography.body2Medium,
Comment on lines 56 to 60
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

toKoreanShortLabel() is now mismatched with EN default

dayOfWeek.toKoreanShortLabel() returns a Korean char (월/화/…).
With English resources active, the format string home_daily_diary_day_of_week will produce something like "Mon (월)" rather than "Mon".

Options:

  1. Add an English helper (toEnglishShortLabel()) and use the correct one based on Locale.
  2. Pass the raw DayOfWeek and let the string resource handle localisation via %1$tA formatting.

Either way, avoid hard-coding Korean when the app runs in EN.

🤖 Prompt for AI Agents
In
app/src/main/java/com/sopt/clody/presentation/ui/home/calendar/component/DailyDiaryListItem.kt
around lines 56 to 60, the use of dayOfWeek.toKoreanShortLabel() hardcodes
Korean characters which causes incorrect display when the app locale is English.
To fix this, either implement a toEnglishShortLabel() method and select the
label based on the current Locale, or pass the raw DayOfWeek object to the
string resource and use locale-aware formatting like %1$tA to let the resource
handle localization properly. This will ensure the day of week displays
correctly in both Korean and English locales.

Expand All @@ -80,7 +80,7 @@ fun DailyDiaryListItem(
.padding(vertical = 44.dp),
) {
Text(
text = stringResource(R.string.daily_diary_draft_message),
text = stringResource(R.string.home_daily_diary_draft_message),
style = ClodyTheme.typography.body3Regular,
color = ClodyTheme.colors.gray05,
textAlign = TextAlign.Center,
Expand All @@ -96,7 +96,7 @@ fun DailyDiaryListItem(
.padding(vertical = 44.dp),
) {
Text(
text = stringResource(R.string.daily_diary_empty_message),
text = stringResource(R.string.home_daily_diary_empty_message),
style = ClodyTheme.typography.body3Regular,
color = ClodyTheme.colors.gray05,
textAlign = TextAlign.Center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.sopt.clody.ui.theme.ClodyTheme

@Composable
fun CloverCount(cloverCount: Int) {
val text = stringResource(R.string.home_clover_count_format, cloverCount)
val text = stringResource(R.string.home_total_clover, cloverCount)

Box(
modifier = Modifier
Expand Down
Loading