Add manifest.json, icons and install button, flatten client/src

This commit is contained in:
Ken-Håvard Lieng 2018-11-10 12:18:45 +01:00
parent a219e689c1
commit 474afda9c2
105 changed files with 338 additions and 283 deletions

38
client/js/state/search.js Normal file
View file

@ -0,0 +1,38 @@
import createReducer from 'utils/createReducer';
import * as actions from './actions';
const initialState = {
show: false,
results: []
};
export const getSearch = state => state.search;
export default createReducer(initialState, {
[actions.socket.SEARCH](state, { results }) {
state.results = results || [];
},
[actions.TOGGLE_SEARCH](state) {
state.show = !state.show;
}
});
export function searchMessages(server, channel, phrase) {
return {
type: actions.SEARCH_MESSAGES,
server,
channel,
phrase,
socket: {
type: 'search',
data: { server, channel, phrase }
}
};
}
export function toggleSearch() {
return {
type: actions.TOGGLE_SEARCH
};
}