Skip to content

Commit

Permalink
[REFACTOR/#35] remember를 활용하여 AlarmDayButton 색상 상태 관리
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Jan 14, 2025
1 parent ae8c804 commit b06dfda
Showing 1 changed file with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ internal fun AlarmDayButton(
isPressed: Boolean,
onClick: () -> Unit,
) {
val containerColor = if (isPressed) {
OrbitTheme.colors.main.copy(alpha = 0.1f)
} else {
OrbitTheme.colors.gray_700
}

val contentColor = if (isPressed) {
OrbitTheme.colors.main
} else {
OrbitTheme.colors.gray_300
}

val borderColor = if (isPressed) {
OrbitTheme.colors.main
val (containerColor, contentColor, borderColor) = if (isPressed) {
Triple(
OrbitTheme.colors.main.copy(alpha = 0.1f),
OrbitTheme.colors.main,
Color.Transparent,
)
} else {
Color.Transparent
Triple(
OrbitTheme.colors.gray_700,
OrbitTheme.colors.gray_300,
Color.Transparent,
)
}

Box(
Expand Down

0 comments on commit b06dfda

Please sign in to comment.