Skip to content

Commit 05152df

Browse files
authored
feat: created theme provider and remove next.app.mjs (nodejs#5469)
1 parent aa48cf5 commit 05152df

File tree

8 files changed

+116
-535
lines changed

8 files changed

+116
-535
lines changed

.storybook/main.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import type { StorybookConfig } from '@storybook/nextjs';
22

33
const config: StorybookConfig = {
4-
stories: ['../components/**/*.stories.@(ts|tsx)'],
4+
stories: ['../components/**/*.stories.tsx'],
55
addons: ['@storybook/addon-controls', '@storybook/addon-interactions'],
6-
framework: {
7-
name: '@storybook/nextjs',
8-
options: {},
9-
},
10-
features: {
11-
storyStoreV7: true,
12-
},
13-
docs: {
14-
autodocs: 'tag',
15-
},
6+
framework: { name: '@storybook/nextjs', options: {} },
7+
features: { storyStoreV7: true },
8+
docs: { autodocs: 'tag' },
169
staticDirs: ['../public'],
10+
core: { disableTelemetry: true },
1711
};
1812

1913
export default config;

.storybook/preview.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import type { Preview } from '@storybook/react';
21
import NextImage from 'next/image';
2+
import { SiteProvider } from '../providers/siteProvider';
3+
import { ThemeProvider } from '../providers/themeProvider';
4+
import { LocaleProvider } from '../providers/localeProvider';
35
import { openSans } from '../util/nextFonts';
4-
import BaseApp, { setAppFonts } from '../next.app';
6+
import type { Preview } from '@storybook/react';
57

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

@@ -23,15 +25,17 @@ const preview: Preview = {
2325
},
2426
};
2527

26-
setAppFonts([openSans.style.fontFamily]);
27-
2828
export const decorators = [
2929
Story => (
30-
<BaseApp>
31-
<div data-test-id="story-root">
32-
<Story />
33-
</div>
34-
</BaseApp>
30+
<SiteProvider>
31+
<LocaleProvider>
32+
<ThemeProvider font={openSans.style.fontFamily}>
33+
<div data-test-id="story-root">
34+
<Story />
35+
</div>
36+
</ThemeProvider>
37+
</LocaleProvider>
38+
</SiteProvider>
3539
),
3640
];
3741

next.app.tsx

Lines changed: 0 additions & 48 deletions
This file was deleted.

next.config.mjs

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

0 commit comments

Comments
 (0)