This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect navigation flow for 0 value invocies.
Detecting a zero amount invoice in checkType we redirect to a seperate view. Currently only title is changed in the view.
- Loading branch information
Showing
8 changed files
with
215 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2017", | ||
"allowSyntheticDefaultImports": true, | ||
"noEmit": true, | ||
"checkJs": true, | ||
"jsx": "react", | ||
"lib": [ "dom", "es2017" ] | ||
} | ||
} |
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
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,88 @@ | ||
import React from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import { observer } from 'mobx-react'; | ||
import PropTypes from 'prop-types'; | ||
import Background from '../component/background'; | ||
import MainContent from '../component/main-content'; | ||
import { NamedField } from '../component/field'; | ||
import { Header, Title } from '../component/header'; | ||
import { CancelButton, BackButton, SmallGlasButton } from '../component/button'; | ||
import Card from '../component/card'; | ||
import LightningBoltIcon from '../asset/icon/lightning-bolt'; | ||
import { FormStretcher } from '../component/form'; | ||
import { | ||
BalanceLabel, | ||
BalanceLabelNumeral, | ||
BalanceLabelUnit, | ||
} from '../component/label'; | ||
import { color } from '../component/style'; | ||
|
||
const styles = StyleSheet.create({ | ||
balance: { | ||
marginBottom: 10, | ||
}, | ||
numeral: { | ||
color: color.blackText, | ||
}, | ||
unit: { | ||
color: color.blackText, | ||
}, | ||
totalLbl: { | ||
marginTop: 5, | ||
}, | ||
note: { | ||
marginTop: 5, | ||
borderBottomWidth: 0, | ||
}, | ||
confirmBtn: { | ||
marginTop: 20, | ||
}, | ||
}); | ||
|
||
const PayLightningSupplyAmountView = ({ store, nav, payment }) => ( | ||
<Background color={color.purple}> | ||
<Header color={color.purple}> | ||
<BackButton onPress={() => nav.goPay()} /> | ||
<Title title="Supply Lightning Payment Amount"> | ||
<LightningBoltIcon height={12} width={6.1} /> | ||
</Title> | ||
<CancelButton onPress={() => nav.goHome()} /> | ||
</Header> | ||
<MainContent> | ||
<Card> | ||
<FormStretcher> | ||
<BalanceLabel style={styles.balance}> | ||
<BalanceLabelNumeral style={styles.numeral}> | ||
{store.paymentAmountLabel} | ||
</BalanceLabelNumeral> | ||
<BalanceLabelUnit style={styles.unit}> | ||
{store.unitLabel} | ||
</BalanceLabelUnit> | ||
</BalanceLabel> | ||
<NamedField name="Fee"> | ||
{store.paymentFeeLabel} {store.unitLabel} | ||
</NamedField> | ||
<NamedField name="Total" style={styles.totalLbl}> | ||
{store.paymentTotalLabel} {store.unitLabel} | ||
</NamedField> | ||
{store.payment.note ? ( | ||
<NamedField name="Note" style={styles.note}> | ||
{store.payment.note} | ||
</NamedField> | ||
) : null} | ||
</FormStretcher> | ||
</Card> | ||
</MainContent> | ||
<SmallGlasButton onPress={() => payment.payLightning()}> | ||
Confirm | ||
</SmallGlasButton> | ||
</Background> | ||
); | ||
|
||
PayLightningSupplyAmountView.propTypes = { | ||
store: PropTypes.object.isRequired, | ||
nav: PropTypes.object.isRequired, | ||
payment: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default observer(PayLightningSupplyAmountView); |
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,91 @@ | ||
import React from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import { observer } from 'mobx-react'; | ||
import PropTypes from 'prop-types'; | ||
import Background from '../component/background'; | ||
import MainContent from '../component/main-content'; | ||
import { NamedField } from '../component/field'; | ||
import { Header, Title } from '../component/header'; | ||
import { CancelButton, BackButton, PillButton } from '../component/button'; | ||
import Card from '../component/card'; | ||
import LightningBoltIcon from '../asset/icon/lightning-bolt'; | ||
import { FormStretcher } from '../component/form'; | ||
import { | ||
BalanceLabel, | ||
BalanceLabelNumeral, | ||
BalanceLabelUnit, | ||
} from '../component/label'; | ||
import { color } from '../component/style'; | ||
|
||
const styles = StyleSheet.create({ | ||
balance: { | ||
marginBottom: 10, | ||
}, | ||
numeral: { | ||
color: color.blackText, | ||
}, | ||
unit: { | ||
color: color.blackText, | ||
}, | ||
totalLbl: { | ||
marginTop: 5, | ||
}, | ||
note: { | ||
marginTop: 5, | ||
borderBottomWidth: 0, | ||
}, | ||
confirmBtn: { | ||
marginTop: 20, | ||
}, | ||
}); | ||
|
||
const PayLightningSupplyAmountView = ({ store, nav, payment }) => ( | ||
<Background image="purple-gradient-bg"> | ||
<Header shadow color={color.purple}> | ||
<BackButton onPress={() => nav.goPay()} /> | ||
<Title title="Supply Lightning Amount"> | ||
<LightningBoltIcon height={12} width={6.1} /> | ||
</Title> | ||
<CancelButton onPress={() => nav.goHome()} /> | ||
</Header> | ||
<MainContent> | ||
<Card> | ||
<FormStretcher> | ||
<BalanceLabel style={styles.balance}> | ||
<BalanceLabelNumeral style={styles.numeral}> | ||
{store.paymentAmountLabel} | ||
</BalanceLabelNumeral> | ||
<BalanceLabelUnit style={styles.unit}> | ||
{store.unitLabel} | ||
</BalanceLabelUnit> | ||
</BalanceLabel> | ||
<NamedField name="Fee"> | ||
{store.paymentFeeLabel} {store.unitLabel} | ||
</NamedField> | ||
<NamedField name="Total" style={styles.totalLbl}> | ||
{store.paymentTotalLabel} {store.unitLabel} | ||
</NamedField> | ||
{store.payment.note ? ( | ||
<NamedField name="Note" style={styles.note}> | ||
{store.payment.note} | ||
</NamedField> | ||
) : null} | ||
</FormStretcher> | ||
<PillButton | ||
style={styles.confirmBtn} | ||
onPress={() => payment.payLightning()} | ||
> | ||
Confirm | ||
</PillButton> | ||
</Card> | ||
</MainContent> | ||
</Background> | ||
); | ||
|
||
PayLightningSupplyAmountView.propTypes = { | ||
store: PropTypes.object.isRequired, | ||
nav: PropTypes.object.isRequired, | ||
payment: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default observer(PayLightningSupplyAmountView); |