Skip to content

Commit

Permalink
feat: change to storybook 8.2 initialGlobals
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensacks committed Jul 29, 2024
1 parent d2234fb commit 2be301e
Show file tree
Hide file tree
Showing 4 changed files with 3,894 additions and 5,819 deletions.
2 changes: 1 addition & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {Preview} from '@storybook/react';
import nextIntl from './nextIntl';

const preview: Preview = {
globals: {
initialGlobals: {
locale: 'en',
locales: {
en: {icon: '🇺🇸', title: 'English', right: 'EN'},
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Easy next-intl Storybook integration.

Required Peer Dependencies:
* storybook - `^8.0.0`
* storybook - `^8.2.0`
* next-intl - `^3.0.0`

This Storybook addon assumes your project is already set up with [next-intl](https://next-intl-docs.vercel.app/), and that it is properly configured and working.
Expand Down Expand Up @@ -55,7 +55,7 @@ export default nextIntl;
---

### preview.ts
In your `preview.ts`, you need to add the `locales` and `locale` to `initialGlobals` (or `globals` if you're not using the latest version of storybook), as well as adding `nextIntl` that you exported from the above file to parameters.
In your `preview.ts`, you need to add the `locales` and `locale` to `initialGlobals`, as well as adding `nextIntl` that you exported from the above file to parameters.

`locales` is an object where the keys are the "ids" of the locales/languages and the values are the names you want to display in the dropdown.

Expand Down
Loading

0 comments on commit 2be301e

Please sign in to comment.