-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c655f91
commit a2f95ab
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
shared/src/commonMain/kotlin/com/mocoding/pokedex/ui/main/components/MainModelDrawerSheet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package com.mocoding.pokedex.ui.main.components | ||
|
10 changes: 10 additions & 0 deletions
10
shared/src/desktopMain/kotlin/com.mocoding.pokedex/PokedexDispatchers.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.mocoding.pokedex | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
actual val pokedexDispatchers: PokedexDispatchers = object: PokedexDispatchers { | ||
override val main: CoroutineDispatcher = Dispatchers.Main | ||
override val io: CoroutineDispatcher = Dispatchers.Default | ||
override val unconfined: CoroutineDispatcher = Dispatchers.Unconfined | ||
} |
14 changes: 14 additions & 0 deletions
14
shared/src/desktopMain/kotlin/com.mocoding.pokedex/core/database/DesktopSqlDriverFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.mocoding.pokedex.core.database | ||
|
||
import app.cash.sqldelight.db.SqlDriver | ||
import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver | ||
import org.koin.core.scope.Scope | ||
import java.io.File | ||
|
||
|
||
actual fun Scope.sqlDriverFactory(): SqlDriver { | ||
val databasePath = File(System.getProperty("java.io.tmpdir"), "${DatabaseConstants.name}.db") | ||
val driver = JdbcSqliteDriver(url = "jdbc:sqlite:${databasePath.path}") | ||
PokemonDatabase.Schema.create(driver) | ||
return driver | ||
} |
8 changes: 8 additions & 0 deletions
8
shared/src/desktopMain/kotlin/com.mocoding.pokedex/core/network/HttpClientFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.mocoding.pokedex.core.network | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.engine.darwin.Darwin | ||
|
||
actual fun createPlatformHttpClient(): HttpClient { | ||
return HttpClient(Darwin) | ||
} |
22 changes: 22 additions & 0 deletions
22
shared/src/desktopMain/kotlin/com.mocoding.pokedex/ui/ContentView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.mocoding.pokedex.ui | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.mocoding.pokedex.ui.root.RootComponent | ||
import com.mocoding.pokedex.ui.root.RootContent | ||
import com.mocoding.pokedex.ui.theme.PokedexTheme | ||
|
||
@Composable | ||
fun ContentView(component: RootComponent) { | ||
PokedexTheme { | ||
Surface( | ||
modifier = Modifier.fillMaxSize(), | ||
color = MaterialTheme.colorScheme.background | ||
) { | ||
RootContent(component) | ||
} | ||
} | ||
} |