Skip to content

Commit

Permalink
Remove console errors on development (#733)
Browse files Browse the repository at this point in the history
* Remove console errors on development

* Fix forward ref error

---------

Co-authored-by: Louise Linné <linne.louise@gmail.com>
  • Loading branch information
mikozet and louilinn committed Sep 28, 2023
1 parent 32b9c4d commit e996f8f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/components/ButtonAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const useStyles = makeStyles((theme) => ({

// eslint-disable-next-line react/display-name
const ButtonAction = React.forwardRef(
({ className, children, disabled, ...props }) => {
({ className, children, disabled, ...props }, ref) => {
const classes = useStyles();

return (
Expand All @@ -70,6 +70,7 @@ const ButtonAction = React.forwardRef(
disabled: classes.buttonDisabled,
}}
disabled={disabled}
ref={ref}
{...props}
>
<Box className={classes.buttonContainer}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Dialog = ({
</DialogContentText>
</DialogContent>
<DialogActions>
<Button autoFocus isPrimary onClick={onConfirm}>
<Button autoFocus onClick={onConfirm}>
{confirmLabel}
</Button>
<Button isOutline onClick={onClose}>
Expand Down
6 changes: 1 addition & 5 deletions src/components/DialogAddMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ const DialogAddMember = ({
cancelLabel={translate('DialogAddMember.dialogCancel')}
confirmLabel={confirmLabel}
open={isOpen}
title={
<Typography classes={{ root: 'h4_link_white' }} variant="h4">
{translate('DialogAddMember.dialogTitle', { username })}
</Typography>
}
title={translate('DialogAddMember.dialogTitle', { username })}
onClose={handleClose}
onConfirm={onConfirm}
>
Expand Down
10 changes: 8 additions & 2 deletions src/components/DialogPurple.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Dialog, DialogTitle } from '@mui/material';
import { Box, Dialog, DialogTitle, Typography } from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import PropTypes from 'prop-types';
import React from 'react';
Expand Down Expand Up @@ -41,7 +41,13 @@ const DialogPurple = ({
return (
<Dialog classes={classes} onClose={onClose} {...otherProps} maxWidth="lg">
<DialogTitle align="center" classes={titleClasses}>
{title}
<Typography
classes={{ root: 'h4_link_white' }}
component="span"
variant="h4"
>
{title}
</Typography>
</DialogTitle>
{children}
<Box pb={2} pt={2}>
Expand Down
6 changes: 1 addition & 5 deletions src/components/DialogTrust.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ const DialogTrust = ({
confirmLabel={translate('DialogTrust.dialogTrustConfirm')}
id="trust"
open={isOpen}
title={
<Typography classes={{ root: 'h4_link_white' }} variant="h4">
{translate('DialogTrust.dialogTrustTitle', { username })}
</Typography>
}
title={translate('DialogTrust.dialogTrustTitle', { username })}
onClose={handleTrustClose}
onConfirm={handleTrust}
>
Expand Down
8 changes: 3 additions & 5 deletions src/components/DialogTrustRevoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@ const DialogTrustRevoke = ({
confirmLabel={translate('DialogTrustRevoke.dialogRevokeTrustConfirm')}
id="revoke-trust"
open={isOpen}
title={
<Typography classes={{ root: 'h4_link_white' }} variant="h4">
{translate('DialogTrustRevoke.dialogRevokeTrustTitle', { username })}
</Typography>
}
title={translate('DialogTrustRevoke.dialogRevokeTrustTitle', {
username,
})}
onClose={handleRevokeTrustClose}
onConfirm={handleRevokeTrust}
>
Expand Down
2 changes: 1 addition & 1 deletion src/views/QRGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const QRGenerator = () => {
</ButtonShare>
</Box>
<Box mb={1} mt={2}>
<Button autoFocus fullWidth isPrimary onClick={handleHideQR}>
<Button autoFocus fullWidth onClick={handleHideQR}>
{translate('QRGenerator.dialogClose')}
</Button>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const Validation = () => {

const dialogContentFooter = () => {
return (
<ButtonShare fullWidth isPrimary text={shareText} url={shareLink}>
<ButtonShare fullWidth text={shareText} url={shareLink}>
{translate('Validation.buttonShareProfileLink')}
</ButtonShare>
);
Expand Down

0 comments on commit e996f8f

Please sign in to comment.