Skip to content

Commit

Permalink
make branddetails optional
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCa96 committed Nov 7, 2024
1 parent 0c16c24 commit 5468797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/storybook-utils/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const createPreview = <T extends Preview = Preview>(
overrides?: T,
) => {
const themes = {
light: createTheme(brandDetails),
dark: createTheme(brandDetails, "dark"),
light: createTheme("light", brandDetails),
dark: createTheme("dark", brandDetails),
} as const;

const defaultPreview = {
Expand Down
8 changes: 4 additions & 4 deletions packages/storybook-utils/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export const getCustomProperty = (property: string, el: Element = document.body)
*
* @see https://storybook.js.org/docs/react/configure/theming#create-a-theme-quickstart
*/
export const createTheme = (brandDetails: BrandDetails, base: "light" | "dark" = "light") => {
export const createTheme = (base: "light" | "dark" = "light", brandDetails?: BrandDetails) => {
const primaryColor = getCustomProperty("--onyx-color-themed-primary-500");

return create({
brandTitle: brandDetails.brandTitle,
brandUrl: brandDetails.brandUrl,
brandImage: brandDetails.brandImage,
brandTitle: brandDetails?.brandTitle,
brandUrl: brandDetails?.brandUrl,
brandImage: brandDetails?.brandImage,
brandTarget: "_blank",
base,

Expand Down

0 comments on commit 5468797

Please sign in to comment.