File size: 1,849 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { guessTimezone } from '@automattic/i18n-utils';
import {
	CONCIERGE_SIGNUP_FORM_UPDATE,
	CONCIERGE_UPDATE_BOOKING_STATUS,
} from 'calypso/state/action-types';
import { combineReducers } from 'calypso/state/utils';

export const message = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.message;
	}

	return state;
};

export const timezone = ( state = guessTimezone() || 'UTC', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.timezone;
	}

	return state;
};

export const firstname = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.firstname;
	}

	return state;
};

export const lastname = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.lastname;
	}

	return state;
};

export const phoneNumber = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.phoneNumber;
	}

	return state;
};

export const countryCode = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.countryCode;
	}

	return state;
};

export const phoneNumberWithoutCountryCode = ( state = '', action ) => {
	switch ( action.type ) {
		case CONCIERGE_SIGNUP_FORM_UPDATE:
			return action.signupForm.phoneNumberWithoutCountryCode;
	}

	return state;
};

export const status = ( state = null, action ) => {
	switch ( action.type ) {
		case CONCIERGE_UPDATE_BOOKING_STATUS:
			return action.status;
	}

	return state;
};

export default combineReducers( {
	firstname,
	lastname,
	message,
	timezone,
	status,
	phoneNumber,
	countryCode,
	phoneNumberWithoutCountryCode,
} );