Add manifest.json, icons and install button, flatten client/src
This commit is contained in:
parent
a219e689c1
commit
474afda9c2
105 changed files with 338 additions and 283 deletions
46
client/js/state/ui.js
Normal file
46
client/js/state/ui.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
import createReducer from 'utils/createReducer';
|
||||
import { LOCATION_CHANGED } from 'utils/router';
|
||||
import * as actions from './actions';
|
||||
|
||||
const initialState = {
|
||||
showTabList: false,
|
||||
showUserList: false
|
||||
};
|
||||
|
||||
export const getShowTabList = state => state.ui.showTabList;
|
||||
export const getShowUserList = state => state.ui.showUserList;
|
||||
|
||||
function setMenuHidden(state) {
|
||||
state.showTabList = false;
|
||||
}
|
||||
|
||||
export default createReducer(initialState, {
|
||||
[actions.TOGGLE_MENU](state) {
|
||||
state.showTabList = !state.showTabList;
|
||||
},
|
||||
|
||||
[actions.HIDE_MENU]: setMenuHidden,
|
||||
[LOCATION_CHANGED]: setMenuHidden,
|
||||
|
||||
[actions.TOGGLE_USERLIST](state) {
|
||||
state.showUserList = !state.showUserList;
|
||||
}
|
||||
});
|
||||
|
||||
export function hideMenu() {
|
||||
return {
|
||||
type: actions.HIDE_MENU
|
||||
};
|
||||
}
|
||||
|
||||
export function toggleMenu() {
|
||||
return {
|
||||
type: actions.TOGGLE_MENU
|
||||
};
|
||||
}
|
||||
|
||||
export function toggleUserList() {
|
||||
return {
|
||||
type: actions.TOGGLE_USERLIST
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue