-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet-mobile): new tx review success/failed tx screens (#3747)
Signed-off-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> Co-authored-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com>
- Loading branch information
1 parent
ed6624f
commit 77e0e18
Showing
35 changed files
with
2,036 additions
and
881 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
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
77 changes: 77 additions & 0 deletions
77
apps/wallet-mobile/src/features/Send/useCases/ShowFailedTxScreen/FailedTxScreen.tsx
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,77 @@ | ||
import {useTheme} from '@yoroi/theme' | ||
import * as React from 'react' | ||
import {StyleSheet, Text, View} from 'react-native' | ||
|
||
import {Button} from '../../../../components/Button/Button' | ||
import {SafeArea} from '../../../../components/SafeArea' | ||
import {Space} from '../../../../components/Space/Space' | ||
import {Spacer} from '../../../../components/Spacer/Spacer' | ||
import {useBlockGoBack, useWalletNavigation} from '../../../../kernel/navigation' | ||
import {FailedTxIcon} from '../../../ReviewTx/illustrations/FailedTxIcon' | ||
import {useStrings} from '../../common/strings' | ||
|
||
export const FailedTxScreen = () => { | ||
useBlockGoBack() | ||
const strings = useStrings() | ||
const {styles} = useStyles() | ||
const {resetToStartTransfer} = useWalletNavigation() | ||
|
||
return ( | ||
<SafeArea style={styles.root}> | ||
<Spacer height={144} /> | ||
|
||
<FailedTxIcon /> | ||
|
||
<Space height="_2xl" /> | ||
|
||
<Space height="lg" /> | ||
|
||
<Text style={styles.title}>{strings.failedTxTitle}</Text> | ||
|
||
<Text style={styles.text}>{strings.failedTxText}</Text> | ||
|
||
<Space fill /> | ||
|
||
<Actions> | ||
<Button onPress={resetToStartTransfer} title={strings.failedTxButton} style={styles.button} /> | ||
</Actions> | ||
</SafeArea> | ||
) | ||
} | ||
|
||
const Actions = ({children}: {children: React.ReactNode}) => { | ||
const {styles} = useStyles() | ||
|
||
return <View style={styles.actions}>{children}</View> | ||
} | ||
|
||
const useStyles = () => { | ||
const {atoms, color} = useTheme() | ||
const styles = StyleSheet.create({ | ||
root: { | ||
backgroundColor: color.bg_color_max, | ||
...atoms.p_lg, | ||
...atoms.flex_1, | ||
...atoms.align_center, | ||
...atoms.justify_center, | ||
}, | ||
title: { | ||
color: color.gray_max, | ||
...atoms.heading_3_medium, | ||
...atoms.px_sm, | ||
...atoms.text_center, | ||
}, | ||
text: { | ||
color: color.gray_600, | ||
...atoms.body_1_lg_regular, | ||
...atoms.text_center, | ||
}, | ||
button: { | ||
...atoms.px_lg, | ||
}, | ||
actions: { | ||
alignSelf: 'stretch', | ||
}, | ||
}) | ||
return {styles} as const | ||
} |
78 changes: 78 additions & 0 deletions
78
apps/wallet-mobile/src/features/Send/useCases/ShowSubmittedTxScreen/SubmittedTxScreen.tsx
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,78 @@ | ||
import {useTheme} from '@yoroi/theme' | ||
import * as React from 'react' | ||
import {StyleSheet, Text, View} from 'react-native' | ||
|
||
import {Button} from '../../../../components/Button/Button' | ||
import {SafeArea} from '../../../../components/SafeArea' | ||
import {Space} from '../../../../components/Space/Space' | ||
import {Spacer} from '../../../../components/Spacer/Spacer' | ||
import {useBlockGoBack, useWalletNavigation} from '../../../../kernel/navigation' | ||
import {SuccessfulTxIcon} from '../../../ReviewTx/illustrations/SuccessfulTxIcon' | ||
import {useStrings} from '../../common/strings' | ||
|
||
export const SubmittedTxScreen = () => { | ||
useBlockGoBack() | ||
const strings = useStrings() | ||
const {styles} = useStyles() | ||
const {resetToTxHistory} = useWalletNavigation() | ||
|
||
return ( | ||
<SafeArea style={styles.root}> | ||
<Spacer height={144} /> | ||
|
||
<SuccessfulTxIcon /> | ||
|
||
<Space height="_2xl" /> | ||
|
||
<Space height="lg" /> | ||
|
||
<Text style={styles.title}>{strings.submittedTxTitle}</Text> | ||
|
||
<Text style={styles.text}>{strings.submittedTxText}</Text> | ||
|
||
<Space fill /> | ||
|
||
<Actions> | ||
<Button onPress={resetToTxHistory} title={strings.submittedTxButton} style={styles.button} /> | ||
</Actions> | ||
</SafeArea> | ||
) | ||
} | ||
|
||
const Actions = ({children}: {children: React.ReactNode}) => { | ||
const {styles} = useStyles() | ||
|
||
return <View style={styles.actions}>{children}</View> | ||
} | ||
|
||
const useStyles = () => { | ||
const {atoms, color} = useTheme() | ||
const styles = StyleSheet.create({ | ||
root: { | ||
backgroundColor: color.bg_color_max, | ||
...atoms.p_lg, | ||
...atoms.flex_1, | ||
...atoms.align_center, | ||
...atoms.justify_center, | ||
}, | ||
title: { | ||
color: color.gray_max, | ||
...atoms.heading_3_medium, | ||
...atoms.px_sm, | ||
...atoms.text_center, | ||
}, | ||
text: { | ||
color: color.gray_600, | ||
...atoms.body_1_lg_regular, | ||
...atoms.text_center, | ||
maxWidth: 330, | ||
}, | ||
button: { | ||
...atoms.px_lg, | ||
}, | ||
actions: { | ||
alignSelf: 'stretch', | ||
}, | ||
}) | ||
return {styles} as const | ||
} |
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.