Skip to content

Commit

Permalink
more diff reduction
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Gilgur <[email protected]>
  • Loading branch information
Anton Gilgur committed Aug 22, 2024
1 parent 166bc0a commit c93f6d0
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 64 deletions.
4 changes: 2 additions & 2 deletions stories/dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Menu = () => {
</ul>
</DropDown>
);
};
}
Menu.storyName = 'menu';

export const MenuWrapper = () => {
Expand All @@ -29,5 +29,5 @@ export const MenuWrapper = () => {
action: () => window.alert('Clicked!'),
}]} />
);
};
}
MenuWrapper.storyName = 'menu wrapper';
2 changes: 1 addition & 1 deletion stories/forms.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export const Default = () => {
)}
</Form>
);
};
}
Default.storyName = 'default';
32 changes: 17 additions & 15 deletions stories/notifications.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@ export default {
title: 'Notifications',
};

export const Default = () => (
<App>
{(apis) => [
{type: NotificationType.Success, title: 'Success'},
{type: NotificationType.Warning, title: 'Warning'},
{type: NotificationType.Error, title: 'Error'},
].map((item) => (
<button key={item.type} className='argo-button argo-button--base' onClick={() =>
apis.notifications.show({type: item.type, content: <div>{getMessage()}</div>})
}>
{item.title}
</button>
))}
</App>
);
export const Default = () => {
return (
<App>
{(apis) => [
{type: NotificationType.Success, title: 'Success'},
{type: NotificationType.Warning, title: 'Warning'},
{type: NotificationType.Error, title: 'Error'},
].map((item) => (
<button key={item.type} className='argo-button argo-button--base' onClick={() =>
apis.notifications.show({type: item.type, content: <div>{getMessage()}</div>})
}>
{item.title}
</button>
))}
</App>
);
}
Default.storyName = 'default';
98 changes: 52 additions & 46 deletions stories/page.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,23 @@ export const Default = () => {
};
Default.storyName = 'default';

export const DynamicToolbar = () => (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems}>
<Page title='Hello world!' toolbar={timer(0, 1000).pipe(map(() => ({breadcrumbs: [
{ title: 'hello ' + new Date().toLocaleTimeString() },
]})))}>
<div style={{ padding: '1em' }}>
<div className='white-box'>Hello world!</div>
</div>
</Page>
</Layout>
</Route>
</Router>
);
export const DynamicToolbar = () => {
return (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems}>
<Page title='Hello world!' toolbar={timer(0, 1000).pipe(map(() => ({breadcrumbs: [
{ title: 'hello ' + new Date().toLocaleTimeString() },
]})))}>
<div style={{ padding: '1em' }}>
<div className='white-box'>Hello world!</div>
</div>
</Page>
</Layout>
</Route>
</Router>
);
}
DynamicToolbar.storyName = 'dynamic toolbar';

export const CompactNavBar = () => {
Expand All @@ -140,39 +142,43 @@ export const CompactNavBar = () => {
};
CompactNavBar.storyName = 'compact nav bar';

export const CustomTopBarTitle = () => (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems}>
<Page title='helmet title' topBarTitle='Top Bar Title' toolbar={{breadcrumbs: [
{ title: 'Apps ', path: '/applications' },
{ title: 'app name' },
]}}>
<div style={{ padding: '1em' }}>
<div className='white-box'>
Test
export const CustomTopBarTitle = () => {
return (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems}>
<Page title='helmet title' topBarTitle='Top Bar Title' toolbar={{breadcrumbs: [
{ title: 'Apps ', path: '/applications' },
{ title: 'app name' },
]}}>
<div style={{ padding: '1em' }}>
<div className='white-box'>
Test
</div>
</div>
</div>
</Page>
</Layout>
</Route>
</Router>
);
</Page>
</Layout>
</Route>
</Router>
);
}
CustomTopBarTitle.storyName = 'custom top bar title';

export const BackgroundColor = () => (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems} navBarStyle={{ backgroundColor: 'red' }}>
<Page title='Hello world!'>
<div style={{ padding: '1em' }}>
<div className='white-box'>
Hello world!
export const BackgroundColor = () => {
return (
<Router history={history}>
<Route path={location.pathname}>
<Layout navItems={navItems} navBarStyle={{ backgroundColor: 'red' }}>
<Page title='Hello world!'>
<div style={{ padding: '1em' }}>
<div className='white-box'>
Hello world!
</div>
</div>
</div>
</Page>
</Layout>
</Route>
</Router>
);
</Page>
</Layout>
</Route>
</Router>
);
}
BackgroundColor.storyName = 'background color';

0 comments on commit c93f6d0

Please sign in to comment.