|
1 | | - package com.threegap.bitnagil.designsystem |
| 1 | +package com.threegap.bitnagil.designsystem |
2 | 2 |
|
3 | | - import androidx.compose.foundation.isSystemInDarkTheme |
4 | | - import androidx.compose.runtime.Composable |
5 | | - import androidx.compose.runtime.CompositionLocalProvider |
6 | | - import androidx.compose.runtime.ReadOnlyComposable |
7 | | - import androidx.compose.runtime.staticCompositionLocalOf |
8 | | - import com.threegap.bitnagil.designsystem.color.BitnagilColors |
9 | | - import com.threegap.bitnagil.designsystem.color.LocalBitnagilColors |
10 | | - import com.threegap.bitnagil.designsystem.color.bitnagilColorsDark |
11 | | - import com.threegap.bitnagil.designsystem.color.bitnagilColorsLight |
12 | | - import com.threegap.bitnagil.designsystem.typography.BitnagilTypography |
13 | | - import com.threegap.bitnagil.designsystem.typography.LocalBitnagilTypography |
| 3 | +import androidx.compose.foundation.isSystemInDarkTheme |
| 4 | +import androidx.compose.runtime.Composable |
| 5 | +import androidx.compose.runtime.CompositionLocalProvider |
| 6 | +import androidx.compose.runtime.ReadOnlyComposable |
| 7 | +import androidx.compose.runtime.staticCompositionLocalOf |
| 8 | +import com.threegap.bitnagil.designsystem.color.BitnagilColors |
| 9 | +import com.threegap.bitnagil.designsystem.color.LocalBitnagilColors |
| 10 | +import com.threegap.bitnagil.designsystem.color.bitnagilColorsDark |
| 11 | +import com.threegap.bitnagil.designsystem.color.bitnagilColorsLight |
| 12 | +import com.threegap.bitnagil.designsystem.typography.BitnagilTypography |
| 13 | +import com.threegap.bitnagil.designsystem.typography.LocalBitnagilTypography |
14 | 14 |
|
15 | | - object BitnagilTheme { |
16 | | - val colors: BitnagilColors |
| 15 | +object BitnagilTheme { |
| 16 | + val colors: BitnagilColors |
17 | 17 | @Composable |
18 | 18 | @ReadOnlyComposable |
19 | 19 | get() = LocalBitnagilColors.current |
20 | 20 |
|
21 | | - val typography: BitnagilTypography |
| 21 | + val typography: BitnagilTypography |
22 | 22 | @Composable |
23 | 23 | @ReadOnlyComposable |
24 | 24 | get() = LocalBitnagilTypography.current |
25 | | - } |
| 25 | +} |
26 | 26 |
|
27 | | - @Composable |
28 | | - fun BitnagilTheme( |
| 27 | +@Composable |
| 28 | +fun BitnagilTheme( |
29 | 29 | darkTheme: Boolean = isSystemInDarkTheme(), |
30 | 30 | content: @Composable () -> Unit, |
31 | | - ) { |
| 31 | +) { |
32 | 32 | val colors = when { |
33 | 33 | darkTheme -> staticCompositionLocalOf { bitnagilColorsLight() } |
34 | 34 | else -> staticCompositionLocalOf { bitnagilColorsDark() } |
|
37 | 37 | CompositionLocalProvider( |
38 | 38 | LocalBitnagilTypography provides LocalBitnagilTypography.current, |
39 | 39 | LocalBitnagilColors provides colors.current, |
40 | | - content = content |
| 40 | + content = content, |
41 | 41 | ) |
42 | | - } |
| 42 | +} |
0 commit comments