Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix placement of notificationistList on docs page #7290

Merged
merged 2 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/ui/src/components/notifications/item.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ export default {
};

export const simpleData = {
id: '1',
content: '🎉 Storybook is cool!',
};

export const longData = {
id: '2',
content: '🎉 This is a long message that extends over two lines!',
};

export const linkData = {
id: '3',
content: '🎉 Storybook X.X is available! Download now »',
link: '/some/path',
};
Expand Down
9 changes: 7 additions & 2 deletions lib/ui/src/components/notifications/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ NotificationList.propTypes = {
top: PropTypes.number,
bottom: PropTypes.number,
}),
notifications: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }).isRequired)
.isRequired,
notifications: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string,
content: PropTypes.string.isRequired,
link: PropTypes.string,
}).isRequired
).isRequired,
};
NotificationList.defaultProps = {
placement: undefined,
Expand Down
8 changes: 6 additions & 2 deletions lib/ui/src/components/notifications/notifications.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ const items = Array.from(Object.entries(itemStories))
export const singleData = [items[0]];
export const allData = items;

export const single = () => <NotificationList notifications={singleData} />;
export const single = () => (
<NotificationList notifications={singleData} placement={{ position: 'relative' }} />
);

export const all = () => <NotificationList notifications={allData} />;
export const all = () => (
<NotificationList notifications={allData} placement={{ position: 'relative' }} />
);

export const placement = () => (
<NotificationList
Expand Down