Download wp-calypso/client/state/concierge/signup-form/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/signup-form/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/concierge/signup-form/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/concierge/signup-form/reducer.js
1.85 kB
| 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, | |
| } ); | |