Refactor handleOpenInNewTab function in AboutSystemContainer.js

master^2
Tudor Stanciu 2024-11-10 01:12:01 +02:00
parent 1ba19eb96c
commit f8d0d7c486
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ const buttons = [
} }
]; ];
const AboutSystemComponent = ({ handleOpenInNewTab }) => { const AboutSystemComponent = ({ onOpenInNewTab }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const bullet = <span style={styles.bullet}></span>; const bullet = <span style={styles.bullet}></span>;
@ -80,7 +80,7 @@ const AboutSystemComponent = ({ handleOpenInNewTab }) => {
size="small" size="small"
color="primary" color="primary"
startIcon={<OpenInNewIcon />} startIcon={<OpenInNewIcon />}
onClick={handleOpenInNewTab(button.url)} onClick={onOpenInNewTab(button.url)}
> >
{t(button.code)} {t(button.code)}
</Button> </Button>
@ -91,7 +91,7 @@ const AboutSystemComponent = ({ handleOpenInNewTab }) => {
}; };
AboutSystemComponent.propTypes = { AboutSystemComponent.propTypes = {
handleOpenInNewTab: PropTypes.func.isRequired onOpenInNewTab: PropTypes.func.isRequired
}; };
export default AboutSystemComponent; export default AboutSystemComponent;

View File

@ -21,7 +21,7 @@ const handleOpenInNewTab = url => event => {
const AboutSystemContainer = () => { const AboutSystemContainer = () => {
return ( return (
<Box sx={styles.page}> <Box sx={styles.page}>
<AboutSystemComponent handleOpenInNewTab={handleOpenInNewTab} /> <AboutSystemComponent onOpenInNewTab={handleOpenInNewTab} />
<Box sx={styles.element}> <Box sx={styles.element}>
<SystemVersionContainer /> <SystemVersionContainer />
</Box> </Box>