@@ -13,17 +13,19 @@ import (
13
13
)
14
14
15
15
const (
16
- YellowButtonCss = "font-bold bg-amber-600 p-2 rounded mx-1"
17
- ErrorDivCss = "flex flex-row fixed bottom-4 left-4 bg-red-500 p-4 text-xl rounded-lg"
18
- CenteringDivCss = "flex flex-row min-h-screen justify-center items-center"
19
- WindowDivCss = "p-4 text-center text-xl shadow-lg bg-zinc-800 rounded-lg mx-10"
20
- InviCss = "fixed invisible"
21
- RootContainerCss = "shadow-lg bg-zinc-800 rounded-lg p-6 min-h-72 relative"
22
- LoadingCss = "flex flex-row justify-center items-center"
23
- RemoveButtonCss = "font-bold bg-red-500 p-2 rounded hover:bg-red-700 m-1"
24
- LogoutButtonCss = "font-bold bg-amber-700 p-2 rounded mx-1 hover:bg-amber-900"
25
- UpdateButtonCss = "bg-green-600 hover:bg-green-800 text-xl p-2 rounded bottom-4 right-4 fixed"
26
- InstallButtonCss = "bg-green-600 hover:bg-green-800 p-2 rounded m-2"
16
+ YellowButtonCss = "font-bold bg-amber-600 p-2 rounded mx-1"
17
+ ErrorDivCss = "flex flex-row fixed bottom-4 left-4 bg-red-500 p-4 text-xl rounded-lg"
18
+ CenteringDivCss = "flex flex-row min-h-screen justify-center items-center"
19
+ WindowDivCss = "p-4 text-center text-xl shadow-lg bg-zinc-800 rounded-lg mx-10"
20
+ InviCss = "fixed invisible"
21
+ RootContainerCss = "shadow-lg bg-zinc-800 rounded-lg p-6 min-h-72 relative"
22
+ LoadingCss = "flex flex-row justify-center items-center"
23
+ RemoveButtonCss = "font-bold bg-red-500 p-2 rounded hover:bg-red-700 m-1"
24
+ LogoutButtonCss = "font-bold bg-orange-600 p-2 rounded mx-1 hover:bg-orange-800"
25
+ UpdateButtonCss = "bg-green-600 hover:bg-green-800 text-xl p-2 rounded bottom-4 right-4 fixed"
26
+ InstallButtonCss = "bg-green-600 hover:bg-green-800 p-2 rounded m-2"
27
+ BurgerMenuButtonCss = "text-xl fixed top-4 right-4"
28
+ RootButtonsCss = "flex flex-col absolute top-12 right-4"
27
29
)
28
30
29
31
type ErrorContainer struct {
@@ -132,6 +134,7 @@ func (b *RootContainer) Render() app.UI {
132
134
& UpdateButton {},
133
135
app .Div ().Body (
134
136
app .H1 ().Text ("Flush Log" ).Class ("text-2xl" ),
137
+ & BurgerMenuButton {},
135
138
app .Div ().Body (
136
139
& buttonLogout {},
137
140
& LinkButton {
@@ -145,7 +148,7 @@ func (b *RootContainer) Render() app.UI {
145
148
AdditionalCss : "hover:bg-amber-800" ,
146
149
},
147
150
& InstallButton {},
148
- ).ID ("root-buttons-container" ).Class ("flex flex-col absolute top-4 right-4" ),
151
+ ).ID ("root-buttons-container" ).Class (InviCss ),
149
152
app .P ().Text ("Tracked flushes:" ).Class ("py-2" ),
150
153
& LoadingWidget {id : "flushes-loading" },
151
154
b .FlushList ,
@@ -962,3 +965,25 @@ func (b *InstallButton) Render() app.UI {
962
965
func (b * InstallButton ) onInstallButtonClicked (ctx app.Context , e app.Event ) {
963
966
ctx .ShowAppInstallPrompt ()
964
967
}
968
+
969
+ type BurgerMenuButton struct {
970
+ app.Compo
971
+ alreadyClicked bool
972
+ }
973
+
974
+ func (b * BurgerMenuButton ) Render () app.UI {
975
+ return app .Button ().
976
+ Text ("☰" ).
977
+ Class (BurgerMenuButtonCss ).
978
+ OnClick (b .OnClick ).
979
+ ID ("burger-menu-button" )
980
+ }
981
+ func (b * BurgerMenuButton ) OnClick (ctx app.Context , e app.Event ) {
982
+ if b .alreadyClicked {
983
+ b .alreadyClicked = false
984
+ app .Window ().GetElementByID ("root-buttons-container" ).Set ("className" , InviCss )
985
+ } else {
986
+ b .alreadyClicked = true
987
+ app .Window ().GetElementByID ("root-buttons-container" ).Set ("className" , RootButtonsCss )
988
+ }
989
+ }
0 commit comments