Skip to content

Commit

Permalink
Merge pull request #37 from yauheni-kryzhyk-deriv/yauheni/76885/forms…
Browse files Browse the repository at this point in the history
…ubmiterror_ts_migration

yauheni/76885/formsubmiterror ts migration
  • Loading branch information
suisin-deriv committed Nov 4, 2022
2 parents 7a9a408 + c4832b6 commit 78af951
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import FormSubmitErrorMessage from '../form-submit-error-message.jsx';
import FormSubmitErrorMessage from '../form-submit-error-message';

describe('<FormSubmitErrorMessage/>', () => {
it('should render the message passed along with the icon', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import Icon from '../icon/icon';
import Text from '../text';

const FormSubmitErrorMessage = ({ className, message }) => (
type TFormSubmitErrorMessage = {
className?: string;
message: string;
};

const FormSubmitErrorMessage = ({ className, message }: TFormSubmitErrorMessage) => (
<div className={classNames('dc-form-submit-error-message', className)}>
<Icon icon='IcAlertDanger' data_testid='form_submit_error' />
<Text as='p' size='xxs' weight='bold' color='prominent'>
Expand All @@ -13,9 +17,4 @@ const FormSubmitErrorMessage = ({ className, message }) => (
</div>
);

FormSubmitErrorMessage.propTypes = {
className: PropTypes.string,
message: PropTypes.string,
};

export default FormSubmitErrorMessage;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import FormSubmitErrorMessage from './form-submit-error-message.jsx';
import FormSubmitErrorMessage from './form-submit-error-message';
import './form-submit-error-message.scss';

export default FormSubmitErrorMessage;

0 comments on commit 78af951

Please sign in to comment.