diff --git a/src/components/ModalPopup/ModalMypageModify.tsx b/src/components/ModalPopup/ModalMypageModify.tsx index 076a33630..c8ce20738 100644 --- a/src/components/ModalPopup/ModalMypageModify.tsx +++ b/src/components/ModalPopup/ModalMypageModify.tsx @@ -26,14 +26,10 @@ import theme from "@/tools/theme"; type ModalMypageModifyProps = Omit< Parameters[0], "padding" | "children" | "onEnter" -> & { profToken?: string; onUpdate?: () => void }; +>; type ProfileImageLargeProps = Parameters[0]; -type ButtonProfileImageProps = { - onUpdate?: ModalMypageModifyProps["onUpdate"]; -}; - const ProfileImageLarge = (props: ProfileImageLargeProps) => (
(
); -const ButtonProfileImage = ({ onUpdate }: ButtonProfileImageProps) => { +const ButtonProfileImage = () => { const { t } = useTranslation("mypage"); const axios = useAxios(); @@ -88,7 +84,6 @@ const ButtonProfileImage = ({ onUpdate }: ButtonProfileImageProps) => { }); if (data2?.result) { fetchLoginInfo(); - onUpdate?.(); setProfileAlert("SUCCESS"); return; } @@ -98,7 +93,7 @@ const ButtonProfileImage = ({ onUpdate }: ButtonProfileImageProps) => { } catch (e) { setProfileAlert("FAIL"); } - }, [onUpdate]); + }, []); const onClick = useCallback(() => { if (!profileAlert) inputRef.current?.click(); @@ -140,11 +135,7 @@ const ButtonProfileImage = ({ onUpdate }: ButtonProfileImageProps) => { ); }; -const ModalMypageModify = ({ - profToken, - onUpdate, - ...modalProps -}: ModalMypageModifyProps) => { +const ModalMypageModify = ({ ...modalProps }: ModalMypageModifyProps) => { const { t } = useTranslation("mypage"); const axios = useAxios(); @@ -227,9 +218,9 @@ const ModalMypageModify = ({
{loginInfo?.name}
{loginInfo?.profileImgUrl && ( - + )} - +
diff --git a/src/components/User/ProfileImage.tsx b/src/components/User/ProfileImage.tsx index ce2d6a9fb..657f4e2e8 100644 --- a/src/components/User/ProfileImage.tsx +++ b/src/components/User/ProfileImage.tsx @@ -1,20 +1,19 @@ import { useEffect, useState } from "react"; import theme from "@/tools/theme"; -import { getS3Url } from "@/tools/trans"; import defaultImg from "@/static/assets/profileImgOnError.png"; type ProfileImageProps = { url: string; - token?: string; }; -const ProfileImage = ({ url, token }: ProfileImageProps) => { - const getSrc = () => getS3Url(`/profile-img/${url}?token=${token || ""}`); - const [src, setSrc] = useState(getSrc()); +const ProfileImage = ({ url }: ProfileImageProps) => { + const [src, setSrc] = useState(url); - useEffect(() => setSrc(getSrc()), [url, token]); + useEffect(() => { + setSrc(url); + }, [url]); return (
{ const { t, i18n } = useTranslation("mypage"); - const [profImgToken, refreshProfImgToken] = useDateToken(); const loginInfo = useValueRecoilState("loginInfo"); const notificationOptions = useValueRecoilState("notificationOptions"); const { id: userId } = loginInfo || {}; @@ -102,10 +100,7 @@ const Mypage = () => {
{loginInfo?.profileImgUrl && ( - + )}
@@ -155,8 +150,6 @@ const Mypage = () => {