2020-04-26 20:33:39 +00:00
|
|
|
// @flow
|
|
|
|
import * as React from 'react';
|
|
|
|
import NoticeTable from './notice-table';
|
|
|
|
|
Storybook Sidebar Provisioning & WIP Implementation (#2125)
* Migrating dimensions, latest SVG, stubbing sidebar
* Revert "Migrating dimensions, latest SVG, stubbing sidebar"
This reverts commit 5014a68f52ac50fc62db5d42d2b49abda28efaea.
* Revert "Revert "Migrating dimensions, latest SVG, stubbing sidebar""
This reverts commit 28c130c8d8b3993f91f072de106d3ff223d6c55b.
* Post merge bootstrap & build
* Linting
* Updating Story Heirarchy
* Migrating legacy tooltip component
* Reverting spacing integration into core dimensions
* Cleaning up comments, tweaking CSS var usage
* Removing static height
* Cleaning up static CSS values, re-organizing sliding panel, fixing search icon
* adding flow def for autobind in new SB instance
* PR feedback, removing new vars/updating markup
* Fixing lint > flow error on type
2020-05-14 18:00:29 +00:00
|
|
|
export default { title: '1st Party | NoticeTable' };
|
2020-04-26 20:33:39 +00:00
|
|
|
|
|
|
|
const notices = [
|
|
|
|
{ type: 'error', line: 3, message: 'This must be fixed now!' },
|
|
|
|
{ type: 'warning', line: 10, message: 'This is a small nitpick' },
|
|
|
|
{
|
|
|
|
type: 'warning',
|
|
|
|
line: 40,
|
2020-05-14 20:27:43 +00:00
|
|
|
message: "Another small warning because you didn't the right thing",
|
2020-04-26 20:33:39 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'error',
|
|
|
|
line: 3212,
|
|
|
|
message:
|
|
|
|
'This is a really, really, really, long error message and I hope it makes sense ' +
|
2020-05-14 20:27:43 +00:00
|
|
|
"because it's just made up of random thoughts and things. But, don't let that fool you " +
|
|
|
|
"it's really important and you should fix it as soon as possible!",
|
2020-04-26 20:33:39 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const _default = () => (
|
|
|
|
<NoticeTable
|
|
|
|
notices={notices}
|
|
|
|
onClick={n => window.alert(n.message)}
|
|
|
|
onVisibilityToggle={v => console.log('Visible?', v)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export const manyItems = () => {
|
|
|
|
const notices = [];
|
|
|
|
for (let i = 0; i < 100; i++) {
|
|
|
|
notices.push({ type: 'error', line: i, message: 'This is message ' + i });
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<NoticeTable
|
|
|
|
notices={notices}
|
|
|
|
onClick={n => window.alert(n.message)}
|
|
|
|
onVisibilityToggle={v => console.log('Visible?', v)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|