Skip to content

Commit

Permalink
Implemented remove avatar functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
DevlinRocha committed Jan 8, 2022
1 parent 42d4b80 commit 483a196
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useEffect } from "react";
import tw from "tailwind-styled-components/dist/tailwind";
import {
setUserAbout,
setUserAvatar,
setUserBanner,
useUserState,
} from "../../../../features/user";
Expand Down Expand Up @@ -45,6 +46,14 @@ export default function UserProfileSettings() {
dispatch(setUserAbout(e.target.value));
}

function removeAvatar() {
dispatch(
setUserAvatar(
"https://firebasestorage.googleapis.com/v0/b/banter-69832.appspot.com/o/users%2FdefaultProfilePicture.svg?alt=media&token=ec6842ea-d2e6-44b8-b6d4-2abcc747d787"
)
);
}

return (
<Container>
<Heading>User Profile</Heading>
Expand All @@ -63,7 +72,9 @@ export default function UserProfileSettings() {
Change Avatar
</ChangeAvatarButton>

<RemoveAvatarButton>Remove Avatar</RemoveAvatarButton>
<RemoveAvatarButton onClick={removeAvatar}>
Remove Avatar
</RemoveAvatarButton>
</AvatarButtonsContainer>
</SettingsContainer>

Expand Down

0 comments on commit 483a196

Please sign in to comment.