Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDW-178] No Wallets and Errors handling
- Loading branch information
1 parent
b0adbc7
commit 558acd8
Showing
14 changed files
with
255 additions
and
52 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
source/renderer/app/api/staking/requests/submitRedeemItnRewards.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,22 @@ | ||
// @flow | ||
// @REDEEM TODO: | ||
/* eslint-disable */ | ||
import type { RequestConfig } from '../../common/types'; | ||
import type { | ||
SubmitRedeemItnRewardsRequest, | ||
SubmitRedeemItnRewardsResponse, | ||
} from '../types'; | ||
|
||
const rewardsTotal = 1000; | ||
const transactionFees = 1000; | ||
const finalTotal = 1000; | ||
|
||
export const submitRedeemItnRewards = ({ | ||
walletId, | ||
recoveryPhrase, | ||
}: SubmitRedeemItnRewardsRequest): Promise<SubmitRedeemItnRewardsResponse> => | ||
Promise.resolve({ | ||
rewardsTotal, | ||
transactionFees, | ||
finalTotal, | ||
}); |
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
67 changes: 67 additions & 0 deletions
67
source/renderer/app/components/staking/redeem-itn-rewards/NoWalletsDialog.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,67 @@ | ||
// @flow | ||
import React, { Component } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { defineMessages, intlShape } from 'react-intl'; | ||
import SVGInline from 'react-svg-inline'; | ||
import DialogCloseButton from '../../widgets/DialogCloseButton'; | ||
import Dialog from '../../widgets/Dialog'; | ||
import styles from './Step3FailureDialog.scss'; | ||
import redeemDialogOverride from './RedeemDialogOverride.scss'; | ||
import sadWalletImage from '../../../assets/images/sad-wallet.inline.svg'; | ||
|
||
const messages = defineMessages({ | ||
description: { | ||
id: 'staking.redeemItnRewards.noWallets.description', | ||
defaultMessage: | ||
'!!!Redemption of Incentivized Testnet rewards is not available as you currently do not have any Shelley-compatible wallets.', | ||
description: 'description for Redeem Incentivized Testnet - Step 3', | ||
}, | ||
addWalletButtonLabel: { | ||
id: 'staking.redeemItnRewards.noWallets.addWalletButtonLabel', | ||
defaultMessage: '!!!Add wallet', | ||
description: | ||
'addWalletButtonLabel for Redeem Incentivized Testnet - Step 3', | ||
}, | ||
}); | ||
|
||
type Props = { | ||
onClose: Function, | ||
onAddWallet: Function, | ||
}; | ||
|
||
@observer | ||
export default class NoWalletsDialog extends Component<Props> { | ||
static contextTypes = { | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
render() { | ||
const { intl } = this.context; | ||
const { onClose, onAddWallet } = this.props; | ||
return ( | ||
<> | ||
<DialogCloseButton | ||
className={redeemDialogOverride.closeButton} | ||
onClose={onClose} | ||
/> | ||
<Dialog | ||
actions={[ | ||
{ | ||
primary: true, | ||
label: intl.formatMessage(messages.addWalletButtonLabel), | ||
onClick: onAddWallet, | ||
}, | ||
]} | ||
onClose={onClose} | ||
customThemeOverrides={redeemDialogOverride} | ||
closeOnOverlayClick={false} | ||
> | ||
<SVGInline svg={sadWalletImage} className={styles.sadWalletImage} /> | ||
<div className={styles.description}> | ||
{intl.formatMessage(messages.description)} | ||
</div> | ||
</Dialog> | ||
</> | ||
); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
source/renderer/app/components/staking/redeem-itn-rewards/NoWalletsDialog.scss
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,42 @@ | ||
.sadWalletImage { | ||
display: block; | ||
margin-bottom: 30px; | ||
text-align: center; | ||
svg { | ||
height: 71px; | ||
stroke: var(--theme-delegation-steps-success-tada-color); | ||
path { | ||
stroke: var(--theme-delegation-steps-success-tada-color); | ||
} | ||
g { | ||
ellipse { | ||
&:nth-child(7), | ||
&:nth-child(8), | ||
&:nth-child(9) { | ||
stroke: var(--theme-delegation-steps-success-tada-color); | ||
} | ||
|
||
&:nth-child(11), | ||
&:nth-child(12), | ||
&:nth-child(13), | ||
&:nth-child(14), | ||
&:nth-child(15), | ||
&:nth-child(16) { | ||
fill: var(--theme-delegation-steps-success-tada-color); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
.description { | ||
color: rgba(255, 255, 255, 0.7); | ||
font-family: var(--font-regular); | ||
font-size: 16px; | ||
line-height: 1.38; | ||
margin-bottom: 30px; | ||
text-align: center; | ||
b { | ||
color: #ffffff; | ||
font-family: var(--font-semibold); | ||
} | ||
} |
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
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
Oops, something went wrong.