summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src/main
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2019-05-23 18:06:48 +0200
committerjbion <joffrey.bion@amadeus.com>2019-07-28 18:15:34 +0200
commit362c1060bd99186a1d372fa89a6b7a470f387d34 (patch)
tree6ccd72246199cc700d279be26363c9c712a0e05e /sw-ui-kt/src/main
parentAdd SW static files to src/main/web (Kotlin build) (diff)
downloadseven-wonders-362c1060bd99186a1d372fa89a6b7a470f387d34.tar.gz
seven-wonders-362c1060bd99186a1d372fa89a6b7a470f387d34.tar.bz2
seven-wonders-362c1060bd99186a1d372fa89a6b7a470f387d34.zip
Attempt at Kotlin frontend plugin
Diffstat (limited to 'sw-ui-kt/src/main')
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt23
-rw-r--r--sw-ui-kt/src/main/web/index.html3
2 files changed, 25 insertions, 1 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
new file mode 100644
index 00000000..5d9d9be6
--- /dev/null
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
@@ -0,0 +1,23 @@
+package org.luxons.sevenwonders.ui
+
+import react.RBuilder
+import react.dom.*
+import kotlin.browser.document
+import kotlin.browser.window
+
+fun main() {
+ window.onload = {
+ render(document.getElementById("root")!!) {
+ app()
+ }
+ }
+}
+
+fun RBuilder.app() = div {
+ h1 {
+ +"Seven Wonders"
+ }
+ p {
+ +"Great app!"
+ }
+}
diff --git a/sw-ui-kt/src/main/web/index.html b/sw-ui-kt/src/main/web/index.html
index 32b449cb..74cac462 100644
--- a/sw-ui-kt/src/main/web/index.html
+++ b/sw-ui-kt/src/main/web/index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
+ <link rel="shortcut icon" href="${publicPath}favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
@@ -27,5 +27,6 @@
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
+ <script src="${bundle}"></script>
</body>
</html>
bgstack15