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]: Added the dark/light theme #56

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mohit-bhandari45
Copy link

Fixes #43

Description:-
So as I suggested, a dark/light mode feature. I have completed that. I have made a dark and light theme toggling.
Interestingly the local instance of your last time will also be saved and according to that, the theme will be changed.
I have followed the code and done no harm to the code.

Screenshots:-
image
image
image
image
image

Review this PR and label it accordingly.

Copy link

vercel bot commented Jun 4, 2024

@mohit-bhandari45 is attempting to deploy a commit to the snipsavvy's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sahilrohera10
Copy link
Collaborator

@mohit-bhandari45 what abt internal tool for dark/light theme functionality ?

@mohit-bhandari45
Copy link
Author

@mohit-bhandari45 what abt internal tool for dark/light theme functionality ?

Means?

src/app/page.tsx Outdated
Comment on lines 1 to 2
"use client"
import { Button } from "@/components/LandingPage/Button";
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can not make the page.tsx as a client component, as next js says it is a server side and should kept as server side only.

Copy link
Author

Choose a reason for hiding this comment

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

This can be resloved!

Copy link
Author

Choose a reason for hiding this comment

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

we can not make the page.tsx as a client component, as next js says it is a server side and should kept as server side only.

Actually I am using usestate and useeffect hooks in this file. So it need to be a client component as server components doesn't allow it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yaa, so in that case u should consider creating an another client component, and then should use here!

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, it can be done but need to shift all the content of page.tsx to a separate page as different components are using the theme. There should be only on componentin page.tsx like this:-
image

Will it create problem for you?

src/app/page.tsx Outdated
Comment on lines 76 to 78
</section>
<section className="w-full py-12 md:py-20 lg:pt-32 pb-24 bg-[#0E0E11] px-32">
<section className={`${theme === "true" ? "bg-[#0E0E11] text-gray-50" : "bg-[#ffffff] text-black"} w-full py-12 md:py-20 lg:pt-32 pb-24 px-32`}>
<div className="container grid items-center justify-center gap-4 px-4 text-center md:px-6 lg:gap-10">
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of having this check in all the classes, can't we have a better way of doing this?

Copy link
Author

@mohit-bhandari45 mohit-bhandari45 Jun 4, 2024

Choose a reason for hiding this comment

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

I think, we have to make check in main divs, so that the classes adjust according to theme.

@sahilrohera10
Copy link
Collaborator

sahilrohera10 commented Jun 4, 2024

@mohit-bhandari45 we have an internal tool .. after login into the platform !
in the issue also, i had stated that!

@cb7chaitanya
Copy link
Collaborator

cb7chaitanya commented Jun 4, 2024

Hello @mohit-bhandari45 have some feedback for you regarding this PR, can you hmu at discord @chaitanya, you will find me in the project channel

@mohit-bhandari45
Copy link
Author

Hello @mohit-bhandari45 have some feedback for you regarding this PR, can you hmu at discord @chaitanya, you will find me in the project channel

bro this is my linkedin
https://www.linkedin.com/in/mohit-bhandari-9940542a0/

@cb7chaitanya
Copy link
Collaborator

Are you on discord? Message me there, trying to keep all project related stuff to discord, thanks

@mohit-bhandari45
Copy link
Author

Are you on discord? Message me there, trying to keep all project related stuff to discord, thanks

You are not accepting requests

@mohit-bhandari45
Copy link
Author

this is mine :- mohit_bhandari_81404

@cb7chaitanya
Copy link
Collaborator

Messaged you, check inbox

@mohit-bhandari45
Copy link
Author

mohit-bhandari45 commented Jun 5, 2024

@cb7chaitanya @sahilrohera10
Hey, I have made several changes regarding this.
Made a ThemeProvider for the whole app

@yash-25log
Copy link
Collaborator

@mohit-bhandari45 Just add a short clip showing your changes , just to ensure everything works fine

@mohit-bhandari45
Copy link
Author

@mohit-bhandari45 Just add a short clip showing your changes , just to ensure everything works fine

Hey really sorry for the late reply.
Here is the demo video:-

prev27.mp4

@mohit-bhandari45
Copy link
Author

@cb7chaitanya @sahilrohera10 @yash-25log do check the demo video and review it.

@mohit-bhandari45
Copy link
Author

mohit-bhandari45 commented Jun 8, 2024

@cb7chaitanya @yash-25log @sahilrohera10 kindly please review this pr and update me
Also add ssoc24 and appropriate labels to this pr.

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.

Dark/ light mode
4 participants