aboutsummaryrefslogtreecommitdiff
path: root/src/store/reducers
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2020-12-08 23:17:23 -0500
committerGitHub <noreply@github.com>2020-12-08 23:17:23 -0500
commit792115326fc6af583f422082537885bc8061d051 (patch)
treec397e80a5573cd791c45cc006b36570efa91d73c /src/store/reducers
parent84616a6143fea58899eafa915a73592eaad25361 (diff)
[TMA-410] Edit Non-Integrated Socials (#126)
* removed refs, added KB avoidance, UI done * missed some things * now parsing response correctly from backend * fixed naming * now allow empty strings to un-link a social * hide field if empty, allow empty string, fixed taggs bar not updating bug * Fix bug where non integrated socials do not show up on edit profile page Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Co-authored-by: Ashm Walia <ashmwalia@outlook.com>
Diffstat (limited to 'src/store/reducers')
-rw-r--r--src/store/reducers/userReducer.ts18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/store/reducers/userReducer.ts b/src/store/reducers/userReducer.ts
index f43bd0bc..2fd5c462 100644
--- a/src/store/reducers/userReducer.ts
+++ b/src/store/reducers/userReducer.ts
@@ -29,8 +29,24 @@ const userDataSlice = createSlice({
state.avatar = action.payload.avatar;
state.cover = action.payload.cover;
},
+
+ socialEdited: (state, action) => {
+ const {social, value} = action.payload;
+ switch (social) {
+ case 'Snapchat':
+ state.profile.snapchat = value;
+ break;
+ case 'TikTok':
+ state.profile.tiktok = value;
+ break;
+ }
+ },
},
});
-export const {userLoggedIn, userDetailsFetched} = userDataSlice.actions;
+export const {
+ userLoggedIn,
+ userDetailsFetched,
+ socialEdited,
+} = userDataSlice.actions;
export const userDataReducer = userDataSlice.reducer;