Skip to content

Commit a57659b

Browse files
committed
chore(example-app): 🎨 add full-width controllable for button component render
1 parent f503fb6 commit a57659b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

example/src/modules/primitives/ButtonScreen.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ export const ButtonScreen = () => {
2525
const [hasPrefix, setHasPrefix] = useState<boolean>(false);
2626
const [hasSuffix, setHasSuffix] = useState<boolean>(false);
2727
const [isLoading, setIsLoading] = useState<boolean>(false);
28+
const [fullWidth, setFullWidth] = useState<boolean>(false);
29+
2830
const { bottom } = useSafeAreaInsets();
2931

3032
return (
3133
<Box style={tailwind.style("flex-1 justify-center bg-white-900")}>
32-
<Box style={tailwind.style("flex-1 px-2 justify-center bg-white-900")}>
34+
<Box
35+
style={tailwind.style(
36+
`flex-1 px-2 justify-center bg-white-900 ${
37+
fullWidth ? "" : "items-center"
38+
}`,
39+
)}
40+
>
3341
<Button
3442
variant={selectedVariant}
3543
themeColor={selectedTheme}
@@ -118,6 +126,15 @@ export const ButtonScreen = () => {
118126
style={tailwind.style("mt-2 ml-1")}
119127
label="Loading"
120128
/>
129+
<Switch
130+
state={fullWidth}
131+
onStateChange={(value: SetStateAction<boolean>) =>
132+
setFullWidth(value)
133+
}
134+
size="md"
135+
style={tailwind.style("mt-2 ml-1")}
136+
label="Full Width"
137+
/>
121138
</Box>
122139
</Box>
123140
</Box>

0 commit comments

Comments
 (0)