-
Notifications
You must be signed in to change notification settings - Fork 58
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
Toggle Button for Light/Dark added #108
Toggle Button for Light/Dark added #108
Conversation
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, @Prashant-2024! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our contributing guidelines
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. |
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. |
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. |
feat: Add social media sharing options
Below are the changes: Dark Mode: Light Mode: @abhijeetnishal Request to look into it and let me know |
// // components/ThemeToggle.tsx | ||
// "use client"; | ||
// import { useTheme } from "next-themes"; | ||
// import { useEffect, useState } from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have approved this PR but i have added comments don't repeat this for other projects.
1e43e7c
into
abhijeetnishal:development
Issue No. #54
Toggle Button added for Light and Dark mode of application.