Skip to content

Commit

Permalink
✨ :: GYMITheme 시스템 색상에 맞게 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyeonseo4799 committed Aug 24, 2023
1 parent 34007f1 commit 2f75791
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mpersand.gymi_components.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -59,7 +60,7 @@ private fun GYMIThemeLocalProvider(
}

private val Theme.colors: GYMIColor
get() = when(this) {
get() = when (this) {
Theme.DARK -> GYMIDarkColors
Theme.LIGHT -> GYMILightColors
}
Expand All @@ -86,6 +87,8 @@ fun GYMITheme(
typography: GYMITypography = GYMITheme.typography,
content: @Composable () -> Unit
) {
GYMITheme.gymiTheme = if (isSystemInDarkTheme()) Theme.DARK else Theme.LIGHT

GYMIThemeLocalProvider(
colors = gymiTheme.colors,
typography = typography,
Expand Down

0 comments on commit 2f75791

Please sign in to comment.