-
Notifications
You must be signed in to change notification settings - Fork 65
Dark mode #242
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
base: develop
Are you sure you want to change the base?
Dark mode #242
Conversation
|
After changes updated-dark-mode.mp4 |
prakashchoudhary07
left a comment
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.
Wow, this is Great PR 🎉 🎉
|
Made changes to use the cookie as a feature flag dark-mode-update_m07JVukg.mp4 |
rohan09-raj
left a comment
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.
@shubham-y Have you removed the implementation of Icons ??
rohan09-raj
left a comment
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.
Looks good to me , approving the PR
Neha
left a comment
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.
Code review is in WIP
| color: var(--colorWhite); | ||
| border-radius: 5px; | ||
| padding: 10px; | ||
| padding-left: 10px; |
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.
repetitive code. Please remove padding-left
| .submitBtn { | ||
| cursor: pointer; | ||
| background-color: rgb(27, 199, 27); | ||
| color: white; |
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.
Consistency is missing in colour value declarations: either use rgb or name of color of code of color.
Go with RGBA as it is easy to control the alpha value.
| @@ -0,0 +1,48 @@ | |||
| export const lightTheme = { | |||
| colorBackgroundLight: '#f4f4f4', | |||
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.
Light/medium/Dark has same value. Why to make 2 variables for the same value?
| colorExchangeBackground: 'aliceblue', | ||
| colorBodyBackground: '#e9ebff', | ||
| colorText: '#363636', | ||
| colorTransactionBorder: '#f0e2e7', |
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.
From there onwards, variable names are tied with the component. Make generic names for the variables.
| colorButtonBorder: 'white', | ||
| colorFilterHover: '#bdc3c7', | ||
| colorAuctionBackground: 'rgb(245, 235, 235)', | ||
| colorWhite: 'black', |
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.
name is colorWhite but the value is black. Please correct this
| const RDS_LOGO = '/assets/Real-Dev-Squad1x.png'; | ||
| const GITHUB_LOGO = '/assets/github.png'; | ||
| const DEFAULT_AVATAR = '/assets/default_avatar.jpg'; | ||
| const [theme, themeData, themeToggler] = useDarkModeContext(); |
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.
From there themeData is not getting used anywhere
| const NavBar = () => { | ||
| const router = useRouter(); | ||
|
|
||
| const RDS_LOGO = '/assets/Real-Dev-Squad1x.png'; |
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.
Move all the assests URL to constant
|
|
||
| function DarkThemeIcon({ theme, themeToggleHandler }) { | ||
| return ( | ||
| <div |
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.
This should be button and not DIV
| className={classNames.container} | ||
| > | ||
| {theme === 'light' ? ( | ||
| <img src="/assets/moon.png" alt="moon" /> |
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.
this should come from constant also alt tag is wrong.
| {theme === 'light' ? ( | ||
| <img src="/assets/moon.png" alt="moon" /> | ||
| ) : ( | ||
| <img src="/assets/sun.png" alt="sun" /> |
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.
this should come from constant
| } | ||
| setMountedComponent(true); | ||
| }, []); | ||
| return [theme, themeData, themeToggler, mountedComponent]; |
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.
We should return the Object from here. This will help us to destruct values based on keys. Then we can avoid getting all values (even if we don't need them) and we can get them in any order
| :root{ | ||
| ${({ theme }) => { | ||
| let style = ``; | ||
| for (const variableName in theme) { |
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.
The name should property rather then variableName
| @@ -1,9 +1,11 @@ | |||
| import styles from './filter.module.css'; | |||
| import Image from 'next/image'; | |||
| import { useState, useRef } 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.
Always have React import on the top.
Then the rest of the importa
| src="/assets/filter-icon.svg" | ||
| src={ | ||
| theme === 'light' | ||
| ? '/assets/filter-icon.svg' |
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.
Move the image src and the content to constant file. This logic could be a component as reusable. This is also getting used in Nav components also.
| : '/assets/filter-icon-dark.svg' | ||
| } | ||
| alt="Filter icon" | ||
| width={20} |
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.
width and height should come from constant. As well, the UL should come dynamic. create an Object with the list of options required... coop over it to create a List and then bind the event on it. Avoid doing any hardcoding of the content
| } | ||
|
|
||
| .navBar li { | ||
| float: none; |
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.
We should not be using float at all.
| background-color: var(--colorBackgroundMedium); | ||
| } | ||
| .stock-card-product-name { |
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.
Class name format is not consistent. Use camelCase
| import HandleAuctions from '@components/Auction'; | ||
| import styles from '@components/Auction/Auction.module.css'; | ||
| import GlobalStyles from '@components/Dark-Theme/globalStyles'; | ||
| import { ThemeProvider } from 'styled-components'; |
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.
Move the 3rd party imports on the top of the component
| <ThemeProvider theme={themeData}> | ||
| <> | ||
| <GlobalStyles /> | ||
| <div> |
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.
DIV should start from the Navbar rather than before HEAD
| /> | ||
| </Head> | ||
| <NavBar personData={personData} /> | ||
| <Link href="/auction"> |
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.
Either use Link or a. Both should not be used together. Use Link for routing and for 3rd party use a tag
| <NavBar personData={personData} /> | ||
| <Link href="/auction"> | ||
| <a> | ||
| <h2 className={styles.auctionPageNavigation}>Go Back</h2> |
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.
Move the content to constant file
| <CreateNewAuction /> | ||
| <Footer /> | ||
| </div> | ||
| </> |
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.
If you are wrapping with DIV tag then you don't need Fragment tags
| import CreateNewAuction from '@components/Auction/createNewAuction'; | ||
| import styles from '@components/Auction/Auction.module.css'; | ||
| import GlobalStyles from '@components/Dark-Theme/globalStyles'; | ||
| import { ThemeProvider } from 'styled-components'; |
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.
Move this on the top
| <ThemeProvider theme={themeData}> | ||
| <> | ||
| <GlobalStyles /> | ||
| <div> |
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.
Div should be moved after Head closing. As well as the fragment is not required. Make Head part as a reusable component to re-use
| <Link href="/auction/new"> | ||
| <div className={styles.newAuctionBtnContainer}> | ||
| <button className={styles.newAuctionBtn}> | ||
| Create New Auction |
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.
Move this to constant
|
Hey @shubham-y, Could you make suggested changes or are you working on something else? |
|
As we are changing the UI of the crypto site. We don't need these changes at the moment. So I am marking this as stale. |
Closes #239