forked from bitcoinvault/GoldWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add re-usable message screen template
- Loading branch information
1 parent
9a12503
commit 890771c
Showing
8 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,47 @@ | ||
import React from 'react'; | ||
import { Image, FastImageSource } from 'components/Image'; | ||
import { ButtonProps } from 'react-native-elements'; | ||
import { Text, View, StyleSheet } from 'react-native'; | ||
import { useNavigationParam } from 'react-navigation-hooks'; | ||
import { Button } from 'components/Button'; | ||
|
||
import { typography, palette } from 'styles'; | ||
|
||
export const MessageScreen = () => { | ||
const title: string = useNavigationParam('title'); | ||
const source: FastImageSource = useNavigationParam('source'); | ||
const description: string = useNavigationParam('description'); | ||
const button: ButtonProps | undefined = useNavigationParam('button'); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.title}>{title}</Text> | ||
<Image source={source} style={styles.image} resizeMode="contain" /> | ||
<Text style={styles.description}>{description}</Text> | ||
{button && <Button {...button} />} | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
padding: 50, | ||
}, | ||
title: { ...typography.headline4 }, | ||
image: { | ||
height: 172, | ||
width: '100%', | ||
marginTop: 40, | ||
marginBottom: 40, | ||
}, | ||
description: { | ||
...typography.caption, | ||
color: palette.textGrey, | ||
textAlign: 'center', | ||
lineHeight: 19, | ||
marginBottom: 97, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { AddressBookScreen } from './AddressBookScreen'; | ||
export { MessageScreen } from './MessageScreen'; |
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,8 @@ | ||
import * as React from 'react'; | ||
|
||
export const navigationRef: any = React.createRef(); | ||
|
||
export function navigate(name: string, params?: any) { | ||
// eslint-disable-next-line prettier/prettier | ||
navigationRef.current?.navigate(name, params); | ||
} |