Skip to content

Commit

Permalink
Add Notification component in storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandraYA authored and 3y3 committed Dec 16, 2024
1 parent 73e6811 commit 8895e3c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions demo/src/Components/Notification/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import {Notification as Component} from '@diplodoc/components';

const NotificationDemo = (args: Record<string, string>) => {
const currentType = args['Type'];
const currentTitle = args['Title'];
const currentContent = args['Content'];

return (
<Component
notification={{
title: currentTitle,
content: currentContent,
type: currentType,
}}
notificationCb={() => alert('Hello')}
/>
);
};

export default {
title: 'Components/Notification',
component: NotificationDemo,
argTypes: {
Type: {
control: 'select',
options: {
info: 'info',
tip: 'tip',
warning: 'warning',
alert: 'alert',
},
},
Title: {
control: 'text',
},
},
};

export const Notification = {
args: {
Type: 'info',
Title: 'Test title',
Content: 'Test content',
},
};

0 comments on commit 8895e3c

Please sign in to comment.