这是indexloc提供的服务,不要输入任何密码
Skip to content

Store Dark/Light Mode Preference in Firestore #401

@DennisAlund

Description

@DennisAlund

Description:

Enhance the application to store the user's dark/light mode preference in the Firestore tanam-users/{uid} document. Ensure the CMS displays the user's preferred theme based on this setting.

Objectives:

  1. Store Dark/Light Mode Preference:

    • Add a boolean attribute darkMode to the Tanam user document in Firestore (tanam-users/{uid}) to store the user's theme preference.
    • Update the theme toggle functionality to save the user's preference to the darkMode attribute in Firestore whenever it is changed.
  2. Display User's Preference in CMS:

    • On user login, fetch the darkMode attribute from the Firestore tanam-users/{uid} document.
    • Apply the theme based on the fetched darkMode value, ensuring the CMS displays the user's preferred theme.

Acceptance Criteria:

  • The darkMode attribute is added to the tanam-users/{uid} document in Firestore.
  • The theme toggle functionality updates the darkMode attribute in Firestore when the user changes their theme preference.
  • On user login, the CMS fetches the darkMode attribute and applies the user's preferred theme.
  • The theme is displayed correctly according to the user's preference.

Notes:

  • Ensure that the theme setting is updated in real-time and persists across user sessions.
  • Implement robust error handling to manage cases where the Firestore document may not be accessible.
  • Test the functionality to confirm that the theme preference is stored and displayed correctly.
  • Update any relevant documentation to reflect these changes.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions