-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making tests for the validate application and the fetch company appli…
…cation services Making tests for the validate application and the fetch company application services
- Loading branch information
1 parent
95794d0
commit 4198681
Showing
13 changed files
with
254 additions
and
145 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
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 |
---|---|---|
@@ -1,33 +1,37 @@ | ||
import {Alert as MUI_Alert, AlertTitle} from "@material-ui/lab"; | ||
import {makeStyles} from "@material-ui/core"; | ||
|
||
import { Alert as MUIAlert, AlertTitle } from "@material-ui/lab"; | ||
import { makeStyles } from "@material-ui/core"; | ||
import PropTypes from "prop-types"; | ||
import { Warning as WarningIcon } from "@material-ui/icons"; | ||
import React from 'react'; | ||
import React from "react"; | ||
|
||
const useStyles = (props) => makeStyles((theme) => ({ | ||
const useStyles = (props) => makeStyles(() => ({ | ||
|
||
content:{ | ||
fontSize: props.fontSize+"em", | ||
content: { | ||
fontSize: `${props.fontSize}em`, | ||
"& .MuiAlert-icon": { | ||
fontSize: (props.fontSize+0.3)+"em" | ||
fontSize: `${props.fontSize + 0.3}em`, | ||
}, | ||
margin:"0.5em 0em" | ||
margin: "0.5em 0em", | ||
}, | ||
})); | ||
|
||
export const Alert = ({type, title, fontSize = 1, children}) => { | ||
const classes = useStyles({fontSize: fontSize})(); | ||
export const Alert = ({ type, title, fontSize = 1, children }) => { | ||
const classes = useStyles({ fontSize: fontSize })(); | ||
return ( | ||
<MUI_Alert severity={type} className={classes.content} icon={<WarningIcon />} data-testid="Alert"> | ||
{title ? <AlertTitle>{title}</AlertTitle> : null} | ||
<MUIAlert severity={type} className={classes.content} icon={<WarningIcon />} data-testid="Alert"> | ||
{title ? | ||
<AlertTitle> | ||
{title} | ||
</AlertTitle> : null} | ||
{children} | ||
</MUI_Alert> | ||
) | ||
} | ||
</MUIAlert> | ||
); | ||
}; | ||
|
||
Alert.propTypes = { | ||
type: PropTypes.oneOf(["error", "warning", "info", "success"]), | ||
title: PropTypes.string, | ||
children: PropTypes.string, | ||
fontSize: PropTypes.number, | ||
} | ||
}; |
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.