upd: notifikasi
Deskripsi: - update notifikasi push routing ketika di klik No Issues
This commit is contained in:
14
lib/notificationSlice.ts
Normal file
14
lib/notificationSlice.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
const notificationUpdate = createSlice({
|
||||
name: 'notificationUpdate',
|
||||
initialState: false,
|
||||
reducers: {
|
||||
setUpdateNotification: (state, action) => {
|
||||
return action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setUpdateNotification } = notificationUpdate.actions;
|
||||
export default notificationUpdate.reducer;
|
||||
28
lib/pushToPage.ts
Normal file
28
lib/pushToPage.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { router } from "expo-router"
|
||||
|
||||
export function pushToPage(category: string, idContent: string) {
|
||||
const cat = category.split('/')
|
||||
if (cat.length > 1) {
|
||||
if (cat[2] == 'calendar') {
|
||||
return router.push(`/division/${cat[1]}/calendar/${idContent}`)
|
||||
} else if (cat[2] == 'discussion') {
|
||||
return router.push(`/division/${cat[1]}/discussion/${idContent}`)
|
||||
} else if (cat[2] == 'document') {
|
||||
return router.push(`/division/${cat[1]}/document/${idContent}`)
|
||||
} else if (cat[2] == 'task') {
|
||||
return router.push(`/division/${cat[1]}/task/${idContent}`)
|
||||
}
|
||||
} else {
|
||||
if (cat[0] == 'announcement') {
|
||||
return router.push(`/announcement/${idContent}`)
|
||||
} else if (cat[0] == 'discussion-general') {
|
||||
return router.push(`/discussion/${idContent}`)
|
||||
} else if (cat[0] == 'division') {
|
||||
return router.push(`/division/${idContent}`)
|
||||
} else if (cat[0] == 'member') {
|
||||
return router.push(`/member/${idContent}`)
|
||||
} else if (cat[0] == 'project') {
|
||||
return router.push(`/project/${idContent}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import filterSlice from './filterSlice';
|
||||
import groupUpdate from './groupSlice';
|
||||
import memberChoose from './memberChoose';
|
||||
import memberUpdate from './memberSlice';
|
||||
import notificationUpdate from './notificationSlice';
|
||||
import positionUpdate from './positionSlice';
|
||||
import projectUpdate from './projectUpdate';
|
||||
import taskCreate from './taskCreate';
|
||||
@@ -38,6 +39,7 @@ const store = configureStore({
|
||||
taskUpdate: taskUpdate,
|
||||
divisionCreate: divisionCreate,
|
||||
dokumenUpdate: dokumenUpdate,
|
||||
notificationUpdate: notificationUpdate,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user