Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Nov 18, 2024
1 parent 734ebd8 commit b751626
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.michaelbel.movies.main

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
Expand All @@ -10,9 +9,7 @@ import androidx.navigation.compose.rememberNavController
fun MainContent(
navHostController: NavHostController = rememberNavController()
) {
MaterialTheme {
Text(
"Content"
)
}
Text(
"Content"
)
}
19 changes: 16 additions & 3 deletions webApp/src/jsMain/kotlin/org/michaelbel/movies/Main.js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

package org.michaelbel.movies

import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import org.jetbrains.skiko.wasm.onWasmReady
import org.koin.compose.KoinApplication
import org.koin.compose.koinInject
import org.michaelbel.movies.common.ThemeData
import org.michaelbel.movies.di.appKoinModule
import org.michaelbel.movies.main.MainContent
import org.michaelbel.movies.main.MainViewModel
import org.michaelbel.movies.ui.ktx.collectAsStateCommon
import org.michaelbel.movies.ui.theme.MoviesTheme

fun main() {
onWasmReady {
Expand All @@ -25,9 +27,20 @@ fun main() {
}
) {
val viewModel = koinInject<MainViewModel>()
val themeData by viewModel.themeData.collectAsState()
val themeData by viewModel.themeData.collectAsStateCommon()

MainContent()
MoviesTheme(
themeData = ThemeData(
appTheme = themeData.appTheme,
dynamicColors = false,
paletteKey = themeData.paletteKey,
seedColor = themeData.seedColor
),
theme = themeData.appTheme,
enableEdgeToEdge = { _,_ -> }
) {
MainContent()
}
}
}
}
Expand Down

0 comments on commit b751626

Please sign in to comment.