import { Meta } from '@storybook/react';
import React from 'react';
import { merge } from '../../lib/merge';
import ClickableNotification, { ClickableNotificationProps } from '../ClickableNotification';
import FloatingNotificationInbox from '../FloatingNotificationInbox';
import MagicBell from '../MagicBell';
import MagicBellProvider from '../MagicBellProvider';
const Component = ({
onAllRead,
onNotificationClick,
apiKey,
userEmail,
userKey,
NotificationItem,
theme,
stores,
tabs,
...props
}) => (
{(props) => (
)}
);
const meta: Meta = {
component: Component,
argTypes: {
onAllRead: { action: 'onAllRead' },
onNotificationClick: { action: 'onNotificationClick' },
},
};
export default meta;
export const Default = {
args: {
locale: 'en',
},
};
export const WithCustomIcon = merge(Default, {
args: {
BellIcon: (
),
},
});
export const WithCustomTheme = merge(Default, {
args: {
theme: {
header: { backgroundColor: '#FAD776', textColor: '#161C2D' },
footer: { backgroundColor: '#FAD776', textColor: '#161C2D' },
notification: {
unread: { backgroundColor: '#FAD776', backgroundOpacity: 0.1 },
},
},
},
});
export const WithCustomThemeTwo = merge(Default, {
args: {
theme: {
icon: { borderColor: '#6113A3', width: '24px' },
unseenBadge: { backgroundColor: '#DF4759' },
header: { backgroundColor: '#6113A3', textColor: '#ffffff', borderRadius: '16px' },
footer: { backgroundColor: '#6113A3', textColor: '#ffffff', borderRadius: '16px' },
notification: {
default: { textColor: '#15091F', borderRadius: '8px', backgroundColor: '#6113A3' },
unseen: { backgroundColor: '#6113A3' },
unread: { backgroundColor: '#6113A3' },
},
},
},
});
export const WithInboxOpen = merge(Default, {
args: {
defaultIsOpen: true,
},
});
export const WithCustomEmptyImage = merge(Default, {
args: {
images: {
emptyInboxUrl:
'https://thumbs.dreamstime.com/b/inbox-box-cabinet-document-empty-project-blue-icon-abstract-cloud-background-148443579.jpg',
},
},
});
export const WithUnreadCount = merge(Default, {
args: {
bellCounter: 'unread',
},
});
export const WithCustomBadge = merge(Default, {
args: {
bellCounter: 'unread',
Badge: ({ count }) => (
{count}
),
},
});
export const WithoutRichText = merge(Default, {
args: {
bellCounter: 'unread',
NotificationItem: (props: ClickableNotificationProps) => ,
},
});
export const WithConditionalRichText = merge(Default, {
args: {
bellCounter: 'unread',
NotificationItem: (props: ClickableNotificationProps) => (
),
},
});
export const WithSplitInbox = merge(Default, {
args: {
stores: [
{ id: 'default', defaultQueryParams: {} },
{ id: 'unread', defaultQueryParams: { read: true } },
{ id: 'billing', defaultQueryParams: { category: 'billing' } },
],
tabs: [
{ storeId: 'default', label: 'Latest' },
{ storeId: 'unread', label: 'Archive' },
{ storeId: 'billing', label: 'Billing' },
],
},
});