-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
M #~: Add errors in fireedge login (#112)
- Loading branch information
Showing
11 changed files
with
114 additions
and
47 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
41 changes: 41 additions & 0 deletions
41
src/fireedge/src/public/components/FormControl/ErrorHelper.js
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 { Box, darken, lighten, makeStyles, Typography } from '@material-ui/core'; | ||
import { Info as InfoIcon } from '@material-ui/icons'; | ||
|
||
import { Translate } from 'client/components/HOC'; | ||
|
||
const useStyles = makeStyles(theme => { | ||
const getColor = theme.palette.type === 'light' ? darken : lighten; | ||
const getBackgroundColor = theme.palette.type === 'light' ? lighten : darken; | ||
|
||
return { | ||
root: { | ||
color: theme.palette.error.dark, | ||
display: 'flex', | ||
alignItems: 'center' | ||
}, | ||
icon: { | ||
fontSize: 16 | ||
}, | ||
text: { | ||
...theme.typography.body1, | ||
paddingLeft: theme.spacing(1) | ||
} | ||
}; | ||
}); | ||
|
||
const ErrorHelper = ({ label = 'Error', ...rest }) => { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<Box className={classes.root} {...rest}> | ||
<InfoIcon className={classes.icon} /> | ||
<Typography className={classes.text} data-cy="error-text"> | ||
<Translate word={label} /> | ||
</Typography> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ErrorHelper; |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,21 +1,31 @@ | ||
import { makeStyles } from '@material-ui/core'; | ||
|
||
export default makeStyles(theme => ({ | ||
root: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center' | ||
}, | ||
paper: { | ||
padding: theme.spacing(3) | ||
}, | ||
form: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center' | ||
}, | ||
logo: { | ||
width: '50%', | ||
margin: '1.5rem auto' | ||
} | ||
})); | ||
export default makeStyles(theme => { | ||
// const getColor = theme.palette.type === 'light' ? darken : lighten; | ||
// const getBackgroundColor = theme.palette.type === 'light' ? lighten : darken; | ||
// color: getColor(theme.palette.error.main, 0.6), | ||
// backgroundColor: getBackgroundColor(theme.palette.error.main, 0.9) | ||
|
||
return { | ||
root: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center' | ||
}, | ||
paper: { | ||
padding: theme.spacing(3) | ||
}, | ||
form: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center' | ||
}, | ||
logo: { | ||
width: '50%', | ||
margin: '1.5rem auto' | ||
}, | ||
helper: { | ||
animation: '1s ease-out 0s 1' | ||
} | ||
}; | ||
}); |
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