mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
* use banner alerts * update selector for banner alert content * lintage * update button click for banner alert structure * bump global branches coverage target * removed unnecessary Typography usage * remove Typography usage * transaction alerts story * pending transaction alerts * created separate stories for each alert scenario
33 lines
960 B
JavaScript
33 lines
960 B
JavaScript
import React, { useContext } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { BannerAlert } from '../../component-library';
|
|
import { SEVERITIES } from '../../../helpers/constants/design-system';
|
|
|
|
import { I18nContext } from '../../../../.storybook/i18n';
|
|
|
|
export default function SimulationErrorMessage({
|
|
userAcknowledgedGasMissing = false,
|
|
setUserAcknowledgedGasMissing,
|
|
}) {
|
|
const t = useContext(I18nContext);
|
|
|
|
return userAcknowledgedGasMissing === true ? (
|
|
<BannerAlert severity={SEVERITIES.DANGER}>
|
|
{t('simulationErrorMessageV2')}
|
|
</BannerAlert>
|
|
) : (
|
|
<BannerAlert
|
|
severity={SEVERITIES.DANGER}
|
|
actionButtonLabel={t('proceedWithTransaction')}
|
|
actionButtonOnClick={setUserAcknowledgedGasMissing}
|
|
>
|
|
{t('simulationErrorMessageV2')}
|
|
</BannerAlert>
|
|
);
|
|
}
|
|
|
|
SimulationErrorMessage.propTypes = {
|
|
userAcknowledgedGasMissing: PropTypes.bool,
|
|
setUserAcknowledgedGasMissing: PropTypes.func,
|
|
};
|