Skip to content

Conversation

@priyanshu6386
Copy link

Summary

This PR introduces a Dark/Light theme toggle to the existing ReactPlay project using Tailwind CSS with darkMode: 'class'.

✅ Changes Made:

  • Implemented dark/light mode toggle button inside NavBar component
  • Created useDarkMode custom hook to manage theme preferences using localStorage
  • Updated index.jsx to wrap the app in a div that toggles the dark class
  • Applied Tailwind dark utility classes for theming
  • Updated README.md to document the new dark/light theme feature and usage

🔍 Preview

The UI now supports toggling between dark and light modes, enhancing accessibility and user experience.

Let me know if any improvements or changes are needed!

@netlify
Copy link

netlify bot commented Jul 21, 2025

Deploy Preview for reactplayio failed. Why did it fail? →

Name Link
🔨 Latest commit 324c267
🔍 Latest deploy log https://app.netlify.com/projects/reactplayio/deploys/687e3961f1a4b000083f48b5

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.

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

@priyanshu6386 priyanshu6386 removed their assignment Jul 21, 2025
Copy link
Member

@priyankarpal priyankarpal left a comment

Choose a reason for hiding this comment

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

another thing is
import error: 'SearchContext' is not exported from 'common/search/search-context' (imported as 'SearchContext').

Comment on lines +398 to +428

---

## 🌗 Dark/Light Theme Toggle

We’ve added a dark/light theme toggle to enhance user experience.

### 🔧 How It Works

- A toggle button (☀️/🌙) is available in the **NavBar**.
- Clicking it switches between **light** and **dark** mode.
- Theme preference is saved in `localStorage` so it persists across sessions.
- Tailwind CSS uses `darkMode: 'class'` (configured in `tailwind.config.js`).
- A custom `useDarkMode` hook manages toggling logic and class updates.

### 📂 Files Modified

- `src/common/NavBar.jsx` → Added toggle button
- `src/hooks/useDarkMode.js` → Custom hook for managing theme
- `src/index.jsx` → Ensures correct theme on initial load
- `tailwind.config.js` → Enabled `darkMode: 'class'`

### 📸 Preview

| Light Mode ☀️ | Dark Mode 🌙 |
|---------------|--------------|
| ![Light](https://dummyimage.com/300x150/ffffff/000000&text=Light+Mode) | ![Dark](https://dummyimage.com/300x150/000000/ffffff&text=Dark+Mode) |

---


Copy link
Member

Choose a reason for hiding this comment

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

these are not required, you can remove.

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