Skip to content

Commit

Permalink
WEB-2113 export + snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Ladaria committed Dec 19, 2024
1 parent 1fadd9c commit 3d89e89
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions playroom/snippets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,35 @@ const menuSnippet = {
group: 'Menu',
};

const drawerSnippet = {
name: 'Drawer',
group: 'Drawer',
code: `
<ButtonPrimary onPress={() => setState("openDrawer", true)}>
Open Drawer
</ButtonPrimary>
{getState("openDrawer", false) && (
<Drawer
title="Title"
subtitle="Subtitle"
description="Description"
onClose={() => setState("openDrawer", false)}
button={{ text: "Primary", onPress: () => {} }}
secondaryButton={{ text: "Secondary", onPress: () => {} }}
buttonLink={{ text: "Link", onPress: () => {} }}
onDismiss={() => {}}
>
<Stack space={16}>
<Placeholder height={300} />
<Placeholder height={300} />
<Placeholder height={300} />
<Placeholder height={300} />
</Stack>
</Drawer>
)}
`,
};

const accordionSnippets: Array<Snippet> = [
{
group: 'Accordion',
Expand Down Expand Up @@ -4337,4 +4366,5 @@ export default [
...ProgressBlockSnippets,
...loadingScreenSnippets,
...tableSnippets,
drawerSnippet,
].sort((s1, s2) => s1.group.localeCompare(s2.group)) as Array<Snippet>;
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export {
CarouselContextConsumer,
} from './carousel';
export {Grid, GridItem} from './grid';
export {default as Drawer} from './drawer';

// Sheets
export {default as SheetRoot, showSheet} from './sheet-root';
Expand Down

0 comments on commit 3d89e89

Please sign in to comment.