Skip to content

Commit

Permalink
feat: Added Backdrop story
Browse files Browse the repository at this point in the history
Signed-off-by: Antonette Caldwell <[email protected]>
  • Loading branch information
nebula-aac committed Sep 20, 2023
1 parent 456002b commit 41affa5
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions apps/design-system/src/stories/Backdrop.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { Meta } from '@storybook/react';
import { useState } from 'react';

import { Backdrop, Button } from '@layer5/sistent-components';

const meta = {
title: 'Example/Backdrop',
component: Backdrop,
parameters: {
layout: 'centered'
},
tags: ['autodocs']
} satisfies Meta<typeof Backdrop>;

export default meta;
// type Story = StoryObj<typeof meta>;

export function Basic() {
const [open, setOpen] = useState(false);
const handleClose = () => {
setOpen(false);
};
const handleOpen = () => {
setOpen(true);
};

return (
<div>
<Button onClick={handleOpen} variant="contained" label="Open Backdrop" />
<Backdrop
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
open={open}
onClick={handleClose}
>
Hello
</Backdrop>
</div>
);
}

0 comments on commit 41affa5

Please sign in to comment.