|
| 1 | +import React from 'react'; |
| 2 | +import { StyleSheet } from 'react-native'; |
| 3 | +import { observer } from 'mobx-react'; |
| 4 | +import PropTypes from 'prop-types'; |
| 5 | +import Background from '../component/background'; |
| 6 | +import MainContent from '../component/main-content'; |
| 7 | +import { NamedField } from '../component/field'; |
| 8 | +import { Header, Title } from '../component/header'; |
| 9 | +import { CancelButton, BackButton, PillButton } from '../component/button'; |
| 10 | +import Card from '../component/card'; |
| 11 | +import LightningBoltIcon from '../asset/icon/lightning-bolt'; |
| 12 | +import { FormStretcher } from '../component/form'; |
| 13 | +import { |
| 14 | + BalanceLabel, |
| 15 | + BalanceLabelNumeral, |
| 16 | + BalanceLabelUnit, |
| 17 | +} from '../component/label'; |
| 18 | +import { color } from '../component/style'; |
| 19 | + |
| 20 | +const styles = StyleSheet.create({ |
| 21 | + balance: { |
| 22 | + marginBottom: 10, |
| 23 | + }, |
| 24 | + numeral: { |
| 25 | + color: color.blackText, |
| 26 | + }, |
| 27 | + unit: { |
| 28 | + color: color.blackText, |
| 29 | + }, |
| 30 | + totalLbl: { |
| 31 | + marginTop: 5, |
| 32 | + }, |
| 33 | + note: { |
| 34 | + marginTop: 5, |
| 35 | + borderBottomWidth: 0, |
| 36 | + }, |
| 37 | + confirmBtn: { |
| 38 | + marginTop: 20, |
| 39 | + }, |
| 40 | +}); |
| 41 | + |
| 42 | +const PayLightningSupplyAmountView = ({ store, nav, payment }) => ( |
| 43 | + <Background image="purple-gradient-bg"> |
| 44 | + <Header shadow color={color.purple}> |
| 45 | + <BackButton onPress={() => nav.goPay()} /> |
| 46 | + <Title title="Supply Lightning Amount"> |
| 47 | + <LightningBoltIcon height={12} width={6.1} /> |
| 48 | + </Title> |
| 49 | + <CancelButton onPress={() => nav.goHome()} /> |
| 50 | + </Header> |
| 51 | + <MainContent> |
| 52 | + <Card> |
| 53 | + <FormStretcher> |
| 54 | + <BalanceLabel style={styles.balance}> |
| 55 | + <BalanceLabelNumeral style={styles.numeral}> |
| 56 | + {store.paymentAmountLabel} |
| 57 | + </BalanceLabelNumeral> |
| 58 | + <BalanceLabelUnit style={styles.unit}> |
| 59 | + {store.unitLabel} |
| 60 | + </BalanceLabelUnit> |
| 61 | + </BalanceLabel> |
| 62 | + <NamedField name="Fee"> |
| 63 | + {store.paymentFeeLabel} {store.unitLabel} |
| 64 | + </NamedField> |
| 65 | + <NamedField name="Total" style={styles.totalLbl}> |
| 66 | + {store.paymentTotalLabel} {store.unitLabel} |
| 67 | + </NamedField> |
| 68 | + {store.payment.note ? ( |
| 69 | + <NamedField name="Note" style={styles.note}> |
| 70 | + {store.payment.note} |
| 71 | + </NamedField> |
| 72 | + ) : null} |
| 73 | + </FormStretcher> |
| 74 | + <PillButton |
| 75 | + style={styles.confirmBtn} |
| 76 | + onPress={() => payment.payLightning()} |
| 77 | + > |
| 78 | + Confirm |
| 79 | + </PillButton> |
| 80 | + </Card> |
| 81 | + </MainContent> |
| 82 | + </Background> |
| 83 | +); |
| 84 | + |
| 85 | +PayLightningSupplyAmountView.propTypes = { |
| 86 | + store: PropTypes.object.isRequired, |
| 87 | + nav: PropTypes.object.isRequired, |
| 88 | + payment: PropTypes.object.isRequired, |
| 89 | +}; |
| 90 | + |
| 91 | +export default observer(PayLightningSupplyAmountView); |
0 commit comments