-
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.
* add base 8 * add settings for edit textField display * change style switch in dialog setting * edit settings button for is general * full screen for phone size
- Loading branch information
Melvyn Malherbe
committed
Jan 21, 2020
1 parent
37bf5f5
commit 652ea22
Showing
15 changed files
with
457 additions
and
118 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 @@ | ||
PUBLIC_URL=/tools |
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 @@ | ||
--- | ||
permalink: /404.html | ||
--- |
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,74 @@ | ||
import React from "react"; | ||
import { withStyles, createStyles, Theme } from "@material-ui/core/styles"; | ||
import Switch, { SwitchClassKey, SwitchProps } from "@material-ui/core/Switch"; | ||
|
||
interface Styles extends Partial<Record<SwitchClassKey, string>> { | ||
focusVisible?: string; | ||
} | ||
interface Props extends SwitchProps { | ||
classes: Styles; | ||
} | ||
export const CustomSwitch = withStyles((theme: Theme) => | ||
createStyles({ | ||
root: { | ||
width: 60, | ||
height: 30, | ||
padding: 0, | ||
margin: theme.spacing(1) | ||
}, | ||
switchBase: { | ||
padding: 1, | ||
color: theme.palette.primary.main, | ||
"&$checked": { | ||
transform: "translateX(35px)", | ||
color: theme.palette.secondary.main, | ||
backgroundColor: "none", | ||
"& + $track": { | ||
backgroundColor: theme.palette.primary.light, | ||
opacity: 1, | ||
border: `1px solid ${theme.palette.primary.main}` | ||
} | ||
}, | ||
"&$focusVisible $thumb": { | ||
color: "orange", | ||
border: "6px solid red", | ||
boxShadow: "none" | ||
} | ||
}, | ||
thumb: { | ||
width: 20, | ||
height: 20, | ||
marginTop: 4, | ||
marginLeft: 2 | ||
}, | ||
track: { | ||
borderRadius: 10 / 2, | ||
border: `1px solid ${theme.palette.secondary.light}`, | ||
backgroundColor: theme.palette.secondary.main, | ||
opacity: 1, | ||
transition: theme.transitions.create(["background-color", "border"]) | ||
}, | ||
checked: { | ||
backgroundColor: "none", | ||
color: "red" | ||
}, | ||
focusVisible: { | ||
color: "red" | ||
} | ||
}) | ||
)(({ classes, ...props }: Props) => { | ||
return ( | ||
<Switch | ||
focusVisibleClassName={classes.focusVisible} | ||
disableRipple | ||
classes={{ | ||
root: classes.root, | ||
switchBase: classes.switchBase, | ||
thumb: classes.thumb, | ||
track: classes.track, | ||
checked: classes.checked | ||
}} | ||
{...props} | ||
/> | ||
); | ||
}); |
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,41 @@ | ||
import React from "react"; | ||
import { | ||
TextField, | ||
makeStyles, | ||
fade, | ||
TextFieldProps, | ||
OutlinedInputProps, | ||
} from "@material-ui/core"; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
root: { | ||
border: "1px solid " + theme.palette.primary.dark, | ||
color: theme.palette.primary.light, | ||
padding: 2, | ||
paddingLeft: 6, | ||
fontSize: 18, | ||
overflow: "hidden", | ||
borderRadius: 3, | ||
backgroundColor: theme.palette.secondary.main, | ||
transition: theme.transitions.create(["border-color", "box-shadow"]), | ||
"&:hover": { | ||
backgroundColor: theme.palette.secondary.main | ||
}, | ||
"&$focused": { | ||
backgroundColor: theme.palette.secondary.dark, | ||
boxShadow: `${fade(theme.palette.secondary.main, 0.25)} 2px 0 0 2px`, | ||
borderColor: theme.palette.secondary.main | ||
} | ||
} | ||
})); | ||
|
||
export default function CustomTextField(props: TextFieldProps) { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<TextField | ||
InputProps={{ classes, disableUnderline: true } as Partial<OutlinedInputProps>} | ||
{...props} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.
652ea22
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.
Great !