added search, unified controls and input elements, rendering improved
This commit is contained in:
@@ -18,12 +18,12 @@ export const sessionReducer = (state, action) => {
|
||||
export const userTableReducer = (state, action) => {
|
||||
let user = action.user;
|
||||
switch (action.type) {
|
||||
case 'create': return [...state, { line: state.length, ...user }]
|
||||
case 'create': return [...state, { line: state.length, ...user }];
|
||||
case 'delete': {
|
||||
let newstate = [];
|
||||
let newindex = 0;
|
||||
state.forEach((u, i) => {
|
||||
if (user.uid && u.uid != user.uid|| user.line && i != user.line )
|
||||
if (user.uid && u.uid != user.uid || user.line && i != user.line)
|
||||
newstate.push({ ...u, line: newindex++ })
|
||||
return newstate;
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user