generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from the-collab-lab/jo-dark-light-login
Consistent dark and light theme throughout app
- Loading branch information
Showing
5 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React, { useState } from 'react'; | ||
|
||
export const Context = React.createContext(); | ||
export const ContextProvider = ({ children }) => { | ||
const [darkMode, setDarkMode] = useState(false); | ||
|
||
return ( | ||
<Context.Provider value={{ darkMode, setDarkMode }}> | ||
{children} | ||
</Context.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { StrictMode } from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
import { App } from './App'; | ||
|
||
import { ContextProvider } from './Context'; | ||
import './index.css'; | ||
|
||
const root = createRoot(document.getElementById('root')); | ||
root.render( | ||
<StrictMode> | ||
<ContextProvider> | ||
<App /> | ||
</StrictMode>, | ||
</ContextProvider>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.dark { | ||
background-color: #1f1e26; | ||
color: #ffffff; | ||
} | ||
|
||
.false { | ||
background-color: #ffffff; | ||
color: #1f1e26; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters