Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boiler plate #89

Merged
merged 3 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading