Skip to content

Commit 9bad2df

Browse files
committed
fix styles
1 parent 62065c4 commit 9bad2df

File tree

8 files changed

+68
-57
lines changed

8 files changed

+68
-57
lines changed

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

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,45 @@ import qualified Functora.Miso.Widgets.Icon as Icon
88

99
donate :: Model -> [View Action]
1010
donate st =
11-
if not . null $ st ^. #modelState . #stAssets
12-
then mempty
13-
else
14-
( button_
15-
[ onClick openWidget
16-
]
17-
[ icon Icon.IconBitcoin,
18-
text " Donate"
19-
]
11+
( button_
12+
[ onClick openWidget
13+
]
14+
[ icon Icon.IconBitcoin,
15+
text " Donate"
16+
]
17+
)
18+
: Dialog.dialog
19+
( Dialog.defOpts
20+
& #optsTitle
21+
.~ Just ("Donate" :: Unicode)
22+
& #optsTitleIcon
23+
.~ Just Icon.IconBitcoin
2024
)
21-
: Dialog.dialog
22-
( Dialog.defOpts
23-
& #optsTitle
24-
.~ Just ("Donate" :: Unicode)
25-
& #optsFlexCol
26-
.~ False
27-
& #optsTitleIcon
28-
.~ Just Icon.IconBitcoin
29-
)
30-
Dialog.Args
31-
{ Dialog.argsModel = st,
32-
Dialog.argsOptic = #modelDonate,
33-
Dialog.argsAction = PushUpdate,
34-
Dialog.argsContent =
35-
FieldPairs.fieldPairsViewer
36-
FieldPairs.defOpts
37-
FieldPairs.Args
38-
{ FieldPairs.argsModel = st,
39-
FieldPairs.argsOptic = #modelDonateViewer,
40-
FieldPairs.argsAction = PushUpdate,
41-
FieldPairs.argsEmitter = emitter st
42-
}
43-
}
25+
Dialog.Args
26+
{ Dialog.argsModel = st,
27+
Dialog.argsOptic = #modelDonate,
28+
Dialog.argsAction = PushUpdate,
29+
Dialog.argsContent =
30+
fmap
31+
( appendAttrs
32+
[ style_
33+
[ ("gap", "1rem"),
34+
("display", "flex"),
35+
("text-align", "center"),
36+
("align-items", "center"),
37+
("flex-direction", "column")
38+
]
39+
]
40+
)
41+
$ FieldPairs.fieldPairsViewer
42+
FieldPairs.defOpts
43+
FieldPairs.Args
44+
{ FieldPairs.argsModel = st,
45+
FieldPairs.argsOptic = #modelDonateViewer,
46+
FieldPairs.argsAction = PushUpdate,
47+
FieldPairs.argsEmitter = emitter st
48+
}
49+
}
4450
where
4551
openWidget =
4652
PushUpdate

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import qualified Functora.Miso.Widgets.BrowserLink as BrowserLink
88
import qualified Functora.Miso.Widgets.Dialog as Dialog
99
import qualified Functora.Miso.Widgets.Icon as Icon
1010

11-
googlePlay :: Model -> [View Action]
12-
googlePlay st =
13-
if not . null $ st ^. #modelState . #stAssets
14-
then mempty
15-
else
11+
googlePlay :: Model -> TopOrBottom -> [View Action]
12+
googlePlay st = \case
13+
Top -> if noitem then widget else mempty
14+
Bottom -> if noitem then mempty else widget
15+
where
16+
noitem = null $ st ^. #modelState . #stAssets
17+
widget =
1618
[ button_
1719
[ onClick openWidget
1820
]
@@ -96,7 +98,6 @@ googlePlay st =
9698
]
9799
<> Donate.donate st
98100
}
99-
where
100101
openWidget =
101102
PushUpdate
102103
. PureUpdate

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ mainWidget st =
4949
]
5050
]
5151
)
52-
[ tosWidget
53-
]
52+
( tosWidget
53+
: ShareApp.shareApp st Bottom
54+
<> GooglePlay.googlePlay st Bottom
55+
)
5456
]
5557
<> MarketLinks.marketLinks st
5658
<> ( if not $ st ^. #modelLoading
@@ -105,8 +107,8 @@ screenWidget st =
105107
text " Add item"
106108
]
107109
)
108-
: ShareApp.shareApp st
109-
<> GooglePlay.googlePlay st
110+
: ShareApp.shareApp st Top
111+
<> GooglePlay.googlePlay st Top
110112
<> RemoveOrder.removeOrder st
111113
<> PlaceOrder.placeOrder st
112114

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ import qualified Functora.Miso.Widgets.Dialog as Dialog
66
import qualified Functora.Miso.Widgets.FieldPairs as FieldPairs
77
import qualified Functora.Miso.Widgets.Icon as Icon
88

9-
shareApp :: Model -> [View Action]
10-
shareApp st =
11-
if not . null $ st ^. #modelState . #stAssets
12-
then mempty
13-
else
9+
shareApp :: Model -> TopOrBottom -> [View Action]
10+
shareApp st = \case
11+
Top -> if noitem then widget else mempty
12+
Bottom -> if noitem then mempty else widget
13+
where
14+
noitem = null $ st ^. #modelState . #stAssets
15+
widget =
1416
[ button_
15-
[ onClick openWidget
17+
[ onClick
18+
. PushUpdate
19+
. PureUpdate
20+
$ #modelShareApp
21+
.~ Opened
1622
]
1723
[ icon Icon.IconShare,
1824
text " Share app"
@@ -35,6 +41,7 @@ shareApp st =
3541
[ style_
3642
[ ("gap", "1rem"),
3743
("display", "flex"),
44+
("text-align", "center"),
3845
("align-items", "center"),
3946
("flex-direction", "column")
4047
]
@@ -49,9 +56,3 @@ shareApp st =
4956
FieldPairs.argsEmitter = emitter st
5057
}
5158
}
52-
where
53-
openWidget =
54-
PushUpdate
55-
. PureUpdate
56-
$ #modelShareApp
57-
.~ Opened

ghcjs/miso-functora/dist/miso-functora/post-theme.min.css

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

ghcjs/miso-functora/dist/miso-functora/pre-theme.min.css

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

ghcjs/miso-functora/lib/miso-functora/post-theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ button,
3737
textarea {
3838
min-width: 0 !important;
3939
max-width: 100% !important;
40-
margin: 0.25rem 0.125rem !important;
40+
margin: 0.125rem 0.125rem !important;
4141
}
4242

4343
button {

ghcjs/miso-functora/lib/miso-functora/pre-theme.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ body {
66

77
main,
88
form,
9+
footer,
910
select,
1011
option,
1112
dialog,

0 commit comments

Comments
 (0)