-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e361b3
commit ea589a6
Showing
9 changed files
with
180 additions
and
197 deletions.
There are no files selected for viewing
40 changes: 0 additions & 40 deletions
40
...tutional/custody-confirm-link-modal/__snapshots__/custody-confirm-link-modal.test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default } from './transaction-failed'; | ||
export { default } from './transaction-failed-modal'; |
99 changes: 99 additions & 0 deletions
99
ui/components/institutional/transaction-failed-modal/transaction-failed-modal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import React, { memo } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import withModalProps from '../../../helpers/higher-order-components/with-modal-props'; | ||
import { useI18nContext } from '../../../hooks/useI18nContext'; | ||
import { | ||
AlignItems, | ||
BorderRadius, | ||
Display, | ||
FlexDirection, | ||
TextAlign, | ||
TextVariant, | ||
} from '../../../helpers/constants/design-system'; | ||
import { | ||
Icon, | ||
IconName, | ||
IconSize, | ||
Text, | ||
Box, | ||
Modal, | ||
ModalContent, | ||
ModalHeader, | ||
ModalOverlay, | ||
Button, | ||
BUTTON_VARIANT, | ||
BUTTON_SIZES, | ||
} from '../../component-library'; | ||
|
||
const TransactionFailedModal = ({ | ||
hideModal, | ||
closeNotification, | ||
operationFailed, | ||
errorMessage, | ||
}) => { | ||
const t = useI18nContext(); | ||
|
||
const handleSubmit = () => { | ||
if (closeNotification) { | ||
global.platform.closeCurrentWindow(); | ||
} | ||
hideModal(); | ||
}; | ||
|
||
return ( | ||
<Modal isOpen onClose={hideModal}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader onClose={hideModal}> | ||
{operationFailed | ||
? `${t('operationFailed')}!` | ||
: `${t('transactionFailed')}!`} | ||
</ModalHeader> | ||
<Box | ||
display={Display.Flex} | ||
flexDirection={FlexDirection.Column} | ||
alignItems={AlignItems.center} | ||
paddingLeft={4} | ||
paddingRight={4} | ||
marginBottom={4} | ||
marginTop={4} | ||
style={{ flex: 1, overflowY: 'auto' }} | ||
> | ||
<Icon name={IconName.Warning} size={IconSize.Xl} /> | ||
<Text | ||
textAlign={TextAlign.Center} | ||
variant={TextVariant.bodySm} | ||
paddingTop={4} | ||
paddingBottom={4} | ||
paddingLeft={4} | ||
paddingRight={4} | ||
marginTop={4} | ||
borderRadius={BorderRadius.MD} | ||
className="transaction-failed__description" | ||
> | ||
{errorMessage} | ||
</Text> | ||
</Box> | ||
<Box display={Display.Flex}> | ||
<Button | ||
block | ||
variant={BUTTON_VARIANT.PRIMARY} | ||
size={BUTTON_SIZES.LG} | ||
onClick={handleSubmit} | ||
> | ||
{t('ok')} | ||
</Button> | ||
</Box> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
}; | ||
|
||
TransactionFailedModal.propTypes = { | ||
hideModal: PropTypes.func, | ||
errorMessage: PropTypes.string, | ||
closeNotification: PropTypes.bool, | ||
operationFailed: PropTypes.bool, | ||
}; | ||
|
||
export default withModalProps(memo(TransactionFailedModal)); |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.