From 6b44e60fc4efc23a30f16492bf9dc17aa30b66c5 Mon Sep 17 00:00:00 2001 From: nea Date: Mon, 6 Dec 2021 22:58:45 +0100 Subject: Awful react version --- src/main/kotlin/moe/nea89/website/App.kt | 26 ++++++++++++++++++++++++++ src/main/kotlin/moe/nea89/website/index.kt | 10 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/main/kotlin/moe/nea89/website/App.kt create mode 100644 src/main/kotlin/moe/nea89/website/index.kt (limited to 'src/main/kotlin/moe/nea89/website') diff --git a/src/main/kotlin/moe/nea89/website/App.kt b/src/main/kotlin/moe/nea89/website/App.kt new file mode 100644 index 0000000..aa96825 --- /dev/null +++ b/src/main/kotlin/moe/nea89/website/App.kt @@ -0,0 +1,26 @@ +package moe.nea89.website + +import com.bnorm.react.RFunction +import react.RBuilder +import react.dom.li +import react.dom.nav +import react.dom.ul + + +@RFunction +fun RBuilder.App() { + Navigation() +} + +@RFunction +fun RBuilder.Navigation() { + nav { + ul { + li { +"Hehe" } + li { +"Hihi" } + li { +"Hoho" } + li { +"Haha" } + li { +"Huhu" } + } + } +} diff --git a/src/main/kotlin/moe/nea89/website/index.kt b/src/main/kotlin/moe/nea89/website/index.kt new file mode 100644 index 0000000..f10728a --- /dev/null +++ b/src/main/kotlin/moe/nea89/website/index.kt @@ -0,0 +1,10 @@ +package moe.nea89.website + +import kotlinx.browser.document +import react.dom.render +import kotlinext.js.require + +fun main() { + require("@fontsource/comic-mono/index.css") + render(document.getElementById("root") ?: throw RuntimeException("Could not find root element")) { App() } +} \ No newline at end of file -- cgit