Closed Prashant-2024 closed 6 months ago
@Prashant-2024 is attempting to deploy a commit to the Abhijeet's projects Team on Vercel.
A member of the Team first needs to authorize it.
Hey @Prashant-2024, there are couple of issue in this PR:
Try to understand the project first before contributing so that you can easily understand.
You can implement using next-themes like this:
"use client";
import { useTheme } from "next-themes";
export default function ThemeToggle() {
const { systemTheme, theme, setTheme } = useTheme();
const currentTheme = theme === "system" ? systemTheme : theme;
const toggleTheme = () => {
const newTheme = currentTheme === "dark" ? "light" : "dark";
setTheme(newTheme);
};
return (
<button
onClick={toggleTheme}
className="p-2 bg-gray-200 dark:bg-gray-800 rounded"
>
{theme === "light" ? "🌞" : "🌜"}
</button>
);
}
See this is easy to implement, that's why i am saying first understand the project. Currently we can implement using this later it can be done using state management library.
I'm sorry for causing this inconvenience, I missed the part where I had to implement it with typescript, it's still new to me and am currently learning it. I did understood the feature and that's why asked to assign it to me. The delay was caused because I had exams in between. I will the correct the implementation ASAP, and share it with you.
No problem @Prashant-2024, open source and gssoc is for learning.
Hey @Prashant-2024, are you done with the changes?
Yes, I am close to it. I will share them by today evening. I know i have taken long time and causing delay, for this changes. I am currently travelling and don't have access to laptop. I will share them ASAP
Below are the changes:
Dark Mode:
Light Mode:
@abhijeetnishal Request to look into it and let me know
Issue No. #54 Toggle Button added for Light and Dark mode of application.