parent
326581e784
commit
c74a4bcc28
2 changed files with 32 additions and 0 deletions
|
|
@ -14,12 +14,14 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.util.fastForEach
|
||||
import io.woong.compose.grid.SimpleGridCells
|
||||
import io.woong.compose.grid.VerticalGrid
|
||||
import kotlinx.collections.immutable.ImmutableMap
|
||||
import kotlinx.collections.immutable.persistentMapOf
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import mihon.core.designsystem.utils.isExpandedWidthWindow
|
||||
import mihon.core.designsystem.utils.isMediumWidthWindow
|
||||
|
|
@ -110,3 +112,20 @@ private fun CalendarGrid(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// KMK -->
|
||||
@Preview
|
||||
@Composable
|
||||
fun CalendarDayPreview() {
|
||||
Calendar(
|
||||
selectedYearMonth = YearMonth.now(),
|
||||
events = persistentMapOf(
|
||||
LocalDate.now() to 3,
|
||||
LocalDate.now().plusDays(1) to 1,
|
||||
LocalDate.now().minusDays(15) to 1,
|
||||
),
|
||||
setSelectedYearMonth = {},
|
||||
onClickDay = {},
|
||||
)
|
||||
}
|
||||
// KMK <--
|
||||
|
|
|
|||
|
|
@ -64,6 +64,19 @@ fun CalendarDay(
|
|||
},
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
)
|
||||
// KMK -->
|
||||
if (events > 0) {
|
||||
Text(
|
||||
text = events.toString(),
|
||||
textAlign = TextAlign.Right,
|
||||
fontSize = 8.sp,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
fontWeight = FontWeight.Normal,
|
||||
modifier = Modifier
|
||||
.offset(x = 12.dp, y = (-10).dp),
|
||||
)
|
||||
}
|
||||
// KMK <--
|
||||
Row(Modifier.offset(y = 12.dp)) {
|
||||
val size = events.coerceAtMost(MAX_EVENTS)
|
||||
for (index in 0 until size) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue