firecms icon indicating copy to clipboard operation
firecms copied to clipboard

Light and dark theme changes are broken when using a custom app

Open SeeringPhil opened this issue 2 years ago • 1 comments

Will try to create a repro repo eventually but basically self explanatory:

When using the custom components and utilities, and not simply FirebaseCMSApp alone, clicking on the theme change button only changes the background of the scrollbars and not the rest of the application... until a page refresh!

So basically, if the user clicks on the button they need to refresh the page for the theme toggle to complete properly.

SeeringPhil avatar Apr 17 '23 16:04 SeeringPhil

The issue is here:

https://github.com/firecmsco/firecms/blob/029f3f641be99d6241a4ad827190e8a4ccea5cbe/example/src/docs/CustomCMSApp.tsx#L104

The hook needs to depend on the theme mode to reload.

Can be fixed as such:

  const theme = useMemo(
    () => createCMSDefaultTheme({ mode: modeController.mode }),
    [modeController.mode]
  );

OskarGroth avatar Nov 08 '23 14:11 OskarGroth

This was fixed in the latest version. Thanks!

fgatti675 avatar Mar 14 '24 00:03 fgatti675