18 changed files with 87 additions and 310 deletions
@ -1,3 +1,3 @@ |
|||||
import Form from './Form' |
import Form from './Form' |
||||
|
|
||||
export default Form |
export default Form |
||||
|
@ -1,82 +0,0 @@ |
|||||
import React, { Component } from 'react' |
|
||||
import PropTypes from 'prop-types' |
|
||||
import styles from './PayForm.scss' |
|
||||
|
|
||||
class PayForm extends Component { |
|
||||
render() { |
|
||||
const { |
|
||||
payform, |
|
||||
isOnchain, |
|
||||
isLn, |
|
||||
inputCaption, |
|
||||
setPayAmount, |
|
||||
setPayInput, |
|
||||
onPaySubmit |
|
||||
} = this.props |
|
||||
|
|
||||
return ( |
|
||||
<div className={styles.container}> |
|
||||
<div className={styles.content}> |
|
||||
<section className={`${styles.amountContainer} ${isLn ? styles.ln : ''}`}> |
|
||||
<input |
|
||||
type='text' |
|
||||
ref={input => this.amountInput = input} // eslint-disable-line
|
|
||||
size='' |
|
||||
style={ |
|
||||
isLn ? |
|
||||
{ width: '75%', fontSize: '85px' } |
|
||||
: |
|
||||
{ width: `${amount.length > 1 ? (amount.length * 15) - 5 : 25}%`, fontSize: `${190 - (amount.length ** 2)}px` } |
|
||||
} |
|
||||
value={payform.amount} |
|
||||
onChange={event => setPayAmount(event.target.value)} |
|
||||
id='amount' |
|
||||
readOnly={isLn} |
|
||||
/> |
|
||||
</section> |
|
||||
<div className={styles.inputContainer}> |
|
||||
<aside className={styles.paymentIcon}> |
|
||||
{(() => { |
|
||||
if (isOnchain) { |
|
||||
return ( |
|
||||
<i> |
|
||||
<span>on-chain</span> |
|
||||
<FaChain /> |
|
||||
</i> |
|
||||
) |
|
||||
} else if (isLn) { |
|
||||
return ( |
|
||||
<i> |
|
||||
<span>lightning network</span> |
|
||||
<FaBolt /> |
|
||||
</i> |
|
||||
) |
|
||||
} |
|
||||
return null |
|
||||
})()} |
|
||||
</aside> |
|
||||
<section className={styles.input}> |
|
||||
<input |
|
||||
type='text' |
|
||||
placeholder='Payment request or bitcoin address' |
|
||||
value={payform.payInput} |
|
||||
onChange={event => setPayInput(event.target.value)} |
|
||||
id='paymentRequest' |
|
||||
/> |
|
||||
</section> |
|
||||
</div> |
|
||||
<section className={styles.buttonGroup}> |
|
||||
<div className={styles.button} onClick={onPaySubmit}>Pay</div> |
|
||||
</section> |
|
||||
</div> |
|
||||
</div> |
|
||||
) |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
PayForm.propTypes = { |
|
||||
|
|
||||
} |
|
||||
|
|
||||
export default PayForm |
|
@ -1,152 +0,0 @@ |
|||||
@import '../../variables.scss'; |
|
||||
|
|
||||
.container { |
|
||||
width: 50%; |
|
||||
margin: 0 auto; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
height: 75vh; |
|
||||
justify-content: center; |
|
||||
align-items: center; |
|
||||
} |
|
||||
|
|
||||
.content { |
|
||||
margin: 0 auto; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
height: 75vh; |
|
||||
justify-content: center; |
|
||||
align-items: center; |
|
||||
} |
|
||||
|
|
||||
.amountContainer { |
|
||||
color: $main; |
|
||||
display: flex; |
|
||||
justify-content: center; |
|
||||
min-height: 120px; |
|
||||
margin-bottom: 20px; |
|
||||
min-height: 175px; |
|
||||
|
|
||||
&.ln { |
|
||||
opacity: 0.75; |
|
||||
} |
|
||||
|
|
||||
label, input[type=text] { |
|
||||
color: inherit; |
|
||||
display: inline-block; |
|
||||
vertical-align: top; |
|
||||
padding: 0; |
|
||||
} |
|
||||
|
|
||||
label { |
|
||||
svg { |
|
||||
width: 85px; |
|
||||
height: 85px; |
|
||||
} |
|
||||
|
|
||||
svg[data-icon='ltc'] { |
|
||||
margin-right: 10px; |
|
||||
|
|
||||
g { |
|
||||
transform: scale(1.75) translate(-5px, -5px); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
input[type=text] { |
|
||||
width: 100px; |
|
||||
font-size: 180px; |
|
||||
border: none; |
|
||||
outline: 0; |
|
||||
-webkit-appearance: none; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.inputContainer { |
|
||||
position: relative; |
|
||||
width: 100%; |
|
||||
padding: 40px 0; |
|
||||
cursor: pointer; |
|
||||
|
|
||||
.info { |
|
||||
margin-bottom: 10px; |
|
||||
min-height: 19px; |
|
||||
} |
|
||||
|
|
||||
.paymentIcon { |
|
||||
position: absolute; |
|
||||
width: 20%; |
|
||||
left: calc(-12.5% - 75px); |
|
||||
top: 42px; |
|
||||
color: $main; |
|
||||
font-size: 50px; |
|
||||
text-align: center; |
|
||||
|
|
||||
span { |
|
||||
text-transform: uppercase; |
|
||||
display: block; |
|
||||
font-size: 12px; |
|
||||
font-weight: 200; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.input { |
|
||||
display: flex; |
|
||||
justify-content: center; |
|
||||
font-size: 18px; |
|
||||
height: auto; |
|
||||
min-height: 55px; |
|
||||
border: 1px solid $traditionalgrey; |
|
||||
border-radius: 6px; |
|
||||
position: relative; |
|
||||
padding: 0 20px; |
|
||||
|
|
||||
label, input[type=text] { |
|
||||
font-size: inherit; |
|
||||
} |
|
||||
|
|
||||
label { |
|
||||
padding-top: 19px; |
|
||||
padding-bottom: 12px; |
|
||||
color: $traditionalgrey; |
|
||||
} |
|
||||
|
|
||||
input[type=text] { |
|
||||
width: 100%; |
|
||||
border: none; |
|
||||
outline: 0; |
|
||||
-webkit-appearance: none; |
|
||||
height: 55px; |
|
||||
padding: 0 10px; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.buttonGroup { |
|
||||
width: 100%; |
|
||||
display: flex; |
|
||||
flex-direction: row; |
|
||||
border-radius: 6px; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
.button { |
|
||||
cursor: pointer; |
|
||||
height: 55px; |
|
||||
min-height: 55px; |
|
||||
text-transform: none; |
|
||||
font-size: 18px; |
|
||||
transition: opacity .2s ease-out; |
|
||||
background: $main; |
|
||||
color: $white; |
|
||||
border: none; |
|
||||
font-weight: 500; |
|
||||
padding: 0; |
|
||||
width: 100%; |
|
||||
text-align: center; |
|
||||
line-height: 55px; |
|
||||
|
|
||||
&:first-child { |
|
||||
border-right: 1px solid lighten($main, 20%); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,3 +0,0 @@ |
|||||
import PayForm from './PayForm' |
|
||||
|
|
||||
export default PayForm |
|
Loading…
Reference in new issue