feat: add graphql support (#349)

* fix: eslint warnings

* refactor: use ramda + sanctuary instead of lodash

* refactor: use prettier-standard for formatting

* feat: enable security

* feat: add graphql

* chore: remove trailing commas from linter

* docs: new scripts on react and new-admin-server

* feat: handle authentication on graphql

* fix: perf improvement to date picker

* chore: add insecure-dev script to run servers
This commit is contained in:
Rafael Taranto 2019-12-24 14:36:41 +00:00 committed by Josh Harvey
parent 49f434f1d1
commit b8e0c2175b
182 changed files with 8827 additions and 4623 deletions

View file

@ -1,9 +1,14 @@
import React, { memo } from 'react'
import TextField from '@material-ui/core/TextField'
import InputAdornment from '@material-ui/core/InputAdornment'
import TextField from '@material-ui/core/TextField'
import { makeStyles } from '@material-ui/core/styles'
import React, { memo } from 'react'
import { fontColor, inputFontSize, inputFontSizeLg, inputFontWeight } from '../../../styling/variables'
import {
fontColor,
inputFontSize,
inputFontSizeLg,
inputFontWeight
} from '../../../styling/variables'
const useStyles = makeStyles({
inputRoot: {
@ -21,29 +26,44 @@ const useStyles = makeStyles({
}
})
const TextInput = memo(({ name, onChange, onBlur, value, touched, errors, suffix, large, ...props }) => {
const classes = useStyles()
const TextInput = memo(
({
name,
onChange,
onBlur,
value,
touched,
errors,
suffix,
large,
...props
}) => {
const classes = useStyles()
return (
<TextField
id={name}
onChange={onChange}
onBlur={onBlur}
error={!!(touched[name] && errors[name])}
value={value}
classes={{ root: classes.root }}
InputProps={{
className: large ? classes.inputRootLg : classes.inputRoot,
endAdornment: suffix ? (
<InputAdornment className={classes.inputRoot} disableTypography position='end'>
{suffix}
</InputAdornment>
) : null
}}
InputLabelProps={{ className: classes.labelRoot }}
{...props}
/>
)
})
return (
<TextField
id={name}
onChange={onChange}
onBlur={onBlur}
error={!!(touched[name] && errors[name])}
value={value}
classes={{ root: classes.root }}
InputProps={{
className: large ? classes.inputRootLg : classes.inputRoot,
endAdornment: suffix ? (
<InputAdornment
className={classes.inputRoot}
disableTypography
position="end">
{suffix}
</InputAdornment>
) : null
}}
InputLabelProps={{ className: classes.labelRoot }}
{...props}
/>
)
}
)
export default TextInput