diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2020-12-08 23:17:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-08 23:17:23 -0500 |
| commit | 792115326fc6af583f422082537885bc8061d051 (patch) | |
| tree | c397e80a5573cd791c45cc006b36570efa91d73c /src/components/taggs/TaggsBar.tsx | |
| parent | 84616a6143fea58899eafa915a73592eaad25361 (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/components/taggs/TaggsBar.tsx')
| -rw-r--r-- | src/components/taggs/TaggsBar.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx index 12e4b93a..082743d0 100644 --- a/src/components/taggs/TaggsBar.tsx +++ b/src/components/taggs/TaggsBar.tsx @@ -12,7 +12,7 @@ import {StatusBarHeight} from '../../utils'; import Tagg from './Tagg'; import {RootState} from '../../store/rootReducer'; import {ScreenType} from '../../types'; -import {loadIndividualSocial} from '../../store/actions'; +import {loadIndividualSocial, updateSocial} from '../../store/actions'; const {View, ScrollView, interpolate, Extrapolate} = Animated; interface TaggsBarProps { @@ -38,10 +38,15 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ /** * Updates the individual social that needs update + * If username is empty, update nonintegrated socials like Snapchat and TikTok * @param socialType Type of the social that needs update */ - const handleSocialUpdate = (socialType: string) => { - dispatch(loadIndividualSocial(user.userId, socialType)); + const handleSocialUpdate = (socialType: string, username: string) => { + if (username !== '') { + dispatch(updateSocial(socialType, username)); + } else { + dispatch(loadIndividualSocial(user.userId, socialType)); + } }; /** |
