Skip to content

Commit

Permalink
chore: intl on stories
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 3, 2023
1 parent 0af82d6 commit 3b157ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { NotificationProvider } from '../providers/notificationProvider';
import * as constants from './constants';
import type { Preview, ReactRenderer } from '@storybook/react';

import englishLocale from '@/i18n/locales/en.json' assert { type: 'json' };

import '../styles/new/index.css';

const rootClasses = classNames(
Expand All @@ -27,7 +29,7 @@ const preview: Preview = {
// and all the App's Providers (Site, Theme, Locale)
decorators: [
Story => (
<NextIntlClientProvider locale="en">
<NextIntlClientProvider locale="en" messages={englishLocale}>
<NotificationProvider viewportClassName="absolute top-0 left-0 list-none">
<div className={rootClasses}>
<Story />
Expand Down
4 changes: 1 addition & 3 deletions components/__mocks__/next-intl.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Link from 'next/link';
import { redirect, usePathname, useRouter } from 'next/navigation';

import englishLocale from '../../i18n/locales/en.json' assert { type: 'json' };

export const useMessages = () => englishLocale;
export const useMessages = () => ({});

export const useNow = () => new Date();

Expand Down

0 comments on commit 3b157ce

Please sign in to comment.