summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2019-10-23 02:13:33 +0200
committerjoffrey-bion <joffrey.bion@gmail.com>2019-10-23 02:13:33 +0200
commitb8a047a2883bd604c2225b6e08ad81e5f98784e4 (patch)
tree62463ee9be9118f3568d8f828788063dd791f02b /sw-ui-kt/src
parentSagas rework (diff)
downloadseven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.tar.gz
seven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.tar.bz2
seven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.zip
WIP name form fix
Diffstat (limited to 'sw-ui-kt/src')
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt
index 30a0883a..11f52529 100644
--- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt
@@ -16,10 +16,14 @@ private interface ChooseNameFormProps: RProps {
var chooseUsername: (String) -> Unit
}
-private data class ChooseNameFormState(val username: String): RState
+private data class ChooseNameFormState(var username: String = ""): RState
private class ChooseNameForm(props: ChooseNameFormProps): RComponent<ChooseNameFormProps, ChooseNameFormState>(props) {
+ override fun ChooseNameFormState.init(props: ChooseNameFormProps) {
+ username = ""
+ }
+
override fun RBuilder.render() {
form {
attrs.onSubmitFunction = { props.chooseUsername(state.username) }
bgstack15