Skip to content

Commit f2eba03

Browse files
committed
wip
1 parent 64498f5 commit f2eba03

File tree

8 files changed

+32
-34
lines changed

8 files changed

+32
-34
lines changed

ghcjs/delivery-calculator/flake.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@
8888
-O2 \
8989
--source-map \
9090
-o $out/static/all.css \
91-
./static/material-components-web.min.css \
92-
./static/material-icons.css \
9391
./static/app.css
9492
9593
${pkgs.nodejs}/bin/npm i --prefer-offline

ghcjs/delivery-calculator/package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ghcjs/delivery-calculator/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@capacitor/share": "^6.0.1",
1818
"@capacitor/toast": "^6.0.2",
1919
"@ionic/pwa-elements": "^3.3.0",
20+
"@lowlighter/matcha": "^3.0.0",
2021
"capacitor-webview-print": "^6.0.1"
2122
},
2223
"devDependencies": {

ghcjs/delivery-calculator/src/Main.hs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ getWebOpts = do
7272
#if !defined(__GHCJS__) && !defined(ghcjs_HOST_OS) && !defined(wasi_HOST_OS)
7373
runApp :: JSM () -> IO ()
7474
runApp app = do
75-
cap <- BL.readFile "../miso-functora/js/main.min.js"
76-
js0 <- BL.readFile "static/app.js"
77-
js1 <- BL.readFile "../miso-components/material-components-web.min.js"
78-
js2 <- BL.readFile "../miso-components/material-components-web-elm.min.js"
75+
js0 <- BL.readFile "../miso-functora/js/main.min.js"
76+
js1 <- BL.readFile "static/app.js"
7977
Warp.runSettings
8078
( Warp.setPort
8179
8080
@@ -84,12 +82,14 @@ runApp app = do
8482
=<< JS.jsaddleOr
8583
Ws.defaultConnectionOptions
8684
(app >> syncPoint)
87-
(router $ cap <> js0 <> js1 <> js2 )
85+
(router $ js0 <> js1)
8886
where
8987
router js req =
9088
case Wai.pathInfo req of
9189
("static" : _) ->
9290
staticApp (defaultWebAppSettings ".") req
91+
("node_modules" : _) ->
92+
staticApp (defaultWebAppSettings ".") req
9393
("favicon.ico" : _) ->
9494
staticApp (defaultWebAppSettings "static") req
9595
("site.webmanifest" : _) ->
@@ -234,22 +234,26 @@ updateModel (PushUpdate updater) st = do
234234
]
235235

236236
viewModel :: Model -> View Action
237-
#if !defined(__GHCJS__) && !defined(ghcjs_HOST_OS) && !defined(wasi_HOST_OS)
237+
#if defined(__GHCJS__) || defined(ghcjs_HOST_OS) || defined(wasi_HOST_OS)
238+
viewModel st =
239+
mainWidget st
240+
#else
238241
viewModel st =
239242
div_
240243
mempty
241-
[ link_ [rel_ "stylesheet", href_ "static/material-components-web.min.css"],
242-
link_ [rel_ "stylesheet", href_ "static/material-icons.css"],
243-
link_ [rel_ "stylesheet", href_ "static/app.css"],
244+
[ link_
245+
[ rel_ "stylesheet",
246+
href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
247+
],
248+
link_
249+
[ rel_
250+
"stylesheet",
251+
href_ "static/app.css"
252+
],
244253
mainWidget st
245254
]
246255
#endif
247256

248-
#if defined(__GHCJS__) || defined(ghcjs_HOST_OS) || defined(wasi_HOST_OS)
249-
viewModel st =
250-
mainWidget st
251-
#endif
252-
253257
extendedEvents :: Map Unicode Bool
254258
extendedEvents =
255259
defaultEvents

ghcjs/delivery-calculator/static/app.css

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
html,
2-
body {
1+
html {
32
margin: 0;
43
padding: 0;
54
width: 100vw;
@@ -20,19 +19,10 @@ textarea {
2019
min-height: 72px;
2120
}
2221

23-
.mdc-select__anchor {
24-
width: 100%;
25-
min-width: 100%;
26-
}
27-
2822
.container {
2923
max-width: 550px;
3024
}
3125

32-
.mdc-button {
33-
height: 56px;
34-
}
35-
3626
.app-success > span {
3727
color: white;
3828
background-color: #018786 !important;
@@ -56,9 +46,6 @@ textarea {
5646
.no-print {
5747
display: none !important;
5848
}
59-
.mdc-top-app-bar--short-fixed-adjust {
60-
padding-top: 0 !important;
61-
}
6249
@page {
6350
size: A4;
6451
margin: 15mm;

ghcjs/delivery-calculator/static/wasm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="description" content="Delivery Calculator" />
6-
<script language="javascript" src="miso_widgets.js" defer="defer"></script>
6+
<script language="javascript" src="miso_functora.js" defer="defer"></script>
77
<script language="javascript" src="wasm.js" defer="defer"></script>
88
<link rel="preconnect" href="https://cdn.jsdelivr.net" />
99
<link

ghcjs/delivery-calculator/static/wasm.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import "../../miso-components/material-components-web-elm.min.js";
2-
import "../../miso-components/material-components-web.min.js";
31
import "./app.js";
42

53
import {

ghcjs/delivery-calculator/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const webpack = require("webpack");
22

33
module.exports = {
44
entry : {
5-
miso_widgets : "../miso-functora/js/main.js",
5+
miso_functora : "../miso-functora/js/main.js",
66
wasm : "./static/wasm.js",
77
},
88
output : {

0 commit comments

Comments
 (0)