Skip to content

Commit

Permalink
Merge pull request #13 from DevlinRocha/change-avatar
Browse files Browse the repository at this point in the history
Implemented remove avatar functionality
  • Loading branch information
DevlinRocha authored Jan 8, 2022
2 parents 6a7b8dd + 483a196 commit 5eed729
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

1 comment on commit 5eed729

@vercel
Copy link

@vercel vercel bot commented on 5eed729 Jan 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.