Browse Source

Fix web-landing sample

pull/1283/head
Nikolay Igotti 3 years ago
parent
commit
2180e42a2f
  1. 5
      examples/web-landing/build.gradle.kts
  2. 2
      examples/web-landing/src/jsMain/kotlin/com/sample/Main.kt
  3. 4
      examples/web-landing/src/jsMain/kotlin/com/sample/content/CodeSamplesSwitcher.kt

5
examples/web-landing/build.gradle.kts

@ -1,8 +1,8 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
plugins {
kotlin("multiplatform") version "1.5.21"
id("org.jetbrains.compose") version "1.0.0-alpha1"
kotlin("multiplatform") version "1.5.31"
id("org.jetbrains.compose") version "0.0.0-master-build413"
}
repositories {
@ -32,5 +32,6 @@ kotlin {
afterEvaluate {
rootProject.extensions.configure<NodeJsRootExtension> {
versions.webpackDevServer.version = "4.0.0"
versions.webpackCli.version = "4.9.0"
}
}

2
examples/web-landing/src/jsMain/kotlin/com/sample/Main.kt

@ -5,8 +5,6 @@ import org.jetbrains.compose.web.renderComposable
import com.sample.components.*
import com.sample.content.*
import com.sample.style.AppStylesheet
import org.w3c.dom.HTMLElement
fun main() {
renderComposable(rootElementId = "root") {

4
examples/web-landing/src/jsMain/kotlin/com/sample/content/CodeSamplesSwitcher.kt

@ -2,7 +2,6 @@ package com.sample.content
import androidx.compose.runtime.Composable
import org.jetbrains.compose.web.attributes.InputType
import org.jetbrains.compose.web.attributes.checked
import org.jetbrains.compose.web.attributes.name
import org.jetbrains.compose.web.css.*
import org.jetbrains.compose.web.css.selectors.CSSSelector
@ -13,7 +12,6 @@ import org.jetbrains.compose.web.dom.Input
import org.jetbrains.compose.web.dom.Label
import org.jetbrains.compose.web.dom.Text
import com.sample.style.AppStylesheet
import org.jetbrains.compose.web.attributes.value
private object SwitcherVariables {
val labelWidth by variable<CSSpxValue>()
@ -81,7 +79,7 @@ fun CodeSampleSwitcher(count: Int, current: Int, onSelect: (Int) -> Unit) {
name("code-snippet")
value("snippet$ix")
id("snippet$ix")
if (current == ix) checked()
if (current == ix) checked(true)
onChange { onSelect(ix) }
})
Label(forId = "snippet$ix") { Text("${ix + 1}") }

Loading…
Cancel
Save