refactor: abstract colourScheme into common code
This commit is contained in:
parent
121b2bb555
commit
fa81dd8c0f
3 changed files with 34 additions and 35 deletions
|
|
@ -1,23 +1,15 @@
|
|||
package moe.lava.banksia.native
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
actual fun BanksiaTheme(
|
||||
actual fun BanksiaTheme.colors(
|
||||
darkTheme: Boolean,
|
||||
dynamicColor: Boolean,
|
||||
content: @Composable (() -> Unit)
|
||||
) {
|
||||
val colorScheme = when {
|
||||
darkTheme -> darkColorScheme()
|
||||
else -> lightColorScheme()
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
content = content
|
||||
)
|
||||
dynamicColor: Boolean
|
||||
): ColorScheme = when {
|
||||
darkTheme -> darkColorScheme()
|
||||
else -> lightColorScheme()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue