feat: main styling/ui/ux final changes

This commit is contained in:
Danny Avila 2023-03-22 16:06:11 -04:00
parent 67161c983f
commit 8f58c95452
17 changed files with 166 additions and 70 deletions

View file

@ -17,14 +17,15 @@ const initialState = {
refreshConvoHint: 0,
search: false,
latestMessage: null,
convos: []
convos: [],
convoMap: {},
};
const currentSlice = createSlice({
name: 'convo',
initialState,
reducers: {
refreshConversation: (state, action) => {
refreshConversation: (state) => {
state.refreshConvoHint = state.refreshConvoHint + 1;
},
setConversation: (state, action) => {
@ -69,6 +70,13 @@ const currentSlice = createSlice({
} else {
state.convos = convos.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
}
// state.convoMap = convos.reduce((acc, curr) => {
// acc[curr.conversationId] = { ...curr };
// delete acc[curr.conversationId].conversationId;
// return acc;
// }, {});
},
setPages: (state, action) => {
state.pages = action.payload;

View file

@ -4,12 +4,16 @@ const initialState = {
searchEnabled: false,
search: false,
query: '',
inputValue: '',
};
const currentSlice = createSlice({
name: 'search',
initialState,
reducers: {
setInputValue: (state, action) => {
state.inputValue = action.payload;
},
setSearchState: (state, action) => {
state.searchEnabled = action.payload;
},
@ -26,6 +30,6 @@ const currentSlice = createSlice({
}
});
export const { setSearchState, setQuery } = currentSlice.actions;
export const { setInputValue, setSearchState, setQuery } = currentSlice.actions;
export default currentSlice.reducer;