Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wallet] Set up new verification screen skeletons #1563

Merged
merged 17 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/mobile/src/components/DevSkipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const mapStateToProps = (state: RootState): StateProps => {
}
}

export class DevSkipButton extends React.Component<Props> {
class DevSkipButton extends React.Component<Props> {
skip = () => {
if (this.props.onSkip) {
this.props.onSkip()
Expand Down
11 changes: 10 additions & 1 deletion packages/mobile/src/navigator/Navigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ import SendAmount from 'src/send/SendAmount'
import SendConfirmation from 'src/send/SendConfirmation'
import SetClock from 'src/set-clock/SetClock'
import TransactionReviewScreen from 'src/transactions/TransactionReviewScreen'
import VerificationInputScreen from 'src/verify/VerificationInputScreen'
import VerificationInterstitialScreen from 'src/verify/VerificationInterstitialScreen'
import VerificationLearnMoreScreen from 'src/verify/VerificationLearnMoreScreen'
import VerificationLoadingScreen from 'src/verify/VerificationLoadingScreen'
import VerificationSuccessScreen from 'src/verify/VerificationSuccessScreen'
import VerifyVerified from 'src/verify/Verified'
import VerifyVerifying from 'src/verify/Verifying'
import VerifyEducation from 'src/verify/VerifyPhoneEducation'
Expand Down Expand Up @@ -113,9 +117,14 @@ const NuxStack = createStackNavigator(
[Screens.ImportWalletEmpty]: { screen: ImportWalletEmpty },
[Screens.ImportContacts]: { screen: ImportContacts },
[Screens.VerifyEducation]: { screen: VerifyEducation },
[Screens.VerificationLoadingScreen]: { screen: VerificationLoadingScreen },
[Screens.VerifyVerifying]: { screen: VerifyVerifying },
[Screens.VerifyVerified]: { screen: VerifyVerified },
[Screens.VerificationEducationScreen]: { screen: VerificationLoadingScreen },
[Screens.VerificationLearnMoreScreen]: { screen: VerificationLearnMoreScreen },
[Screens.VerificationLoadingScreen]: { screen: VerificationLoadingScreen },
[Screens.VerificationInterstitialScreen]: { screen: VerificationInterstitialScreen },
[Screens.VerificationInputScreen]: { screen: VerificationInputScreen },
[Screens.VerificationSuccessScreen]: { screen: VerificationSuccessScreen },
...commonScreens,
},
{
Expand Down
6 changes: 6 additions & 0 deletions packages/mobile/src/navigator/Screens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ export enum Screens {
TabNavigator = 'TabNavigator',
TransactionReview = 'TransactionReview',
UpgradeScreen = 'UpgradeScreen',
// TODO(Rossy) Remove these next 3
VerifyEducation = 'VerifyEducation',
VerifyVerified = 'VerifyVerified',
VerifyVerifying = 'VerifyVerifying',
VerificationEducationScreen = 'VerificationEducationScreen',
VerificationLearnMoreScreen = 'VerificationLearnMoreScreen',
VerificationLoadingScreen = 'VerificationLoadingScreen',
VerificationInterstitialScreen = 'VerificationInterstitialScreen',
VerificationInputScreen = 'VerificationInputScreen',
VerificationSuccessScreen = 'VerificationSuccessScreen',
WalletHome = 'WalletHome',
}
19 changes: 19 additions & 0 deletions packages/mobile/src/verify/VerificationEducationScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationEducationScreen from 'src/verify/VerificationEducationScreen'
import { createMockStore } from 'test/utils'

describe('VerificationEducationScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationEducationScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})
})
41 changes: 41 additions & 0 deletions packages/mobile/src/verify/VerificationEducationScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import colors from '@celo/react-components/styles/colors'
import * as React from 'react'
import { withNamespaces, WithNamespaces } from 'react-i18next'
import { ScrollView, StyleSheet, Text } from 'react-native'
import SafeAreaView from 'react-native-safe-area-view'
import componentWithAnalytics from 'src/analytics/wrapper'
import { Namespaces } from 'src/i18n'

class VerificationEducationScreen extends React.Component<WithNamespaces> {
static navigationOptions = null

render() {
// const { t } = this.props
return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
<Text>Verify your phone</Text>
</ScrollView>
</SafeAreaView>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-between',
backgroundColor: colors.background,
},
scrollContainer: {
flex: 1,
padding: 30,
paddingTop: 0,
alignItems: 'center',
justifyContent: 'center',
},
})

export default componentWithAnalytics(
withNamespaces(Namespaces.nuxVerification2)(VerificationEducationScreen)
)
27 changes: 27 additions & 0 deletions packages/mobile/src/verify/VerificationInputScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationInputScreen from 'src/verify/VerificationInputScreen'
import { createMockStore } from 'test/utils'

describe('VerificationInputScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationInputScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})

it('enables button after timer', () => {
// TODO
})

it('shows tip when typing', () => {
// TODO
})
})
43 changes: 43 additions & 0 deletions packages/mobile/src/verify/VerificationInputScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import colors from '@celo/react-components/styles/colors'
import * as React from 'react'
import { withNamespaces, WithNamespaces } from 'react-i18next'
import { ScrollView, StyleSheet } from 'react-native'
import SafeAreaView from 'react-native-safe-area-view'
import componentWithAnalytics from 'src/analytics/wrapper'
import DevSkipButton from 'src/components/DevSkipButton'
import { Namespaces } from 'src/i18n'
import { Screens } from 'src/navigator/Screens'

class VerificationInputScreen extends React.Component<WithNamespaces> {
static navigationOptions = null

render() {
// const { t } = this.props
return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
<DevSkipButton nextScreen={Screens.WalletHome} />
</ScrollView>
</SafeAreaView>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-between',
backgroundColor: colors.background,
},
scrollContainer: {
flex: 1,
padding: 30,
paddingTop: 0,
alignItems: 'center',
justifyContent: 'center',
},
})

export default componentWithAnalytics(
withNamespaces(Namespaces.nuxVerification2)(VerificationInputScreen)
)
19 changes: 19 additions & 0 deletions packages/mobile/src/verify/VerificationInterstitialScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationInterstitialScreen from 'src/verify/VerificationInterstitialScreen'
import { createMockStore } from 'test/utils'

describe('VerificationInterstitialScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationInterstitialScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})
})
38 changes: 38 additions & 0 deletions packages/mobile/src/verify/VerificationInterstitialScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import colors from '@celo/react-components/styles/colors'
import * as React from 'react'
import { withNamespaces, WithNamespaces } from 'react-i18next'
import { ScrollView, StyleSheet, Text } from 'react-native'
import SafeAreaView from 'react-native-safe-area-view'
import { Namespaces } from 'src/i18n'

class VerificationInterstitialScreen extends React.Component<WithNamespaces> {
static navigationOptions = null

render() {
// const { t } = this.props
return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
<Text>Almost Done</Text>
</ScrollView>
</SafeAreaView>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-between',
backgroundColor: colors.background,
},
scrollContainer: {
flex: 1,
padding: 30,
paddingTop: 0,
alignItems: 'center',
justifyContent: 'center',
},
})

export default withNamespaces(Namespaces.nuxVerification2)(VerificationInterstitialScreen)
19 changes: 19 additions & 0 deletions packages/mobile/src/verify/VerificationLearnMoreScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationLearnMoreScreen from 'src/verify/VerificationLearnMoreScreen'
import { createMockStore } from 'test/utils'

describe('VerificationLearnMoreScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationLearnMoreScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})
})
41 changes: 41 additions & 0 deletions packages/mobile/src/verify/VerificationLearnMoreScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import colors from '@celo/react-components/styles/colors'
import * as React from 'react'
import { withNamespaces, WithNamespaces } from 'react-i18next'
import { ScrollView, StyleSheet, Text } from 'react-native'
import SafeAreaView from 'react-native-safe-area-view'
import componentWithAnalytics from 'src/analytics/wrapper'
import { Namespaces } from 'src/i18n'

class VerificationLearnMoreScreen extends React.Component<WithNamespaces> {
static navigationOptions = null

render() {
// const { t } = this.props
return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
<Text>Learn more stuff</Text>
</ScrollView>
</SafeAreaView>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'space-between',
backgroundColor: colors.background,
},
scrollContainer: {
flex: 1,
padding: 30,
paddingTop: 0,
alignItems: 'center',
justifyContent: 'center',
},
})

export default componentWithAnalytics(
withNamespaces(Namespaces.nuxVerification2)(VerificationLearnMoreScreen)
)
23 changes: 23 additions & 0 deletions packages/mobile/src/verify/VerificationLoadingScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationLoadingScreen from 'src/verify/VerificationLoadingScreen'
import { createMockStore } from 'test/utils'

describe('VerificationLoadingScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationLoadingScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})

it('updates progress bar', () => {
// TODO
})
})
9 changes: 5 additions & 4 deletions packages/mobile/src/verify/VerificationLoadingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import { ScrollView, StyleSheet } from 'react-native'
import SafeAreaView from 'react-native-safe-area-view'
import componentWithAnalytics from 'src/analytics/wrapper'
import Carousel, { CarouselItem } from 'src/components/Carousel'
import DevSkipButton from 'src/components/DevSkipButton'
import { Namespaces } from 'src/i18n'
import { headerWithCancelButton } from 'src/navigator/Headers'
import { Screens } from 'src/navigator/Screens'

export class VerificationLoadingScreen extends React.Component<WithNamespaces> {
static navigationOptions = headerWithCancelButton
class VerificationLoadingScreen extends React.Component<WithNamespaces> {
static navigationOptions = null

render() {
// const { t } = this.props
Expand All @@ -27,7 +28,7 @@ export class VerificationLoadingScreen extends React.Component<WithNamespaces> {
return (
<SafeAreaView style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
{/* <DevSkipButton nextScreen={Screens.WalletHome} /> */}
<DevSkipButton nextScreen={Screens.WalletHome} />
<Carousel containerStyle={styles.carouselContainer} items={items} />
</ScrollView>
</SafeAreaView>
Expand Down
19 changes: 19 additions & 0 deletions packages/mobile/src/verify/VerificationSuccessScreen.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react'
import 'react-native'
import { Provider } from 'react-redux'
import * as renderer from 'react-test-renderer'
import VerificationSuccessScreen from 'src/verify/VerificationSuccessScreen'
import { createMockStore } from 'test/utils'

describe('VerificationSuccessScreen', () => {
const store = createMockStore({})

it('renders correctly', () => {
const tree = renderer.create(
<Provider store={store}>
<VerificationSuccessScreen />
</Provider>
)
expect(tree).toMatchSnapshot()
})
})
Loading