Skip to content

Commit

Permalink
Merge pull request #37 from oslabs-beta/storybook
Browse files Browse the repository at this point in the history
Install Storybook and write first story
  • Loading branch information
scotthallock committed Jun 27, 2023
2 parents b8577d8 + 32976e7 commit 9195d08
Show file tree
Hide file tree
Showing 6 changed files with 22,468 additions and 4,992 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
ui/build
storybook-static
17 changes: 17 additions & 0 deletions ui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { StorybookConfig } from '@storybook/react-vite';
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
};
export default config;
25 changes: 25 additions & 0 deletions ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import type { Preview } from '@storybook/react';
import { HashRouter } from 'react-router-dom';
import CssBaseline from '@mui/material/CssBaseline';
import { DockerMuiThemeProvider } from '@docker/docker-mui-theme';

const preview: Preview = {
// Add global decorators to each story.
// DockerMuiThemeProvider and CssBaseline providing styling.
// HashRouter is neccessary for the <Link /> components in <NavBar /> to work
decorators: [
(Story) => {
return (
<DockerMuiThemeProvider>
<CssBaseline />
<HashRouter>
<Story />
</HashRouter>
</DockerMuiThemeProvider>
);
},
],
};

export default preview;

0 comments on commit 9195d08

Please sign in to comment.