diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2020-12-29 20:21:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-29 20:21:24 -0500 |
| commit | bd2f89805d0bb1c2f1d08fe8d91099aa4f109d35 (patch) | |
| tree | ac7219e034a0c4035096c6df8dbe6b92446b5111 /src/store/reducers | |
| parent | ec478d4981c726856485b49b49ac33b0d9e6a903 (diff) | |
[TMA-461] Notifications Screen (#151)
* renamed ProfileStack to MainStack, created initial notifications data type
* cleaned up code
* added notifications to redux
* finished sectioned list
* updated types to make more sense
* finished sectioned notifications by date
* updated notification type and tested mock backend integration
* finished read or unread logic
* minor changes
* another minor fix
* finished integration
* moved stuff
* added ability to navigate to user profile
Co-authored-by: Husam Salhab <47015061+hsalhab@users.noreply.github.com>
Diffstat (limited to 'src/store/reducers')
| -rw-r--r-- | src/store/reducers/index.ts | 1 | ||||
| -rw-r--r-- | src/store/reducers/userNotificationsReducer.ts | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/store/reducers/index.ts b/src/store/reducers/index.ts index e09b41ee..f525eb81 100644 --- a/src/store/reducers/index.ts +++ b/src/store/reducers/index.ts @@ -6,3 +6,4 @@ export * from './taggUsersReducer'; export * from './userBlockReducer'; export * from './userXReducer'; export * from './momentCategoryReducer'; +export * from './userNotificationsReducer'; diff --git a/src/store/reducers/userNotificationsReducer.ts b/src/store/reducers/userNotificationsReducer.ts new file mode 100644 index 00000000..4fc196ca --- /dev/null +++ b/src/store/reducers/userNotificationsReducer.ts @@ -0,0 +1,15 @@ +import {createSlice} from '@reduxjs/toolkit'; +import {NO_NOTIFICATIONS} from '../initialStates'; + +const userNotificationsSlice = createSlice({ + name: 'userNotifications', + initialState: NO_NOTIFICATIONS, + reducers: { + userNotificationsFetched: (state, action) => { + state.notifications = action.payload; + }, + }, +}); + +export const {userNotificationsFetched} = userNotificationsSlice.actions; +export const userNotificationsReducer = userNotificationsSlice.reducer; |
