Skip to content

Commit 6577808

Browse files
Seller signup flow completed
1 parent 438c15b commit 6577808

File tree

3 files changed

+217
-171
lines changed

3 files changed

+217
-171
lines changed
-162 Bytes
Binary file not shown.

screens/auth/AccountInfo.js

+26-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, {useState} from 'react';
22
import {
33
StyleSheet,
44
View,
@@ -13,13 +13,13 @@ import Checkbox from 'react-native-check-box';
1313
import Header from '../../shared/Header';
1414
import LongCard from '../../shared/LongCard';
1515
import FlatButton from '../../shared/Button.js';
16-
import { gStyles } from '../../styles/global';
17-
import { Formik } from 'formik';
16+
import {gStyles} from '../../styles/global';
17+
import {Formik} from 'formik';
1818
import * as yup from 'yup';
1919
import Stepper from '../../shared/Stepper';
2020

21-
import { signup, setLoading } from '../../redux/authActions';
22-
import { connect } from 'react-redux';
21+
import {signup, setLoading} from '../../redux/authActions';
22+
import {connect} from 'react-redux';
2323

2424
// import MaterialIcons from 'react-native-vector-icons/FontAwesome';
2525
const AccountInfo = (props) => {
@@ -28,7 +28,7 @@ const AccountInfo = (props) => {
2828

2929
const handleSubmit = (values) => {
3030
signupFunction(
31-
Object.assign({ isActivated: true }, values, props.route.params),
31+
Object.assign({isActivated: true}, values, props.route.params),
3232
);
3333
};
3434

@@ -46,9 +46,14 @@ const AccountInfo = (props) => {
4646
}
4747
};
4848

49-
const navigateToSampleScreen = () => {
49+
const navigateToSampleScreen = (body) => {
5050
// props.navigation.goBack();
51-
props.navigation.navigate('SellerBio');
51+
props.navigation.navigate('SellerBio', {
52+
...props.route.params,
53+
name: body.name,
54+
email: body.email,
55+
password: body.password,
56+
});
5257
};
5358

5459
const reviewSchema = yup.object({
@@ -99,7 +104,11 @@ const AccountInfo = (props) => {
99104
validationSchema={reviewSchema}
100105
onSubmit={(values, actions) => {
101106
if (props.route.params.userType == 'seller') {
102-
navigateToSampleScreen();
107+
navigateToSampleScreen({
108+
name: values.name,
109+
email: values.email,
110+
password: values.password,
111+
});
103112
} else {
104113
handleSubmit({
105114
name: values.name,
@@ -126,7 +135,7 @@ const AccountInfo = (props) => {
126135
alignContent: 'space-around',
127136
marginBottom: 5,
128137
}}>
129-
<View style={{ marginBottom: 7 }}>
138+
<View style={{marginBottom: 7}}>
130139
<View
131140
style={{
132141
flexDirection: 'row',
@@ -156,7 +165,7 @@ const AccountInfo = (props) => {
156165
/>
157166
{/* {propss.errors.name && propss.touched.name ? ( */}
158167
<View>
159-
<Text style={{ color: 'red' }}>
168+
<Text style={{color: 'red'}}>
160169
{propss.errors.name && propss.touched.name
161170
? propss.errors.name
162171
: ''}
@@ -167,7 +176,7 @@ const AccountInfo = (props) => {
167176
</View>
168177
</View>
169178

170-
<View style={{ marginBottom: 7 }}>
179+
<View style={{marginBottom: 7}}>
171180
<View
172181
style={{
173182
flexDirection: 'row',
@@ -196,7 +205,7 @@ const AccountInfo = (props) => {
196205
/>
197206
{/* {propss.errors.email && propss.touched.email ? ( */}
198207
<View>
199-
<Text style={{ color: 'red' }}>
208+
<Text style={{color: 'red'}}>
200209
{propss.errors.email && propss.touched.email
201210
? propss.errors.email
202211
: ''}
@@ -207,7 +216,7 @@ const AccountInfo = (props) => {
207216
</View>
208217
</View>
209218

210-
<View style={{ marginBottom: 7 }}>
219+
<View style={{marginBottom: 7}}>
211220
<View
212221
style={{
213222
flexDirection: 'row',
@@ -253,7 +262,7 @@ const AccountInfo = (props) => {
253262
</View>
254263
</View>
255264

256-
<View style={{ marginBottom: 7 }}>
265+
<View style={{marginBottom: 7}}>
257266
<View
258267
style={{
259268
flexDirection: 'row',
@@ -272,7 +281,7 @@ const AccountInfo = (props) => {
272281
<TextInput
273282
style={
274283
propss.errors.passwordConfirmation &&
275-
propss.touched.passwordConfirmation
284+
propss.touched.passwordConfirmation
276285
? styles.errorInput
277286
: styles.input
278287
}
@@ -293,7 +302,7 @@ const AccountInfo = (props) => {
293302
color: 'red',
294303
}}>
295304
{propss.errors.passwordConfirmation &&
296-
propss.touched.passwordConfirmation
305+
propss.touched.passwordConfirmation
297306
? propss.errors.passwordConfirmation
298307
: ''}
299308
</Text>

0 commit comments

Comments
 (0)