-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-catalog: ChartsList.stories: Fix stories for List
Signed-off-by: Vincent T <[email protected]>
- Loading branch information
Showing
10 changed files
with
306 additions
and
253 deletions.
There are no files selected for viewing
36 changes: 21 additions & 15 deletions
36
app-catalog/src/components/charts/AppCatalogTitle.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import { AppCatalogTitle } from './AppCatalogTitle'; | ||
|
||
export default { | ||
title: 'Components/AppCatalogTitle', | ||
component: AppCatalogTitle, | ||
decorators: [(Story) => <Router><Story /></Router>], | ||
} as Meta; | ||
|
||
const Template: Story = (args) => <AppCatalogTitle {...args} />; | ||
|
||
export const Title = Template.bind({}); | ||
Title.args = {}; | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import { AppCatalogTitle } from './AppCatalogTitle'; | ||
|
||
export default { | ||
title: 'Components/AppCatalogTitle', | ||
component: AppCatalogTitle, | ||
decorators: [ | ||
Story => ( | ||
<Router> | ||
<Story /> | ||
</Router> | ||
), | ||
], | ||
} as Meta; | ||
|
||
const Template: Story = args => <AppCatalogTitle {...args} />; | ||
|
||
export const Title = Template.bind({}); | ||
Title.args = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import { | ||
Box, | ||
Typography, | ||
} from '@mui/material'; | ||
import { SettingsLink } from './SettingsLink'; | ||
|
||
|
||
|
||
export function AppCatalogTitle() { | ||
return ( | ||
<Box display="flex" justifyContent="space-between" alignItems="center"> | ||
<Typography | ||
sx={{ | ||
fontSize: '2rem', | ||
}} | ||
> | ||
Applications | ||
</Typography> | ||
<SettingsLink /> | ||
</Box> | ||
); | ||
} | ||
import { Box, Typography } from '@mui/material'; | ||
import { SettingsLink } from './SettingsLink'; | ||
|
||
export function AppCatalogTitle() { | ||
return ( | ||
<Box display="flex" justifyContent="space-between" alignItems="center"> | ||
<Typography | ||
sx={{ | ||
fontSize: '2rem', | ||
}} | ||
> | ||
Applications | ||
</Typography> | ||
<SettingsLink /> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 21 additions & 16 deletions
37
app-catalog/src/components/charts/SettingsLink.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import { SettingsLink } from './SettingsLink'; | ||
|
||
|
||
export default { | ||
title: 'Components/SettingsLink', | ||
component: SettingsLink, | ||
decorators: [(Story) => <Router><Story /></Router>], | ||
} as Meta; | ||
|
||
const Template: Story = (args) => <SettingsLink {...args} />; | ||
|
||
export const Title = Template.bind({}); | ||
Title.args = {}; | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import { SettingsLink } from './SettingsLink'; | ||
|
||
export default { | ||
title: 'Components/SettingsLink', | ||
component: SettingsLink, | ||
decorators: [ | ||
Story => ( | ||
<Router> | ||
<Story /> | ||
</Router> | ||
), | ||
], | ||
} as Meta; | ||
|
||
const Template: Story = args => <SettingsLink {...args} />; | ||
|
||
export const Title = Template.bind({}); | ||
Title.args = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
import { Link as RouterLink } from '@kinvolk/headlamp-plugin/lib/CommonComponents'; | ||
import { | ||
Typography, | ||
useTheme, | ||
} from '@mui/material'; | ||
|
||
|
||
|
||
export function SettingsLink() { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<RouterLink routeName="/settings/plugins/app-catalog" tooltip="App-Catalog Settings"> | ||
<Typography | ||
sx={{ | ||
size: '1rem', | ||
marginLeft: '3rem', | ||
color: theme.palette.text.primary, | ||
}} | ||
> | ||
Settings | ||
</Typography> | ||
</RouterLink> | ||
); | ||
} | ||
import { Link as RouterLink } from '@kinvolk/headlamp-plugin/lib/CommonComponents'; | ||
import { Typography, useTheme } from '@mui/material'; | ||
|
||
export function SettingsLink() { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<RouterLink routeName="/settings/plugins/app-catalog" tooltip="App-Catalog Settings"> | ||
<Typography | ||
sx={{ | ||
size: '1rem', | ||
marginLeft: '3rem', | ||
color: theme.palette.text.primary, | ||
}} | ||
> | ||
Settings | ||
</Typography> | ||
</RouterLink> | ||
); | ||
} |
60 changes: 30 additions & 30 deletions
60
app-catalog/src/components/settings/AppCatalogSettings.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import { createTheme, ThemeProvider } from '@mui/material/styles'; | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { AppCatalogSettings, AppCatalogSettingsProps } from './AppCatalogSettings'; | ||
|
||
export default { | ||
title: 'Components/AppCatalogSettings', | ||
component: AppCatalogSettings, | ||
} as Meta | ||
|
||
const theme = createTheme(); | ||
|
||
const Template: Story<AppCatalogSettingsProps> = (args) => ( | ||
<ThemeProvider theme={theme}> | ||
<AppCatalogSettings {...args} /> | ||
</ThemeProvider> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
|
||
export const ShowOnlyVerifiedTrue = Template.bind({}); | ||
ShowOnlyVerifiedTrue.args = { | ||
initialConfig: { showOnlyVerified: true }, | ||
}; | ||
|
||
export const ShowOnlyVerifiedFalse = Template.bind({}); | ||
ShowOnlyVerifiedFalse.args = { | ||
initialConfig: { showOnlyVerified: false }, | ||
}; | ||
import { createTheme, ThemeProvider } from '@mui/material/styles'; | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import { AppCatalogSettings, AppCatalogSettingsProps } from './AppCatalogSettings'; | ||
|
||
export default { | ||
title: 'Components/AppCatalogSettings', | ||
component: AppCatalogSettings, | ||
} as Meta; | ||
|
||
const theme = createTheme(); | ||
|
||
const Template: Story<AppCatalogSettingsProps> = args => ( | ||
<ThemeProvider theme={theme}> | ||
<AppCatalogSettings {...args} /> | ||
</ThemeProvider> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
|
||
export const ShowOnlyVerifiedTrue = Template.bind({}); | ||
ShowOnlyVerifiedTrue.args = { | ||
initialConfig: { showOnlyVerified: true }, | ||
}; | ||
|
||
export const ShowOnlyVerifiedFalse = Template.bind({}); | ||
ShowOnlyVerifiedFalse.args = { | ||
initialConfig: { showOnlyVerified: false }, | ||
}; |
Oops, something went wrong.