Browse Source

Drop the SuccessfulSendPayment and SuccessfulSendCoins modals

These are defunct, see the replacements:
showSuccessPayScreen and successTransactionScreen in Wallet.
renovate/lint-staged-8.x
Ben Woosley 6 years ago
parent
commit
7e998285f9
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 4
      app/components/ModalRoot/ModalRoot.js
  2. 42
      app/components/ModalRoot/SuccessfulSendCoins.js
  3. 37
      app/components/ModalRoot/SuccessfulSendCoins.scss
  4. 22
      app/components/ModalRoot/SuccessfulSendPayment.js
  5. 42
      app/components/ModalRoot/SuccessfulSendPayment.scss
  6. 28
      test/components/ModalRoot.spec.js

4
app/components/ModalRoot/ModalRoot.js

@ -1,14 +1,10 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { MdClose } from 'react-icons/lib/md' import { MdClose } from 'react-icons/lib/md'
import SuccessfulSendCoins from './SuccessfulSendCoins'
import SuccessfulSendPayment from './SuccessfulSendPayment'
import WalletDetails from './WalletDetails' import WalletDetails from './WalletDetails'
import styles from './ModalRoot.scss' import styles from './ModalRoot.scss'
const MODAL_COMPONENTS = { const MODAL_COMPONENTS = {
SUCCESSFUL_SEND_COINS: SuccessfulSendCoins,
SUCCESSFUL_SEND_PAYMENT: SuccessfulSendPayment,
WALLET_DETAILS: WalletDetails WALLET_DETAILS: WalletDetails
/* other modals */ /* other modals */
} }

42
app/components/ModalRoot/SuccessfulSendCoins.js

@ -1,42 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import AnimatedCheckmark from 'components/AnimatedCheckmark'
import { btc, blockExplorer } from 'utils'
import styles from './SuccessfulSendCoins.scss'
const SuccessfulSendCoins = ({
amount, addr, txid, hideModal, currentTicker, currency, isTestnet
}) => {
const calculatedAmount = currency === 'usd' ? btc.satoshisToUsd(amount, currentTicker.price_usd) : btc.satoshisToBtc(amount)
return (
<div className={styles.container}>
<AnimatedCheckmark />
<h1>
You&nbsp;
<span className={styles.link} onClick={() => blockExplorer.showTransaction(isTestnet, txid)}>sent</span>&nbsp;
<span className={styles.amount}>{calculatedAmount} {currency.toUpperCase()}</span>&nbsp;
to&nbsp;
<span className={styles.addr}>{addr}</span>
</h1>
<div className={styles.button} onClick={hideModal}>
Done
</div>
</div>
)
}
SuccessfulSendCoins.propTypes = {
amount: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]).isRequired,
addr: PropTypes.string.isRequired,
txid: PropTypes.string.isRequired,
hideModal: PropTypes.func.isRequired,
currentTicker: PropTypes.object.isRequired,
currency: PropTypes.string.isRequired,
isTestnet: PropTypes.bool.isRequired
}
export default SuccessfulSendCoins

37
app/components/ModalRoot/SuccessfulSendCoins.scss

@ -1,37 +0,0 @@
@import '../../variables.scss';
.container {
position: relative;
min-height: 250px;
top: calc(50% - 250px);
text-align: center;
h1 {
font-size: 20px;
margin: 50px 0;
.link {
cursor: pointer;
color: $main;
text-decoration: underline;
}
.amount, .addr {
font-weight: bold;
}
}
.button {
text-align: center;
border-radius: 8px;
background: $main;
padding: 20px 10px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
color: $white;
width: 15%;
margin: 0 auto;
}
}

22
app/components/ModalRoot/SuccessfulSendPayment.js

@ -1,22 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import AnimatedCheckmark from 'components/AnimatedCheckmark'
import styles from './SuccessfulSendPayment.scss'
const SuccessfulSendPayment = ({ hideModal }) => (
<div className={styles.container}>
<AnimatedCheckmark />
<h1>
<span>Successfully sent payment</span>&nbsp;
</h1>
<div className={styles.button} onClick={hideModal}>
Done
</div>
</div>
)
SuccessfulSendPayment.propTypes = {
hideModal: PropTypes.func.isRequired
}
export default SuccessfulSendPayment

42
app/components/ModalRoot/SuccessfulSendPayment.scss

@ -1,42 +0,0 @@
@import '../../variables.scss';
.container {
position: relative;
min-height: 250px;
top: calc(50% - 250px);
text-align: center;
h1 {
font-size: 20px;
margin: 50px 0;
.link {
cursor: pointer;
color: $main;
text-decoration: underline;
}
.amount, .addr {
font-weight: bold;
}
}
.button {
text-align: center;
border-radius: 8px;
background: #31343f;
padding: 20px 10px;
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
letter-spacing: .2px;
color: $white;
width: 15%;
margin: 0 auto;
transition: all 0.25s;
&:hover {
background: darken(#31343f, 5%);
}
}
}

28
test/components/ModalRoot.spec.js

@ -17,31 +17,3 @@ describe('no modal', () => {
expect(el.html()).toBeNull() expect(el.html()).toBeNull()
}) })
}) })
describe('SuccessfulSendCoins modal', () => {
const props = {
...defaultProps,
modalType: 'SUCCESSFUL_SEND_COINS',
modalProps: {
amount: 10000000,
addr: 'mkrfWvHSbUjgyne4EWnydWekywWBjrucKs',
txid: 'fd7dfc8b809a128323b1b679fe31e27ed7b34baae0a79cd4a290fb4dab892d26'
}
}
const el = shallow(<ModalRoot {...props} />)
it('should render specific modal', () => {
expect(el.find(SuccessfulSendCoins).length).toBe(1)
})
})
describe('SuccessfulSendPayment modal', () => {
const props = {
...defaultProps,
modalType: 'SUCCESSFUL_SEND_PAYMENT',
modalProps: {}
}
const el = shallow(<ModalRoot {...props} />)
it('should render specific modal', () => {
expect(el.find(SuccessfulSendPayment).length).toBe(1)
})
})

Loading…
Cancel
Save