diff --git a/composeApp/src/commonMain/kotlin/in/procyk/shin/component/ShinComponent.kt b/composeApp/src/commonMain/kotlin/in/procyk/shin/component/ShinComponent.kt index 45a10f8..e1bfe51 100644 --- a/composeApp/src/commonMain/kotlin/in/procyk/shin/component/ShinComponent.kt +++ b/composeApp/src/commonMain/kotlin/in/procyk/shin/component/ShinComponent.kt @@ -35,7 +35,7 @@ interface ShinComponent : Component { fun onExtraElementsVisibleChange() - fun onExpirationDateTimeChange(expirationDate: LocalDate?): Boolean + fun onExpirationDateChange(expirationDate: LocalDate?): Boolean fun onUrlChange(url: String) @@ -72,7 +72,7 @@ class ShinComponentImpl( _extraElementsVisible.update { !it } } - override fun onExpirationDateTimeChange(expirationDate: LocalDate?): Boolean = when { + override fun onExpirationDateChange(expirationDate: LocalDate?): Boolean = when { expirationDate == null -> { val updatedDate = tomorrow _expirationDate.update { updatedDate } diff --git a/composeApp/src/commonMain/kotlin/in/procyk/shin/ui/ShortenRequest.kt b/composeApp/src/commonMain/kotlin/in/procyk/shin/ui/ShortenRequest.kt index 9bc1c65..617f123 100644 --- a/composeApp/src/commonMain/kotlin/in/procyk/shin/ui/ShortenRequest.kt +++ b/composeApp/src/commonMain/kotlin/in/procyk/shin/ui/ShortenRequest.kt @@ -95,14 +95,19 @@ private fun ShortenRequestExtraElements( enter = fadeIn() + expandVertically(expandFrom = Alignment.Top), exit = shrinkVertically(shrinkTowards = Alignment.Top) + fadeOut() ) { - Box( - modifier = Modifier.sizeIn(maxWidth = 280.dp), + Column( + modifier = Modifier + .padding(top = 12.dp) + .sizeIn(maxWidth = 280.dp), + verticalArrangement = Arrangement.spacedBy(4.dp, alignment = Alignment.CenterVertically), + horizontalAlignment = Alignment.CenterHorizontally, ) { + Text("Expiration Date", style = MaterialTheme.typography.headlineSmall) val calendarState = rememberSelectableCalendarState( initialMonth = YearMonth.now(), minMonth = YearMonth.now(), initialSelection = listOf(expirationDate), - confirmSelectionChange = { component.onExpirationDateTimeChange(it.singleOrNull()) }, + confirmSelectionChange = { component.onExpirationDateChange(it.singleOrNull()) }, ) SelectableCalendar(calendarState = calendarState) }