firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.14k stars 185 forks source link

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

Closed SeeringPhil closed 6 months ago

SeeringPhil commented 1 year ago

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.

OskarGroth commented 10 months ago

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]
  );
fgatti675 commented 6 months ago

This was fixed in the latest version. Thanks!