diff --git a/src/component/MyPage/ProfileContent/ProfileContentForms1/AvatarUpload.tsx b/src/component/MyPage/ProfileContent/ProfileContentForms1/AvatarUpload.tsx index fffe60f..15a0948 100644 --- a/src/component/MyPage/ProfileContent/ProfileContentForms1/AvatarUpload.tsx +++ b/src/component/MyPage/ProfileContent/ProfileContentForms1/AvatarUpload.tsx @@ -29,6 +29,7 @@ import React from "react"; import DecodeToken from "../../../../utils/DecodeJWT/DecodeJWT"; import { useAppDispatch, useAppSelector } from "../../../../redux/hooks"; import { resizeFile } from "../../../../utils/ImageResize"; +import { setProfileImg } from "../../../../redux/Breeder1/BreederSlice1"; interface IAvatarUpload { setChangeAvatar: React.Dispatch>; @@ -75,14 +76,15 @@ const AvatarUpload = ({ setChangeAvatar }: IAvatarUpload) => { if (response.data.status === "FAIL") { throw "올바르지 못한 접근 입니다."; } - dispath(setAvatar(response.data.data.fileUrl)); - dispath(setAvatarId(response.data.data.id)); if (response.data.status === "SUCCESS") { Swal.fire({ ...alertList.successMessage("프로필 사진이 변경되었습니다"), width: "350px", }); } + dispath(setAvatar(response.data.data.fileUrl)); + dispath(setAvatarId(response.data.data.id)); + dispath(setProfileImg(response.data.data.fileUrl)); } catch (e) {} } else { @@ -94,6 +96,7 @@ const AvatarUpload = ({ setChangeAvatar }: IAvatarUpload) => { throw "올바르지 못한 접근 입니다."; } dispath(setAvatar("")); + dispath(setProfileImg("")); } catch (e) {} } } diff --git a/src/component/MyPage/ProfileContent/ProfileContentForms1/Styles1.ts b/src/component/MyPage/ProfileContent/ProfileContentForms1/Styles1.ts index 85d20fa..13a2a3e 100644 --- a/src/component/MyPage/ProfileContent/ProfileContentForms1/Styles1.ts +++ b/src/component/MyPage/ProfileContent/ProfileContentForms1/Styles1.ts @@ -61,6 +61,7 @@ export const AvatarBorder = styled.div<{ $isAuth: boolean }>` border-radius: 100%; border: 2px solid ${(props) => (props.$isAuth ? "#FF6363" : "#23F39C")}; overflow: hidden; + cursor: pointer; `; export const UploadAvatarBorder = styled.div` position: relative; @@ -70,6 +71,7 @@ export const UploadAvatarBorder = styled.div` overflow: hidden; align-self: center; margin-bottom: -3vh; + cursor: pointer; `; export const AvatarInput = styled.input` @@ -79,6 +81,7 @@ export const AvatarInput = styled.input` export const AvatarLabel = styled.label` width: 100%; height: 100%; + cursor: pointer; `; export const AvatarDeleteBtn = styled.div`