Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add theme toggle functionality with dark and light mode support #1555

Merged
merged 2 commits into from
Dec 29, 2024

Conversation

zkfriendly
Copy link

  • Imported ThemeToggle component in AppSidebar
  • Added ThemeToggle to SidebarFooter in AppSidebar
  • Initialized theme based on localStorage and system preferences in main.tsx to support dark and light modes

Relates to:

Risks

Low. This change primarily affects the UI theme settings and should not impact other functionalities.

Background

What does this PR do?

This PR adds a theme toggle functionality to the application, allowing users to switch between dark and light modes. It also initializes the theme based on the user's system preferences and previously saved settings in localStorage.

What kind of change is this?

Features (non-breaking change which adds functionality)

Documentation changes needed?

My changes do not require a change to the project documentation.

Testing

Where should a reviewer start?

Review the changes in client/src/components/app-sidebar.tsx and client/src/main.tsx.

Detailed testing steps

  1. Run the application.
  2. Verify that the theme toggle appears in the sidebar footer.
  3. Test switching between dark and light modes using the theme toggle.
  4. Refresh the page and ensure the selected theme persists.
  5. Change the system theme and verify the application updates accordingly when set to "system" mode.

- Imported ThemeToggle component in AppSidebar
- Added ThemeToggle to SidebarFooter in AppSidebar
- Initialized theme based on localStorage and system preferences in main.tsx to support dark and light modes
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zkfriendly! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

@zkfriendly zkfriendly changed the base branch from main to develop December 29, 2024 05:56
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for doing this!

@monilpat monilpat merged commit b386b26 into elizaOS:develop Dec 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants