-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgameUI.kt
49 lines (34 loc) · 817 Bytes
/
gameUI.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@file:Suppress("UnsafeCastFromDynamic")
package App
import kotlinext.js.js
import kotlinx.html.js.onClickFunction
import kotlinx.html.style
import kotlinx.html.title
import org.w3c.dom.Window
import react.RBuilder
import react.RProps
import react.dom.button
import react.dom.div
import react.dom.h1
import kotlin.browser.window
fun RBuilder.gameUI(
state: AppState,
props: RProps,
eh: Eh
) {
div {
h1(classes = "title") {
+"Hello World from React Kotlin - Blackjack"
}
buttonBar(eh)
h1(classes = "subtitle") { +"Action: ${state.g}" }
div {
attrs.title = "Foo"
attrs.style = kotlinext.js.js {
display = "flex"
}
handUI()
handUI()
}
}
}