-
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.
- Loading branch information
Showing
14 changed files
with
18,149 additions
and
53 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 |
---|---|---|
@@ -1 +1 @@ | ||
REACT_APP_CURRENT_VERSION=v1.3.0 | ||
REACT_APP_CURRENT_VERSION=v1.3.1 |
Large diffs are not rendered by default.
Oops, something went wrong.
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,31 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import Switch from "@material-ui/core/Switch"; | ||
import {makeStyles} from "@material-ui/core/styles"; | ||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; | ||
import {faMoon, faSun} from "@fortawesome/free-solid-svg-icons"; | ||
|
||
const useStyles = makeStyles({ | ||
switchHolder: { | ||
display: "flex", | ||
alignItems: "center" | ||
} | ||
}) | ||
|
||
const DarkModeSwitcher = ({onClick, state}) => { | ||
const classes = useStyles() | ||
return ( | ||
<div className={classes.switchHolder}> | ||
<FontAwesomeIcon icon={faSun}/> | ||
<Switch defaultChecked={state} onClick={onClick}/> | ||
<FontAwesomeIcon icon={faMoon}/> | ||
</div> | ||
) | ||
} | ||
|
||
DarkModeSwitcher.propTypes = { | ||
onClick: PropTypes.func, | ||
state: PropTypes.bool | ||
} | ||
|
||
export default DarkModeSwitcher |
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,3 @@ | ||
import DarkModeSwitcher from "./DarkMode"; | ||
|
||
export { DarkModeSwitcher } |
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
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
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,6 @@ | ||
export const SAVE_DARK_MODE = 'SAVE_DARK_MODE' | ||
|
||
export const SaveDarkMode = (enabled) => ({ | ||
type: SAVE_DARK_MODE, | ||
enabled, | ||
}) |
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,10 @@ | ||
import { SAVE_DARK_MODE } from 'store/action/DarkMode' | ||
|
||
export const DarkModeReducer = (state = true, action) => { | ||
switch (action.type) { | ||
case SAVE_DARK_MODE: | ||
return action.enabled | ||
default: | ||
return state | ||
} | ||
} |
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,22 @@ | ||
import { createMuiTheme } from '@material-ui/core/styles' | ||
|
||
export default createMuiTheme({ | ||
export default (darkMode) => createMuiTheme({ | ||
palette: { | ||
type: darkMode ? 'dark' : 'light', | ||
primary: { main: '#1261A0', light: '#3895D3', dark: '#072F5F' }, | ||
secondary: { main: '#F6F8F9' }, | ||
secondary: { main: '#F6F8F9', light: '#F6F8F9', dark: '#424242' }, | ||
success: { main: '#95CE47' }, | ||
error: { main: '#9F2711' }, | ||
warning: { main: '#F5BE69' }, | ||
info: { main: '#3D678D' }, | ||
}, | ||
breakpoints: { | ||
values: { | ||
xs: 0, | ||
sm: 770, | ||
md: 950, | ||
lg: 1300, | ||
xl: 1600 | ||
} | ||
} | ||
}) |
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,3 +1,9 @@ | ||
import Theme from './MuiTheme' | ||
import React from 'react' | ||
import {ThemeProvider} from "@material-ui/core/styles"; | ||
import {useSelector} from "react-redux"; | ||
|
||
export { Theme } | ||
export default (props) => { | ||
const darkMode = useSelector(state => state.darkMode) | ||
return <ThemeProvider theme={ Theme(darkMode) } children={props.children}/> | ||
} |
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