-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #308 from Cryptonomic/13-staker
Staker updates
- Loading branch information
Showing
30 changed files
with
29,206 additions
and
337 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
106 changes: 106 additions & 0 deletions
106
src/contracts/BlndToken/components/Ledger/LedgerConfirmModal.tsx
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,106 @@ | ||
import React from 'react'; | ||
import { useTranslation, Trans } from 'react-i18next'; | ||
import Modal from '../../../../components/CustomModal'; | ||
import TezosAddress from '../../../../components/TezosAddress'; | ||
import sendImg from '../../../../../resources/imgs/Send.svg'; | ||
import confirmImg from '../../../../../resources/imgs/Confirm-Ledger.svg'; | ||
import Loader from '../../../../components/Loader'; | ||
import { formatAmount } from '../../../../utils/currency'; | ||
import TezosIcon from '../../../../components/TezosIcon'; | ||
|
||
import { | ||
MainContainer, | ||
DescriptionContainer, | ||
SendSvg, | ||
SendDes, | ||
ItemContainer, | ||
BottomContainer, | ||
ConfirmImg, | ||
ConfirmDes, | ||
ConfirmSpan, | ||
ItemTitle, | ||
ItemContent, | ||
} from './style'; | ||
|
||
interface Props { | ||
// Message to display. | ||
message: string; | ||
|
||
// Address of the vault, or undefined if operation on the core. | ||
vaultAddress: string | undefined; | ||
|
||
// Sender of the operation. | ||
source: string; | ||
|
||
// The fee, specificed in mutez. | ||
fee: number; | ||
|
||
// The amount, specified in mutez. | ||
amount: number; | ||
|
||
// Whether the modal is loading. | ||
isLoading: boolean; | ||
|
||
// Whether the modal is open. | ||
open: boolean; | ||
|
||
// A function to close the modal. | ||
onClose: () => void; | ||
} | ||
|
||
const LedgerConfirmModal = (props: Props) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
// TODO(keefertaylor): Use translations | ||
<Modal title={'Confirm Operation'} open={props.open} onClose={props.onClose}> | ||
<MainContainer> | ||
<DescriptionContainer> | ||
<SendSvg src={sendImg} /> | ||
<SendDes>{props.message}</SendDes> | ||
</DescriptionContainer> | ||
|
||
<ItemContainer> | ||
<ItemTitle>{t('general.nouns.source')}</ItemTitle> | ||
<TezosAddress address={props.source} size="16px" weight={300} color="primary" /> | ||
</ItemContainer> | ||
|
||
<ItemContainer> | ||
<ItemTitle>{t('general.nouns.fee')}</ItemTitle> | ||
<ItemContent> | ||
{formatAmount(props.fee)} | ||
<TezosIcon color="secondary" iconName="tezos" /> | ||
</ItemContent> | ||
</ItemContainer> | ||
|
||
<ItemContainer> | ||
<ItemTitle>{t('general.nouns.amount')}</ItemTitle> | ||
<ItemContent> | ||
{formatAmount(props.amount)} | ||
<TezosIcon color="secondary" iconName="tezos" /> | ||
</ItemContent> | ||
</ItemContainer> | ||
|
||
{props.vaultAddress && ( | ||
<ItemContainer> | ||
{/* TODO(keefertaylor): translations */} | ||
<ItemTitle> {'Vault'}</ItemTitle> | ||
<TezosAddress address={props.vaultAddress} size="16px" weight={300} color="primary" /> | ||
</ItemContainer> | ||
)} | ||
</MainContainer> | ||
<BottomContainer> | ||
<ConfirmDes> | ||
<Trans i18nKey="components.delegationLedgerConfirmationModal.confirm_description"> | ||
If the all the details are correct, please | ||
<ConfirmSpan>confirm</ConfirmSpan> the origination on your device. | ||
</Trans> | ||
</ConfirmDes> | ||
<ConfirmImg src={confirmImg} /> | ||
</BottomContainer> | ||
{props.isLoading && <Loader />} | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default LedgerConfirmModal; |
Oops, something went wrong.