From b0c3fb56153078d56001d243e20abf095c24d55f Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Mon, 17 Feb 2025 11:16:50 +0100 Subject: [PATCH] set default values in stories --- src/components/navigation/GlobalAppBar/GlobalAppBar.tsx | 5 +---- src/stories/navigation/ContentPage.tsx | 6 ++++-- src/stories/navigation/Help/Help.stories.jsx | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/navigation/GlobalAppBar/GlobalAppBar.tsx b/src/components/navigation/GlobalAppBar/GlobalAppBar.tsx index 364534a2..806a905d 100644 --- a/src/components/navigation/GlobalAppBar/GlobalAppBar.tsx +++ b/src/components/navigation/GlobalAppBar/GlobalAppBar.tsx @@ -15,7 +15,6 @@ export interface GlobalAppBarProps { defaultActionButton: ReactNode; defaultIconMenuButton: ReactNode; defaultHelpButton: ReactNode; - defaultTitle: string; defaultOpen: boolean; menuItems: ReactNode[]; widthOpen: string; @@ -49,7 +48,6 @@ export const GlobalAppBar = styled( defaultActionButton, defaultIconMenuButton, defaultHelpButton, - defaultTitle, defaultOpen, menuItems, widthOpen, @@ -80,8 +78,7 @@ export const GlobalAppBar = styled( defaultHomeButton, defaultActionButton, defaultIconMenuButton, - defaultHelpButton, - defaultTitle + defaultHelpButton }} /> <Toolbar className="CeuiGlobalAppBar-Spacer" /> diff --git a/src/stories/navigation/ContentPage.tsx b/src/stories/navigation/ContentPage.tsx index accf5982..cfed610d 100644 --- a/src/stories/navigation/ContentPage.tsx +++ b/src/stories/navigation/ContentPage.tsx @@ -15,11 +15,13 @@ export const ContentPage = ({ const { updatePageTitle, setEnvironment } = useGlobalAppContext(); useEffect(() => { - updatePageTitle(title); + updatePageTitle(title || "This is an example title"); }, [title, updatePageTitle]); useEffect(() => { - setEnvironment(environment); + if (environment) { + setEnvironment(environment); + } }, [environment, setEnvironment]); return children; diff --git a/src/stories/navigation/Help/Help.stories.jsx b/src/stories/navigation/Help/Help.stories.jsx index 270bfba6..e128f6b9 100644 --- a/src/stories/navigation/Help/Help.stories.jsx +++ b/src/stories/navigation/Help/Help.stories.jsx @@ -32,7 +32,7 @@ const HelpContainer = (args) => { menuItems={menuItems} > <Paper sx={{ padding: 2 }}> - <ContentPage> + <ContentPage title="Help"> <Help {...args} /> </ContentPage> </Paper> -- GitLab