@@ -22,108 +22,111 @@ import qualified Text.URI as URI
2222
2323menu :: Model -> [View Action ]
2424menu st =
25- [ nav_
26- [ style_
27- [ (" grid-template-columns" , " auto 1fr auto auto auto auto" )
28- ]
29- ]
30- [ button_
31- [ role_ " button" ,
32- style_
33- [ (" min-width" , " 0" )
34- ],
35- onClick
36- . PushUpdate
37- . Instant
38- . PureUpdate
39- $ # modelMenu
40- .~ Opened
41- ]
42- [ icon Icon. IconMenu
43- ],
44- button_
45- [ role_ " button" ,
46- style_
47- [ (" min-width" , " 0" ),
48- (" justify-self" , " start" ),
49- (" word-break" , " keep-all" ),
50- (" overflow-wrap" , " normal" )
51- ],
52- onClick . PushUpdate . Instant . ImpureUpdate $ do
53- doc <- liftIO newSt
54- pure $ # modelState .~ doc
55- ]
56- [ text " Delivery Calculator"
57- ],
58- button_
59- [ role_ " button" ,
60- style_
61- [ (" min-width" , " 0" )
62- ],
63- onClick
64- . PushUpdate
65- . Instant
66- . PureUpdate
67- $ # modelFav
68- .~ Opened
69- ]
70- [ icon Icon. IconFav
71- ],
72- button_
73- [ role_ " button" ,
74- style_
75- [ (" min-width" , " 0" )
76- ],
77- onClick
78- . PushUpdate
79- . Instant
80- . ImpureUpdate
81- $ do
82- Jsm. printCurrentPage " delivery-calculator"
83- pure id
84- ]
85- [ icon Icon. IconPrint
86- ],
87- button_
88- [ role_ " button" ,
89- style_
90- [ (" min-width" , " 0" )
91- ],
92- onClick
93- . PushUpdate
94- . Instant
95- . ImpureUpdate
96- $ do
97- Jsm. saveFile
98- " delivery-calculator.xlsx"
99- " application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
100- Xlsx. newXlsx
101- pure id
102- ]
103- [ icon Icon. IconDownload
104- ],
105- button_
106- [ role_ " button" ,
107- style_
108- [ (" min-width" , " 0" )
109- ],
110- onClick
111- . PushUpdate
112- . Instant
113- . Jsm. shareText
114- . from @ String @ Unicode
115- . either impureThrow URI. renderStr
116- $ stUri st
117- ]
118- [ icon Icon. IconShare
119- ]
120- ]
25+ [ keyed " menu"
26+ $ nav_
27+ [ style_
28+ [ (" grid-template-columns" , " auto 1fr auto auto auto auto" )
29+ ]
30+ ]
31+ [ button_
32+ [ role_ " button" ,
33+ style_
34+ [ (" min-width" , " 0" )
35+ ],
36+ onClick
37+ . PushUpdate
38+ . Instant
39+ . PureUpdate
40+ $ # modelMenu
41+ .~ Opened
42+ ]
43+ [ icon Icon. IconMenu
44+ ],
45+ button_
46+ [ role_ " button" ,
47+ style_
48+ [ (" min-width" , " 0" ),
49+ (" justify-self" , " start" ),
50+ (" word-break" , " keep-all" ),
51+ (" overflow-wrap" , " normal" )
52+ ],
53+ onClick . PushUpdate . Instant . ImpureUpdate $ do
54+ doc <- liftIO newSt
55+ pure $ # modelState .~ doc
56+ ]
57+ [ text " Delivery Calculator"
58+ ],
59+ button_
60+ [ role_ " button" ,
61+ style_
62+ [ (" min-width" , " 0" )
63+ ],
64+ onClick
65+ . PushUpdate
66+ . Instant
67+ . PureUpdate
68+ $ # modelFav
69+ .~ Opened
70+ ]
71+ [ icon Icon. IconFav
72+ ],
73+ button_
74+ [ role_ " button" ,
75+ style_
76+ [ (" min-width" , " 0" )
77+ ],
78+ onClick
79+ . PushUpdate
80+ . Instant
81+ . ImpureUpdate
82+ $ do
83+ Jsm. printCurrentPage " delivery-calculator"
84+ pure id
85+ ]
86+ [ icon Icon. IconPrint
87+ ],
88+ button_
89+ [ role_ " button" ,
90+ style_
91+ [ (" min-width" , " 0" )
92+ ],
93+ onClick
94+ . PushUpdate
95+ . Instant
96+ . ImpureUpdate
97+ $ do
98+ Jsm. saveFile
99+ " delivery-calculator.xlsx"
100+ " application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
101+ Xlsx. newXlsx
102+ pure id
103+ ]
104+ [ icon Icon. IconDownload
105+ ],
106+ button_
107+ [ role_ " button" ,
108+ style_
109+ [ (" min-width" , " 0" )
110+ ],
111+ onClick
112+ . PushUpdate
113+ . Instant
114+ . Jsm. shareText
115+ . from @ String @ Unicode
116+ . either impureThrow URI. renderStr
117+ $ stUri st
118+ ]
119+ [ icon Icon. IconShare
120+ ]
121+ ]
121122 ]
122123 <> Fav. fav st
123124 <> Dialog. dialog
124125 ( Dialog. defOpts
125126 & # optsTitleIcon
126127 .~ Just Icon. IconSettings
128+ & # optsKeyed
129+ .~ (" menu" :: Unicode )
127130 & # optsTitle
128131 .~ Just " Settings"
129132 )
0 commit comments