Skip to content

Commit 2ce7541

Browse files
authored
Merge pull request #302 from dbo1dyrev/add-exit-button
Bring back the ability to return to the landing screen from registration flow
2 parents 43b3551 + 2687721 commit 2ce7541

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

packages/edge-login-ui-rn/src/components/screens/newAccount/NewAccountWelcomeScreen.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

33
import * as React from 'react'
4-
import { Image, View } from 'react-native'
4+
import { Image, TouchableOpacity, View } from 'react-native'
55
import { cacheStyles } from 'react-native-patina'
66
import { sprintf } from 'sprintf-js'
77

@@ -28,20 +28,25 @@ type OwnProps = {
2828
branding: Branding
2929
}
3030
type DispatchProps = {
31+
onExit(): void,
3132
onDone(): void
3233
}
3334
type Props = OwnProps & DispatchProps & ThemeProps
3435

3536
const NewAccountWelcomeScreenComponent = ({
3637
theme,
3738
branding,
39+
onExit,
3840
onDone
3941
}: Props) => {
4042
const styles = getStyles(theme)
4143
const appName = branding.appName || s.strings.app_name_default
4244

4345
return (
4446
<ThemedScene>
47+
<TouchableOpacity style={styles.exitButton} onPress={onExit}>
48+
<EdgeText style={styles.exitText}>{s.strings.exit}</EdgeText>
49+
</TouchableOpacity>
4550
<SimpleSceneHeader>{s.strings.get_started}</SimpleSceneHeader>
4651
<View style={styles.content}>
4752
<Image source={LOGO_BIG} style={styles.logo} resizeMode="contain" />
@@ -102,6 +107,14 @@ const getStyles = cacheStyles((theme: Theme) => ({
102107
marginTop: theme.rem(0.75),
103108
marginBottom: theme.rem(1)
104109
},
110+
exitButton: {
111+
marginLeft: theme.rem(0.5),
112+
marginBottom: theme.rem(1)
113+
},
114+
exitText: {
115+
color: theme.primaryButton,
116+
fontSize: theme.rem(0.75)
117+
},
105118
welcome: {
106119
fontFamily: theme.fontFaceBold,
107120
color: theme.secondaryText,
@@ -142,6 +155,9 @@ const getStyles = cacheStyles((theme: Theme) => ({
142155
export const NewAccountWelcomeScreen = connect<{}, DispatchProps, OwnProps>(
143156
(state: RootState) => ({}),
144157
(dispatch: Dispatch) => ({
158+
onExit() {
159+
dispatch({ type: 'START_LANDING' })
160+
},
145161
onDone() {
146162
logEvent(`Signup_Welcome_Next`)
147163
dispatch({ type: 'WORKFLOW_NEXT' })

packages/edge-login-ui-rn/src/components/themed/SimpleSceneHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const SimpleSceneHeaderComponent = ({
3232

3333
const getStyles = cacheStyles((theme: Theme) => ({
3434
container: {
35-
marginLeft: theme.rem(1)
35+
marginLeft: theme.rem(0.5)
3636
},
3737
text: {
3838
fontSize: theme.rem(1.25),

0 commit comments

Comments
 (0)