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

improved mode toggle #24

Merged
merged 3 commits into from
Mar 29, 2021
Merged

improved mode toggle #24

merged 3 commits into from
Mar 29, 2021

Conversation

anastasssia88
Copy link
Collaborator

now it's possible to toggle between dark & light mode

@@ -47,7 +51,7 @@ const LogIn = () => {
}
return (
<>
<h2>Log In</h2>
<Heading1 content = {'Log in to your account here'} />
Copy link
Member

Choose a reason for hiding this comment

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

This is great, we can also drop the { } when a prop is a string, and I think we want to close up the space here?

  <Heading1 content='Log in to your account here' />

Copy link
Member

Choose a reason for hiding this comment

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

**The spaces between content and = etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is it a bad practice to use space around = ? I often use it

Copy link
Member

Choose a reason for hiding this comment

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

Ah interesting, I think my linter etc always removes it. I am used to always seeing it with no spaces.

@@ -66,9 +66,9 @@ const App = () => {
<AuthProvider>
<Router>
{/* <Header toggleTheme={toggleTheme} theme={theme} /> */}
<ThemeProvider theme={darkTheme}>
<ThemeProvider theme = {state.currentTheme}>
Copy link
Member

Choose a reason for hiding this comment

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

ahhh yeaaaaa !

`;

const Heading1 = ({content}) => {
return (
Copy link
Member

Choose a reason for hiding this comment

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

A small thing for me I really like to remove anything not in use so could just return without the curly brackets, but maybe makes sense to leave in case we are doing some logic in here soon etc. If we removed it then could be

const Heading1 = ({content}) => 
        <Heading>
            {content}
        </Heading>

Another options is since content is being used as children can use the children prop that we get in react.

const Heading1 = ({children}) => 
        <Heading>
            {children}
        </Heading>


and then to use it we just wrap around our stuff

<Heading1>some header</Heading1>

Copy link
Member

Choose a reason for hiding this comment

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

But yes let's merge and then iterate as we add more stuff :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I think we'll come back to it anyways

@anastasssia88 anastasssia88 merged commit fa35d16 into main Mar 29, 2021
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