From 83708831469e6b21287d9fa5f09d77677d013b8d Mon Sep 17 00:00:00 2001 From: anistouri Date: Fri, 3 Nov 2023 11:31:32 +0100 Subject: [PATCH] add cancel button (#307) * add cancel button * add PropTypes --- .../react-hook-form/utils/cancel-button.js | 31 +++++++++++++++++++ src/index.js | 1 + 2 files changed, 32 insertions(+) create mode 100644 src/components/react-hook-form/utils/cancel-button.js diff --git a/src/components/react-hook-form/utils/cancel-button.js b/src/components/react-hook-form/utils/cancel-button.js new file mode 100644 index 00000000..64182b3d --- /dev/null +++ b/src/components/react-hook-form/utils/cancel-button.js @@ -0,0 +1,31 @@ +import React from 'react'; +import { Button } from '@mui/material'; +import { FormattedMessage } from 'react-intl'; +import PropTypes from 'prop-types'; + +const CancelButton = ({ + onClick, + variant, + disabled, + withCustomColor = true, +}) => { + return ( + + ); +}; + +CancelButton.propTypes = { + onClick: PropTypes.func.isRequired, + variant: PropTypes.string, + disabled: PropTypes.bool, + withCustomColor: PropTypes.bool, +}; + +export default CancelButton; diff --git a/src/index.js b/src/index.js index d49a4500..682a1b8c 100644 --- a/src/index.js +++ b/src/index.js @@ -102,6 +102,7 @@ export MidFormError from './components/react-hook-form/error-management/mid-form export TextFieldWithAdornment from './components/react-hook-form/utils/text-field-with-adornment'; export FieldLabel from './components/react-hook-form/utils/field-label'; export SubmitButton from './components/react-hook-form/utils/submit-button'; +export CancelButton from './components/react-hook-form/utils/cancel-button'; export { genHelperPreviousValue, genHelperError,