diff --git a/src/features/auth/ui/sign-up-modal.tsx b/src/features/auth/ui/sign-up-modal.tsx index e2b8e15b..c1fe8691 100644 --- a/src/features/auth/ui/sign-up-modal.tsx +++ b/src/features/auth/ui/sign-up-modal.tsx @@ -21,9 +21,7 @@ export default function SignupModal({ }) { const [name, setName] = useState(''); const [checked, setChecked] = useState(false); - const [image, setImage] = useState( - getCookie('socialImageURL') || 'profile-default.svg', - ); + const [image, setImage] = useState(getCookie('socialImageURL') || undefined); const fileInputRef = useRef(null); const signUp = useSignUpMutation(); diff --git a/src/features/my-page/consts/my-page-const.ts b/src/features/my-page/consts/my-page-const.ts index 5f909266..15b20a72 100644 --- a/src/features/my-page/consts/my-page-const.ts +++ b/src/features/my-page/consts/my-page-const.ts @@ -29,5 +29,3 @@ export const MBTI_OPTIONS = [ { label: 'ENFJ', value: 'ENFJ' }, { label: 'ENTJ', value: 'ENTJ' }, ]; - -export const DEFAULT_PROFILE_IMAGE_URL = '/profile-default.svg'; diff --git a/src/features/my-page/ui/profile-edit-modal.tsx b/src/features/my-page/ui/profile-edit-modal.tsx index 7d14986c..b9f2b7d9 100644 --- a/src/features/my-page/ui/profile-edit-modal.tsx +++ b/src/features/my-page/ui/profile-edit-modal.tsx @@ -16,11 +16,7 @@ import MultiItemSelector from '@/shared/ui/form/multi-item-selector'; import { BaseInput, TextAreaInput } from '@/shared/ui/input'; import { Modal } from '@/shared/ui/modal'; -import { - DEFAULT_OPTIONS, - DEFAULT_PROFILE_IMAGE_URL, - MBTI_OPTIONS, -} from '../consts/my-page-const'; +import { DEFAULT_OPTIONS, MBTI_OPTIONS } from '../consts/my-page-const'; import { ProfileFormSchema, type ProfileFormInput, @@ -83,7 +79,7 @@ function ProfileEditForm({ const [image, setImage] = useState( memberProfile.profileImage?.resizedImages?.[0]?.resizedImageUrl ?? - DEFAULT_PROFILE_IMAGE_URL, + undefined, ); const methods = useForm({ @@ -100,7 +96,7 @@ function ProfileEditForm({ const onValidSubmit = async (values: ProfileFormValues) => { const file = fileInputRef.current?.files?.[0]; const profileImageExtension = - image === DEFAULT_PROFILE_IMAGE_URL ? 'jpg' : file?.name.split('.').pop(); + image === undefined ? 'jpg' : file?.name.split('.').pop(); const payload = toUpdateProfilePayload(values, { profileImageExtension }); const updatedProfile = await updateProfile(payload); @@ -111,7 +107,7 @@ function ProfileEditForm({ if (file) { imageFormData.append('file', file); - } else if (image === DEFAULT_PROFILE_IMAGE_URL) { + } else if (image === undefined) { const defaultProfileImage = 'profile-default.jpg'; const response = await fetch(defaultProfileImage); const blob = await response.blob(); diff --git a/src/widgets/home/header.tsx b/src/widgets/home/header.tsx index 122b4b48..b120dcc6 100644 --- a/src/widgets/home/header.tsx +++ b/src/widgets/home/header.tsx @@ -23,7 +23,7 @@ export default async function Header() { const userInfo = userProfile?.memberProfile; const userImg = userProfile ? userInfo?.profileImage?.resizedImages[0].resizedImageUrl - : 'profile-default.svg'; + : undefined; return (