Skip to content

Commit b9ccee4

Browse files
committed
wip
1 parent 0b73a1d commit b9ccee4

File tree

7 files changed

+67
-27
lines changed

7 files changed

+67
-27
lines changed

ghcjs/delivery-calculator/src/App/Widgets/Main.hs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ import Miso hiding (at, view)
1717

1818
mainWidget :: Model -> View Action
1919
mainWidget st =
20-
section_
20+
div_
2121
[ style_
22-
[ ("margin", "0"),
23-
("padding", "0"),
22+
[ ("padding", "0"),
23+
("margin", "0 auto"),
2424
("min-height", "100vh"),
2525
("display", "flex"),
2626
("flex-direction", "column"),
2727
("justify-content", "space-between"),
2828
("align-items", "center")
2929
]
3030
]
31-
$ [ header_
32-
[ style_ [("width", "100%")]
33-
]
34-
$ Menu.menu st
35-
]
31+
$ Menu.menu st
3632
<> [ Flex.flexCol main_ id $ screenWidget st
3733
]
3834
<> [ footer_
@@ -96,7 +92,7 @@ screenWidget st@Model {modelState = St {stScreen = Main}} =
9692
then mempty
9793
else buttons
9894
)
99-
<> [ Flex.flexCol section_ id $ Asset.assetsViewer st <> totalViewer st
95+
<> [ Flex.flexCol div_ id $ Asset.assetsViewer st <> totalViewer st
10096
]
10197
<> buttons
10298
where
@@ -106,7 +102,7 @@ screenWidget st@Model {modelState = St {stScreen = Main}} =
106102
buttons =
107103
singleton
108104
$ Flex.flexRow
109-
section_
105+
p_
110106
id
111107
[ button_
112108
[ type_ "submit",

ghcjs/delivery-calculator/src/App/Widgets/Menu.hs

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,27 @@ import qualified Functora.Miso.Widgets.BrowserLink as BrowserLink
1414
import qualified Functora.Miso.Widgets.Currency as Currency
1515
import qualified Functora.Miso.Widgets.Dialog as Dialog
1616
import qualified Functora.Miso.Widgets.Field as Field
17-
import qualified Functora.Miso.Widgets.Flex as Flex
1817
import qualified Functora.Miso.Widgets.Icon as Icon
1918
import qualified Functora.Miso.Widgets.Select as Select
2019
import qualified Functora.Money as Money
2120
import qualified Text.URI as URI
2221

2322
menu :: Model -> [View Action]
2423
menu st =
25-
( Flex.flexLeftRight
26-
menu_
27-
id
28-
[ li_
24+
[ nav_
25+
[ style_
26+
[ ("width", "100%"),
27+
("display", "grid"),
28+
("align-items", "center"),
29+
("grid-template-columns", "auto 1fr auto auto auto auto")
30+
]
31+
]
32+
[ button_
2933
[ role_ "button",
34+
style_
35+
[ ("min-width", "0"),
36+
("justify-self", "start")
37+
],
3038
onClick
3139
. PushUpdate
3240
. Instant
@@ -36,17 +44,26 @@ menu st =
3644
]
3745
[ icon Icon.IconMenu
3846
],
39-
li_
47+
button_
4048
[ role_ "button",
49+
style_
50+
[ ("min-width", "0"),
51+
("justify-self", "start"),
52+
("word-break", "keep-all"),
53+
("overflow-wrap", "normal")
54+
],
4155
onClick . PushUpdate . Instant . ImpureUpdate $ do
4256
doc <- liftIO newSt
4357
pure $ #modelState .~ doc
4458
]
4559
[ text "Delivery Calculator"
46-
]
47-
]
48-
[ li_
60+
],
61+
button_
4962
[ role_ "button",
63+
style_
64+
[ ("min-width", "0"),
65+
("justify-self", "end")
66+
],
5067
onClick
5168
. PushUpdate
5269
. Instant
@@ -56,8 +73,12 @@ menu st =
5673
]
5774
[ icon Icon.IconFav
5875
],
59-
li_
76+
button_
6077
[ role_ "button",
78+
style_
79+
[ ("min-width", "0"),
80+
("justify-self", "end")
81+
],
6182
onClick
6283
. PushUpdate
6384
. Instant
@@ -68,8 +89,12 @@ menu st =
6889
]
6990
[ icon Icon.IconPrint
7091
],
71-
li_
92+
button_
7293
[ role_ "button",
94+
style_
95+
[ ("min-width", "0"),
96+
("justify-self", "end")
97+
],
7398
onClick
7499
. PushUpdate
75100
. Instant
@@ -83,8 +108,12 @@ menu st =
83108
]
84109
[ icon Icon.IconDownload
85110
],
86-
li_
111+
button_
87112
[ role_ "button",
113+
style_
114+
[ ("min-width", "0"),
115+
("justify-self", "end")
116+
],
88117
onClick
89118
. PushUpdate
90119
. Instant
@@ -96,7 +125,7 @@ menu st =
96125
[ icon Icon.IconShare
97126
]
98127
]
99-
)
128+
]
100129
<> Fav.fav st
101130
<> Dialog.dialog
102131
( Dialog.defOpts

ghcjs/delivery-calculator/src/Main.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ viewModel st =
245245
link_
246246
[ rel_ "stylesheet",
247247
-- href_ "static/css/mvp.css"
248-
href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
248+
-- href_ "static/css/simple.min.css"
249+
href_ "static/css/tacit-css-1.8.1.min.css"
250+
-- href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
249251
],
250252
link_
251253
[ rel_ "stylesheet",

ghcjs/delivery-calculator/static/css/app.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ html {
77
min-height: 100vh;
88
}
99

10-
html, main {
10+
body {
11+
padding: 0;
12+
margin: 0 auto;
13+
}
14+
15+
html,
16+
main {
1117
margin: 0;
1218
padding: 0;
1319
}
1420

15-
header, footer {
21+
header,
22+
footer {
1623
margin-left: 0;
1724
margin-right: 0;
1825
padding-left: 0;
@@ -30,6 +37,10 @@ dialog {
3037

3138
button {
3239
margin: 0.25rem 0.125rem;
40+
padding-top: 4px;
41+
padding-bottom: 4px;
42+
padding-left: 12px;
43+
padding-right: 12px;
3344
}
3445

3546
@media print {

ghcjs/delivery-calculator/static/css/simple.min.css

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

ghcjs/delivery-calculator/static/css/tacit-css-1.8.1.min.css

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

nix/tools.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ with pkgs; let
5454
pkgs.nodePackages.prettier
5555
}/bin/prettier --plugin ${
5656
pkgs.nodePackages.prettier-plugin-toml
57-
}/lib/node_modules/prettier-plugin-toml/lib/api.js "$@"
57+
}/lib/node_modules/prettier-plugin-toml/lib/index.js "$@"
5858
'';
5959
};
6060
styleTest = pkgs.writeShellScriptBin "style-test" ''

0 commit comments

Comments
 (0)