Skip to content

Commit

Permalink
Use the correct styling method to define theme for a commons-ui compo…
Browse files Browse the repository at this point in the history
…nent

Signed-off-by: BOUTIER Charly <[email protected]>
  • Loading branch information
BOUTIER Charly committed Jan 23, 2024
1 parent 3c50ad2 commit ca8bcfb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/react-hook-form/utils/cancel-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ import React from 'react';
import { Button } from '@mui/material';
import { FormattedMessage } from 'react-intl';
import PropTypes from 'prop-types';
import { useThemeProps } from '@mui/material/styles';

const styles = {
cancelButton: (theme) => ({
color: theme.palette.text.secondary,
}),
};

const CancelButton = ({ ...buttonProps }) => {
const CancelButton = ({ ...inProps }) => {
const props = useThemeProps({ props: inProps, name: 'CancelButton' });
return (
<Button sx={styles.cancelButton} {...buttonProps}>
<Button {...props}>
<FormattedMessage id="cancel" />
</Button>
);
Expand Down

0 comments on commit ca8bcfb

Please sign in to comment.