Skip to content

Commit

Permalink
move language selector into navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
jillesvangurp committed Jun 15, 2024
1 parent b7b80a1 commit ff0a987
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/jsMain/kotlin/routing/routing.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package routing

import com.tryformation.localization.Translatable
import components.flexRow
import dev.fritz2.core.RenderContext
import dev.fritz2.routing.MapRouter
import dev.fritz2.routing.routerOf
Expand All @@ -9,6 +10,7 @@ import files.fileManager
import fluenteditor.fluentBrowser
import kotlinx.coroutines.flow.map
import localization.TL
import localization.languageSelector
import localization.translate
import org.koin.dsl.module
import settings.settingsScreen
Expand Down Expand Up @@ -48,11 +50,11 @@ fun RenderContext.mainScreen() {
}
} ?: Page.default) to pp
}.render { (page, params) ->
div("flex flex-row w-full gap-2 bg-white place-items-center") {
div("flex flex-row w-full gap-2 bg-white place-items-center justify-between") {
h1("text-blueBright-500 font-bold my-0 pl-5") {
translate(TL.Common.AppName)
}
div("flex flex-row gap-5 bg-white py-2 border-b border-gray-300") {
div("flex flex-row gap-2 bg-white py-2 border-b border-gray-300") {
Page.entries.forEach { p ->
if (page == p) {
a("px-4 py-2 text-gray-600 hover:text-gray-800 border-b-2 border-blueBright-500 text-blueBright-500") {
Expand All @@ -69,6 +71,9 @@ fun RenderContext.mainScreen() {
}
}
}
flexRow {
languageSelector()
}
}

when (page) {
Expand Down
3 changes: 0 additions & 3 deletions src/jsMain/kotlin/settings/settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import components.selectComponent
import components.twInputField
import dev.fritz2.core.RenderContext
import dev.fritz2.core.disabled
import dev.fritz2.core.href
import dev.fritz2.core.selected
import dev.fritz2.core.storeOf
import dev.fritz2.core.value
import dev.fritz2.headless.components.radioGroup
import icons.SvgIconSource
import kotlinx.coroutines.flow.map
import kotlinx.serialization.Serializable
Expand Down Expand Up @@ -55,7 +53,6 @@ fun RenderContext.settingsScreen() {

div("grow m-5 bg-white flex flex-col gap-2 p-5") {
fadeInFadeoutTransition()
languageSelector()

openAiKeyEditor()
modelPicker()
Expand Down

0 comments on commit ff0a987

Please sign in to comment.