Skip to content

Commit

Permalink
Merge pull request #89 from next-petree/boilerPlate
Browse files Browse the repository at this point in the history
Boiler plate
  • Loading branch information
ChanghyeonO authored Jan 14, 2024
2 parents 6d17833 + 003f30c commit 9e501e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<React.SetStateAction<boolean>>;
Expand Down Expand Up @@ -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 {
Expand All @@ -94,6 +96,7 @@ const AvatarUpload = ({ setChangeAvatar }: IAvatarUpload) => {
throw "์˜ฌ๋ฐ”๋ฅด์ง€ ๋ชปํ•œ ์ ‘๊ทผ ์ž…๋‹ˆ๋‹ค.";
}
dispath(setAvatar(""));
dispath(setProfileImg(""));
} catch (e) {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -70,6 +71,7 @@ export const UploadAvatarBorder = styled.div`
overflow: hidden;
align-self: center;
margin-bottom: -3vh;
cursor: pointer;
`;

export const AvatarInput = styled.input`
Expand All @@ -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`
Expand Down

0 comments on commit 9e501e7

Please sign in to comment.