From 02b043167be045a8aeb6260e3690ad2ac19d5567 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Thu, 17 Aug 2023 13:06:27 +0300 Subject: [PATCH] Fix: Make storybook work with redux --- src/App.tsx | 8 ++++---- .../DeviceHealthCheck.stories.tsx | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ccba5342..8eb8b977 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,13 +31,13 @@ const router = createBrowserRouter([ function App() { return ( - - + + - - + + ) } diff --git a/src/pages/DeviceHealthCheck/DeviceHealthCheck.stories.tsx b/src/pages/DeviceHealthCheck/DeviceHealthCheck.stories.tsx index 30828e76..c1bb862f 100644 --- a/src/pages/DeviceHealthCheck/DeviceHealthCheck.stories.tsx +++ b/src/pages/DeviceHealthCheck/DeviceHealthCheck.stories.tsx @@ -1,16 +1,26 @@ import type { Meta, StoryObj } from '@storybook/react' +import { Provider as ReduxProvider } from 'react-redux' +import store from '../../redux/store' // Adjust` the path to your store accordingly import DeviceHealthCheck from './DeviceHealthCheck' -const meta = { +const meta: Meta = { title: 'Pages/DeviceHealthCheck', component: DeviceHealthCheck, + decorators: [ + StoryObj => ( + + + + ), + ], tags: ['autodocs'], -} satisfies Meta +} export default meta -type Story = StoryObj -export const Page: Story = { +type DeviceHealthCheckStory = StoryObj + +export const Page: DeviceHealthCheckStory = { args: {}, }