Skip to content

Commit c2a676d

Browse files
Rajat ChaudharyRajat Chaudhary
authored andcommitted
fix: actionsheet
1 parent b12110f commit c2a676d

File tree

1 file changed

+123
-1
lines changed

1 file changed

+123
-1
lines changed

example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,4 +1126,126 @@ The Actionsheet with SectionList is a variation of the Actionsheet component tha
11261126
argsType: {},
11271127
}}
11281128
/>
1129-
</Wrapper>
1129+
</Wrapper>
1130+
1131+
{/* ### Actionsheet with CTA
1132+
1133+
<Wrapper>
1134+
<CodePreview
1135+
showComponentRenderer={true}
1136+
showArgsController={false}
1137+
metaData={{
1138+
code: `
1139+
function App(){
1140+
const [showActionsheet, setShowActionsheet] = React.useState(false);
1141+
const handleClose = () => setShowActionsheet(false);
1142+
return (
1143+
<>
1144+
<Button onPress={() => setShowActionsheet(true)}>
1145+
<ButtonText>Open</ButtonText>
1146+
</Button>
1147+
<Actionsheet isOpen={showActionsheet} onClose={handleClose}>
1148+
<ActionsheetBackdrop />
1149+
<ActionsheetContent className="px-5">
1150+
<ActionsheetDragIndicatorWrapper>
1151+
<ActionsheetDragIndicator />
1152+
</ActionsheetDragIndicatorWrapper>
1153+
<HStack className="justify-between w-full gap-2 mt-3">
1154+
<Text
1155+
size="xl"
1156+
className="font-semibold text-typography-900 flex-1"
1157+
>
1158+
See what all new features are available in this updated
1159+
</Text>
1160+
<Pressable onPress={handleClose}>
1161+
<Icon as={CloseIcon} size="lg" className="stroke-background-500" />
1162+
</Pressable>
1163+
</HStack>
1164+
<VStack className="my-5 gap-3 w-full">
1165+
<ActionsheetItem className="gap-3 w-full" onPress={handleClose}>
1166+
<Box className="bg-success-700 rounded-full items-center justify-center w-8 h-8">
1167+
<ActionsheetIcon size="sm" as={Send} className="stroke-typography-0" />
1168+
</Box>
1169+
<VStack className="flex-1">
1170+
<Text className="text-typography-950">
1171+
Simplified navigation
1172+
</Text>
1173+
<ActionsheetItemText size="sm">
1174+
Usage of app was never that easy: all important things at your
1175+
fingertips
1176+
</ActionsheetItemText>
1177+
</VStack>
1178+
</ActionsheetItem>
1179+
<ActionsheetItem className="gap-3" onPress={handleClose}>
1180+
<Box className="w-8 h-8 bg-success-700 rounded-full items-center justify-center">
1181+
<ActionsheetIcon
1182+
size="sm"
1183+
as={Percent}
1184+
className="stroke-typography-0"
1185+
/>
1186+
</Box>
1187+
<VStack className="flex-1">
1188+
<Text className="text-typography-950">Special offer</Text>
1189+
<ActionsheetItemText size="sm">
1190+
Get new offers and discounts every week right in the app
1191+
</ActionsheetItemText>
1192+
</VStack>
1193+
</ActionsheetItem>
1194+
<ActionsheetItem className="gap-3" onPress={handleClose}>
1195+
<Box className="w-8 h-8 bg-success-700 rounded-full items-center justify-center">
1196+
<ActionsheetIcon
1197+
size="sm"
1198+
as={DollarSign}
1199+
className="stroke-typography-0"
1200+
/>
1201+
</Box>
1202+
<VStack className="flex-1">
1203+
<Text className="text-typography-950">New cashback</Text>
1204+
<ActionsheetItemText size="sm">
1205+
Get daily cashback from every purchase you make and even more
1206+
when you shop at our partners
1207+
</ActionsheetItemText>
1208+
</VStack>
1209+
</ActionsheetItem>
1210+
</VStack>
1211+
<Button className="w-full" size="lg" onPress={handleClose}>
1212+
<ButtonText>Explore all</ButtonText>
1213+
</Button>
1214+
</ActionsheetContent>
1215+
</Actionsheet>
1216+
</>
1217+
);
1218+
}
1219+
`,
1220+
transformCode: (code) => {
1221+
return transformedCode(code, 'function', 'App');
1222+
},
1223+
scope: {
1224+
Actionsheet,
1225+
ActionsheetBackdrop,
1226+
ActionsheetContent,
1227+
ActionsheetDragIndicator,
1228+
ActionsheetDragIndicatorWrapper,
1229+
ActionsheetItem,
1230+
ActionsheetIcon,
1231+
ActionsheetItemText,
1232+
ActionsheetSectionList,
1233+
ActionsheetSectionHeaderText,
1234+
Button,
1235+
ButtonText,
1236+
Wrapper,
1237+
HStack,
1238+
VStack,
1239+
Box,
1240+
Text,
1241+
Icon,
1242+
CloseIcon,
1243+
Send,
1244+
Percent,
1245+
DollarSign,
1246+
Pressable
1247+
},
1248+
argsType: {},
1249+
}}
1250+
/>
1251+
</Wrapper> */}

0 commit comments

Comments
 (0)