Skip to content

Commit

Permalink
feat: created theme provider and remove next.app.mjs (#5469)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Jul 4, 2023
1 parent aa48cf5 commit 05152df
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 535 deletions.
16 changes: 5 additions & 11 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../components/**/*.stories.@(ts|tsx)'],
stories: ['../components/**/*.stories.tsx'],
addons: ['@storybook/addon-controls', '@storybook/addon-interactions'],
framework: {
name: '@storybook/nextjs',
options: {},
},
features: {
storyStoreV7: true,
},
docs: {
autodocs: 'tag',
},
framework: { name: '@storybook/nextjs', options: {} },
features: { storyStoreV7: true },
docs: { autodocs: 'tag' },
staticDirs: ['../public'],
core: { disableTelemetry: true },
};

export default config;
22 changes: 13 additions & 9 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Preview } from '@storybook/react';
import NextImage from 'next/image';
import { SiteProvider } from '../providers/siteProvider';
import { ThemeProvider } from '../providers/themeProvider';
import { LocaleProvider } from '../providers/localeProvider';
import { openSans } from '../util/nextFonts';
import BaseApp, { setAppFonts } from '../next.app';
import type { Preview } from '@storybook/react';

import '../styles/index.scss';

Expand All @@ -23,15 +25,17 @@ const preview: Preview = {
},
};

setAppFonts([openSans.style.fontFamily]);

export const decorators = [
Story => (
<BaseApp>
<div data-test-id="story-root">
<Story />
</div>
</BaseApp>
<SiteProvider>
<LocaleProvider>
<ThemeProvider font={openSans.style.fontFamily}>
<div data-test-id="story-root">
<Story />
</div>
</ThemeProvider>
</LocaleProvider>
</SiteProvider>
),
];

Expand Down
48 changes: 0 additions & 48 deletions next.app.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ const nextConfig = {
// We disable the support for legacy browsers which should reduce the polyiffing
// and the overall bundle size for the Node.js Website client runtime
legacyBrowsers: false,
// We want all Next.js scripts to be registered as Service Workers, which
// reduces the JavaScript load time on cache hits (this uses Workbox)
// @see https://developer.chrome.com/docs/workbox/
nextScriptWorkers: true,
// This feature reduces the Next.js memory consumption by compartimentalising
// the Webpack builds into smaller threads that are responsible for building
// smaller pieces of the website instead of all pages at onces
Expand Down
Loading

2 comments on commit 05152df

@vercel
Copy link

@vercel vercel bot commented on 05152df Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nodejs-org-stories – ./

nodejs-org-stories-git-main-openjs.vercel.app
nodejs-org-storybook.vercel.app
nodejs-org-stories-openjs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 05152df Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.