Initiates real-estate react app

This commit is contained in:
Vazhin Tayeb
2021-01-17 11:06:55 +03:00
parent 627248287e
commit db873560fc
43 changed files with 15393 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import {
USER_SIGNED_OUT,
STORE_USER_ERROR,
USER_EXPIRED,
STORE_USER,
LOADING_USER
} from '../actions/types'
const initialState = {
user: null,
isLoadingUser: false
};
export default function (state = initialState, action) {
switch (action.type) {
case STORE_USER:
return {
...state,
isLoadingUser: false,
user: action.payload
}
case LOADING_USER:
return {
...state,
isLoadingUser: true
}
case USER_EXPIRED:
case STORE_USER_ERROR:
case USER_SIGNED_OUT:
return {
...state,
user: null,
isLoadingUser: false
}
default:
return state
}
}

View File

@@ -0,0 +1,6 @@
import { combineReducers } from 'redux';
import authReducer from './authReducer';
export default combineReducers({
auth: authReducer
})