Added configuration for font-loading

This commit is contained in:
gitstart-omnivore
2022-04-19 09:37:01 +00:00
parent 5fad4002e3
commit 643f57f122
3 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,5 @@
const path = require('path')
module.exports = {
stories: [
"../stories/**/*.stories.mdx",
@ -15,5 +17,14 @@ module.exports = {
},
typescript: {
reactDocgen: false
}
},
webpackFinal: async (config, { configType }) => {
config.resolve.roots = [
path.resolve(__dirname, '../public'),
'node_modules',
];
// Return the altered config
return config;
},
}

View File

@ -1,5 +1,7 @@
import { RouterContext } from 'next/dist/shared/lib/router-context';
import * as NextImage from 'next/image';
import { getCssText } from '../components/tokens/stitches.config';
import "../styles/globals.css";
const OriginalNextImage = NextImage.default;
@ -20,3 +22,21 @@ export const parameters = {
Provider: RouterContext.Provider
}
}
export const decorators = [
(Story, context) => {
return (
<>
<style
id="stitches"
dangerouslySetInnerHTML={{
__html: getCssText(),
}}
/>
<div className='Gray'>
<Story {...context} />
</div>
</>
);
}
]

View File

@ -1,6 +1,7 @@
import { ComponentStory, ComponentMeta } from '@storybook/react'
import { Toaster, ToastPosition } from 'react-hot-toast'
import { showErrorToast, showSuccessToast } from '../lib/toastHelpers'
import { Button } from '../components/elements/Button'
export default {
title: 'Components/Snackbar',
@ -32,7 +33,9 @@ const Template = ({ showToast, position }: { showToast: () => void; position?: T
justifyContent: 'center',
}}
>
<button onClick={showToast}>Show Toast</button>
<Button style='ctaGray' onClick={showToast}>
Show Toast
</Button>
</div>
</div>
)