@@ -5,6 +5,7 @@ import { MenuItem } from "./MenuItem";
5
5
import { SubMenu } from "./SubMenu" ;
6
6
import { SubMenuItem } from "./SubMenuItem" ;
7
7
import { Button } from "../Button" ;
8
+ import { Text } from "../Text" ;
8
9
9
10
const meta : Meta < typeof Menu > = {
10
11
title : "Components/Menu" ,
@@ -62,9 +63,9 @@ export const Default: Story = {
62
63
render : ( ) => {
63
64
const [ selectedTheme , setSelectedTheme ] = useState ( "auto" ) ;
64
65
const themes = [
65
- { id : "auto" , label : "Auto" , description : "Follow system preference" } ,
66
- { id : "light" , label : "Light" , description : "Always use light theme" } ,
67
- { id : "dark" , label : "Dark" , description : "Always use dark theme" } ,
66
+ { id : "auto" , label : "Auto" , description : undefined } ,
67
+ { id : "light" , label : "Light" , description : undefined } ,
68
+ { id : "dark" , label : "Dark" , description : undefined } ,
68
69
] ;
69
70
return (
70
71
< div className = "p-4" >
@@ -75,25 +76,49 @@ export const Default: Story = {
75
76
</ button >
76
77
}
77
78
>
78
- < SubMenu name = "Theme" description = { selectedTheme } icon = { < ThemeIcon /> } suffix = { < ChevronRightIcon /> } >
79
- < div className = "flex flex-col" >
80
- { themes . map ( ( theme ) => (
81
- < SubMenuItem
82
- key = { theme . id }
83
- label = { theme . label }
84
- description = { theme . description }
85
- selected = { selectedTheme === theme . id }
86
- onClick = { ( ) => {
87
- setSelectedTheme ( theme . id ) ;
88
- console . log ( `Theme selected: ${ theme . id } ` ) ;
89
- } }
90
- />
91
- ) ) }
92
- </ div >
93
- </ SubMenu >
94
- < MenuItem name = "Report a bug" icon = { < ReportABugIcon /> } suffix = { < ChevronRightIcon /> } />
95
- < MenuItem name = "Terms of Use" suffix = { < ChevronRightIcon /> } />
96
- < MenuItem name = "Privacy Policy" suffix = { < ChevronRightIcon /> } />
79
+ < Text variant = "body1" className = "px-7 pb-6 text-accent-primary md:hidden" >
80
+ Settings
81
+ </ Text >
82
+ < div className = "mx-[21px] rounded-lg md:mx-0" >
83
+ < SubMenu
84
+ name = "Theme"
85
+ description = { selectedTheme }
86
+ icon = { < ThemeIcon /> }
87
+ suffix = { < ChevronRightIcon /> }
88
+ className = "bg-secondary-highlight md:bg-transparent"
89
+ >
90
+ < div className = "flex flex-col" >
91
+ { themes . map ( ( theme ) => (
92
+ < SubMenuItem
93
+ key = { theme . id }
94
+ label = { theme . label }
95
+ description = { theme ?. description ?? "" }
96
+ selected = { selectedTheme === theme . id }
97
+ onClick = { ( ) => {
98
+ setSelectedTheme ( theme . id ) ;
99
+ console . log ( `Theme selected: ${ theme . id } ` ) ;
100
+ } }
101
+ />
102
+ ) ) }
103
+ </ div >
104
+ </ SubMenu >
105
+ < MenuItem
106
+ name = "Report a bug"
107
+ icon = { < ReportABugIcon /> }
108
+ suffix = { < ChevronRightIcon /> }
109
+ className = "mb-4 bg-secondary-highlight md:mb-0 md:bg-transparent"
110
+ />
111
+ < MenuItem
112
+ name = "Terms of Use"
113
+ suffix = { < ChevronRightIcon /> }
114
+ className = "bg-secondary-highlight md:bg-transparent"
115
+ />
116
+ < MenuItem
117
+ name = "Privacy Policy"
118
+ suffix = { < ChevronRightIcon /> }
119
+ className = "bg-secondary-highlight md:bg-transparent"
120
+ />
121
+ </ div >
97
122
< div className = "my-4 flex justify-center" >
98
123
< Button className = "!bg-[#D5FCE8] !text-black" variant = "contained" >
99
124
Switch to BABY Staking
0 commit comments