@@ -53,9 +53,8 @@ const Positions = () => {
53
53
const iconSize = 14 ;
54
54
55
55
const handleChangePosition = ( position : Position ) => {
56
- t . open ( {
56
+ t . success ( {
57
57
text : `Position changed` ,
58
- variant : 'info' ,
59
58
description : `Position changed to ${ position } ` ,
60
59
} ) ;
61
60
setToastPosition ( position ) ;
@@ -124,50 +123,50 @@ const Theme = () => {
124
123
125
124
const handleChangeTheme = ( theme : Theme | undefined ) => {
126
125
if ( theme === undefined ) {
127
- t . open ( {
126
+ t . success ( {
128
127
text : 'Theme reset to default' ,
129
- variant : 'success' ,
130
128
} ) ;
131
129
} else {
132
- t . open ( {
130
+ t . success ( {
133
131
text : `Theme changed to ${ theme } ` ,
134
- variant : 'success' ,
135
132
} ) ;
136
133
}
137
134
setToastTheme ( theme ) ;
138
135
} ;
139
136
140
137
return (
141
138
< div className = "flex flex-col space-y-2" >
142
- < div className = "flex items-center space-x-2 py-2" >
143
- < Button variant = "outline" onClick = { ( ) => handleChangeTheme ( undefined ) } >
139
+ < div className = "flex items-center justify-between" >
140
+ < div className = "flex items-center space-x-2 py-2" >
141
+ < Button
142
+ variant = "outline"
143
+ className = { toastTheme === 'light' ? activeBtn : '' }
144
+ onClick = { ( ) => handleChangeTheme ( 'light' ) }
145
+ >
146
+ { toastTheme === 'light' ? (
147
+ < CheckIcon size = { iconSize } />
148
+ ) : (
149
+ < SunIcon size = { iconSize } />
150
+ ) }
151
+ < span > light</ span >
152
+ </ Button >
153
+ < Button
154
+ variant = "outline"
155
+ className = { toastTheme === 'dark' ? activeBtn : '' }
156
+ onClick = { ( ) => handleChangeTheme ( 'dark' ) }
157
+ >
158
+ { toastTheme === 'dark' ? (
159
+ < CheckIcon size = { iconSize } />
160
+ ) : (
161
+ < MoonIcon size = { iconSize } />
162
+ ) }
163
+ < span > dark</ span >
164
+ </ Button >
165
+ </ div >
166
+ < Button variant = "ghost" onClick = { ( ) => handleChangeTheme ( undefined ) } >
144
167
< RefreshCcwIcon size = { iconSize } />
145
168
< span > reset</ span >
146
169
</ Button >
147
- < Button
148
- variant = "outline"
149
- className = { toastTheme === 'light' ? activeBtn : '' }
150
- onClick = { ( ) => handleChangeTheme ( 'light' ) }
151
- >
152
- { toastTheme === 'light' ? (
153
- < CheckIcon size = { iconSize } />
154
- ) : (
155
- < SunIcon size = { iconSize } />
156
- ) }
157
- < span > light</ span >
158
- </ Button >
159
- < Button
160
- variant = "outline"
161
- className = { toastTheme === 'dark' ? activeBtn : '' }
162
- onClick = { ( ) => handleChangeTheme ( 'dark' ) }
163
- >
164
- { toastTheme === 'dark' ? (
165
- < CheckIcon size = { iconSize } />
166
- ) : (
167
- < MoonIcon size = { iconSize } />
168
- ) }
169
- < span > dark</ span >
170
- </ Button >
171
170
</ div >
172
171
< ProviderCodeBlock label = "theme" value = { toastTheme || 'system' } />
173
172
</ div >
0 commit comments