Merge pull request #10 from navi-infra/ch12386
ch12386| Deepak| fixing test
This commit is contained in:
@@ -12,4 +12,4 @@ module.exports = {
|
||||
moduleNameMapper: {
|
||||
'\\.(css|scss|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__tests__/fileTransformer.js',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
export const reducer = (state, action) => {
|
||||
switch (action.type) {
|
||||
case "setAuthentication":
|
||||
return {
|
||||
...state,
|
||||
isAuthenticated: action.value,
|
||||
};
|
||||
case "setUserInfo":
|
||||
return {
|
||||
...state,
|
||||
userInfo: action.value,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
16
src/reducer/reducer.ts
Normal file
16
src/reducer/reducer.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export const reducer = (state, action) => {
|
||||
switch (action.type) {
|
||||
case "setAuthentication":
|
||||
return {
|
||||
...state,
|
||||
isAuthenticated: action.value,
|
||||
};
|
||||
case "setUserInfo":
|
||||
return {
|
||||
...state,
|
||||
userInfo: action.value,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { createContext, useReducer } from "react";
|
||||
import { reducer } from "../reducer/reducer.js";
|
||||
import { reducer } from "../reducer/reducer";
|
||||
|
||||
type initialStateType = {
|
||||
isAuthenticated: Boolean;
|
||||
|
||||
Reference in New Issue
Block a user