Skip to content

Commit

Permalink
fix: type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Oct 18, 2023
1 parent a9b1854 commit 116acbf
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions apps/web/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ let localAndUrlStore = (set, get) => ({
state.colorPalettes.gray = grayPalette;
}),
);
const { colorPalettes } = get();
updateCSSVariables({
primary: type === "primary" ? newPalette : colorPalettes.primary,
secondary: type === "secondary" ? newPalette : colorPalettes.secondary,
accent: type === "accent" ? newPalette : colorPalettes.accent,
gray: grayPalette,
});
const { colorPalettes, baseColors } = get();
updateCSSVariables(
{
primary: type === "primary" ? newPalette : colorPalettes.primary,
secondary: type === "secondary" ? newPalette : colorPalettes.secondary,
accent: type === "accent" ? newPalette : colorPalettes.accent,
gray: grayPalette,
},
baseColors,
);
},
generatePalette: (existing = false) => {
const newBaseColors = existing ? get().baseColors : generateBaseColors();
Expand Down Expand Up @@ -95,12 +98,16 @@ let localAndUrlStore = (set, get) => ({
};
}),
);
updateCSSVariables({
primary: primaryPalette,
secondary: secondaryPalette,
accent: accentPalette,
gray: grayPalette,
});
const { baseColors } = get();
updateCSSVariables(
{
primary: primaryPalette,
secondary: secondaryPalette,
accent: accentPalette,
gray: grayPalette,
},
baseColors,
);
},
});

Expand Down

0 comments on commit 116acbf

Please sign in to comment.