Skip to content

[Frontend] Implement the themeStore #141

Description

@Muhammadcodes112

Description

Light/dark mode preference, persisted across sessions.

Where

astre_frontend/src/store/themeStore.ts (new file)

What to implement

A Zustand store with state { theme: 'light' | 'dark' } and an action toggleTheme(). On every change, also write theme to localStorage under key 'astre-theme' and toggle the dark class on document.documentElement.

Acceptance Criteria

  • toggleTheme() flips between 'light' and 'dark'
  • document.documentElement gets/loses the dark class correctly
  • localStorage.getItem('astre-theme') reflects the current value after a toggle
  • npm run typecheck passes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendNext.js app (astre_frontend)good first issueGood for newcomersphase-1Core donation-loop MVP (1/3 scope), builds on mvp-phase-1 branch

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions