File tree Expand file tree Collapse file tree 3 files changed +64
-30
lines changed
delivery-calculator/src/App/Widgets
miso-functora/src/Functora/Miso/Widgets Expand file tree Collapse file tree 3 files changed +64
-30
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,10 @@ menu st =
119
119
]
120
120
<> Fav. fav st
121
121
<> Dialog. dialog
122
- Dialog. defOpts
122
+ ( Dialog. defOpts
123
+ & # optsTitle
124
+ .~ Just " Settings"
125
+ )
123
126
Dialog. Args
124
127
{ Dialog. argsModel = st,
125
128
Dialog. argsOptic = # modelMenu,
Original file line number Diff line number Diff line change @@ -86,18 +86,29 @@ selectCurrency
86
86
}
87
87
where
88
88
open =
89
- action . PureUpdate $ \ prev ->
90
- prev
91
- & cloneTraversal optic
92
- . # currencyModalState
93
- . # uniqueValue
94
- .~ Opened
95
- & cloneTraversal optic
96
- . # currencyInput
97
- . # fieldInput
98
- . # uniqueValue
99
- .~ mempty
100
- & extraOnClick
89
+ action
90
+ $ PureAndImpureUpdate
91
+ ( \ prev ->
92
+ prev
93
+ & cloneTraversal optic
94
+ . # currencyModalState
95
+ . # uniqueValue
96
+ .~ Opened
97
+ & cloneTraversal optic
98
+ . # currencyInput
99
+ . # fieldInput
100
+ . # uniqueValue
101
+ .~ mempty
102
+ & cloneTraversal optic
103
+ . # currencyInput
104
+ . # fieldOutput
105
+ .~ mempty
106
+ & extraOnClick
107
+ )
108
+ ( do
109
+ Dialog. openDialog st (cloneTraversal optic . # currencyModalState)
110
+ pure id
111
+ )
101
112
102
113
currencyListWidget :: Opts model -> Args model action -> View action
103
114
currencyListWidget
@@ -155,28 +166,38 @@ currencyListItemWidget
155
166
Opts
156
167
{ optsExtraOnClick = extraOnClick
157
168
}
158
- Args
169
+ args @ Args
159
170
{ argsOptic = optic,
160
171
argsAction = action
161
172
}
162
173
current
163
174
fuzz =
164
175
li_
165
- [ onClick . action . PureUpdate $ \ st ->
166
- st
167
- & cloneTraversal optic
168
- . # currencyModalState
169
- . # uniqueValue
170
- .~ Closed
171
- & cloneTraversal optic
172
- . # currencyInput
173
- . # fieldInput
174
- . # uniqueValue
175
- .~ mempty
176
- & cloneTraversal optic
177
- . # currencyOutput
178
- .~ item
179
- & extraOnClick
176
+ [ onClick
177
+ . action
178
+ $ PureAndImpureUpdate
179
+ ( \ st ->
180
+ st
181
+ & cloneTraversal optic
182
+ . # currencyModalState
183
+ . # uniqueValue
184
+ .~ Closed
185
+ & cloneTraversal optic
186
+ . # currencyInput
187
+ . # fieldInput
188
+ . # uniqueValue
189
+ .~ mempty
190
+ & cloneTraversal optic
191
+ . # currencyOutput
192
+ .~ item
193
+ & extraOnClick
194
+ )
195
+ ( do
196
+ Dialog. closeDialog
197
+ (argsModel args)
198
+ (cloneTraversal optic . # currencyModalState)
199
+ pure id
200
+ )
180
201
]
181
202
[ ( if current == item
182
203
then strong_ mempty
Original file line number Diff line number Diff line change @@ -76,7 +76,17 @@ dialog opts args =
76
76
where
77
77
defHeaderLeft =
78
78
maybeToList
79
- . fmap (h2_ [style_ [(" margin" , " 0" )]] . singleton . text)
79
+ . fmap
80
+ ( h2_
81
+ [ style_
82
+ [ (" margin" , " 0" ),
83
+ (" display" , " flex" ),
84
+ (" align-items" , " center" )
85
+ ]
86
+ ]
87
+ . singleton
88
+ . text
89
+ )
80
90
$ optsTitle opts
81
91
defHeaderRight =
82
92
[ button_
You can’t perform that action at this time.
0 commit comments