Skip to content

Commit

Permalink
feat: 그룹 생성 플로우 종료 날짜 캡션 추가 #20
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhz committed Jul 20, 2024
1 parent e287e26 commit db2dcbb
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.easyhz.noffice.core.common.util

import java.time.LocalDate
import java.time.format.DateTimeFormatter

object DateFormat {
fun fullText(date: LocalDate): String =
DateTimeFormatter.ofPattern("yyyy년 MM월 d일").format(date)
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,28 @@ val CardExceptionSubTitle = TextStyle(
platformStyle = PlatformTextStyle(
includeFontPadding = false,
)
)
)

val CalendarCaption1 = TextStyle(
fontFamily = Pretendard,
fontWeight = FontWeight.SemiBold,
color = Green800,
fontSize = 16.sp,
letterSpacing = LetterSpacing,
textAlign = TextAlign.Justify,
platformStyle = PlatformTextStyle(
includeFontPadding = false,
)
)

val CalendarCaption2 = TextStyle(
fontFamily = Pretendard,
fontWeight = FontWeight.SemiBold,
color = Grey400,
fontSize = 16.sp,
letterSpacing = LetterSpacing,
textAlign = TextAlign.Justify,
platformStyle = PlatformTextStyle(
includeFontPadding = false,
)
)
1 change: 1 addition & 0 deletions core/design-system/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@
<string name="organization_creation_category_title">그룹의 카테고리를 모두 선택해 주세요</string>
<string name="organization_creation_image_title">대표 이미지를 설정해 주세요</string>
<string name="organization_creation_end_date_title">활동 종료 날짜가 언제인가요?</string>
<string name="organization_creation_end_date_caption">에 활동을 종료할 예정이에요!</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ package com.easyhz.noffice.feature.organization.component.creation
import androidx.compose.foundation.layout.Column
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.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.easyhz.noffice.core.common.util.DateFormat
import com.easyhz.noffice.core.design_system.R
import com.easyhz.noffice.core.design_system.component.button.MediumButton
import com.easyhz.noffice.core.design_system.component.calendar.MonthCalendarView
import com.easyhz.noffice.core.design_system.extension.screenHorizonPadding
import com.easyhz.noffice.core.design_system.theme.CalendarCaption1
import com.easyhz.noffice.core.design_system.theme.CalendarCaption2
import com.easyhz.noffice.core.design_system.util.calendar.getCalendarPadding
import com.easyhz.noffice.feature.organization.contract.creation.CreationIntent
import com.easyhz.noffice.feature.organization.screen.creation.OrganizationCreationViewModel
Expand All @@ -27,6 +35,15 @@ internal fun EndDateView(
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
val screenWidth = LocalConfiguration.current.screenWidthDp
val calendarPadding = getCalendarPadding(16, screenWidth).dp
val caption = stringResource(id = R.string.organization_creation_end_date_caption)
val annotatedString = buildAnnotatedString {
withStyle(style = CalendarCaption1.toSpanStyle()) {
append(DateFormat.fullText(uiState.endDate))
}
withStyle(style = CalendarCaption2.toSpanStyle()) {
append(caption)
}
}

Column(
modifier = modifier
Expand All @@ -44,11 +61,19 @@ internal fun EndDateView(
) {
viewModel.postIntent(CreationIntent.ChangeEndDate(it))
}
Text(
modifier = Modifier
.screenHorizonPadding()
.fillMaxWidth()
.align(Alignment.CenterHorizontally),
text = annotatedString,
textAlign = TextAlign.Center
)
MediumButton(
modifier = Modifier
.screenHorizonPadding()
.fillMaxWidth()
.padding(bottom = 16.dp),
.padding(vertical = 16.dp),
text = stringResource(id = R.string.sign_up_button),
enabled = uiState.enabledStepButton[uiState.step.currentStep] ?: false
) {
Expand Down

0 comments on commit db2dcbb

Please sign in to comment.