diff --git a/app/(route)/event/[eventId]/_components/tab/DescriptionTab.tsx b/app/(route)/event/[eventId]/_components/tab/DescriptionTab.tsx index c0384f7f..dc58f9de 100644 --- a/app/(route)/event/[eventId]/_components/tab/DescriptionTab.tsx +++ b/app/(route)/event/[eventId]/_components/tab/DescriptionTab.tsx @@ -1,6 +1,7 @@ "use client"; import Image from "next/image"; +import { useEffect, useState } from "react"; import { EventImageType } from "@/types/index"; interface Props { @@ -9,10 +10,16 @@ interface Props { } const DescriptionTab = ({ images, description }: Props) => { + const [sizes, setSizes] = useState("300px"); + + useEffect(() => { + setSizes("1000px"); + }, []); + return (

{description}

- {images?.map((image) => {"행사)} + {images?.map((image) => {"행사)}
); }; diff --git a/app/(route)/oauth/callback/[provider]/page.tsx b/app/(route)/oauth/callback/[provider]/page.tsx index 74060259..26ca7f8a 100644 --- a/app/(route)/oauth/callback/[provider]/page.tsx +++ b/app/(route)/oauth/callback/[provider]/page.tsx @@ -33,10 +33,10 @@ const OAuth = () => { return; } - router.back(); + router.push(pathname); router.refresh(); - } catch { - toast("네트워크 오류! 다시 시도해 주십시오.", { + } catch (e) { + toast.error("이미 가입한 이메일입니다.", { className: "text-16 font-600", }); router.push("/signin"); diff --git a/app/(route)/setting/profile/page.tsx b/app/(route)/setting/profile/page.tsx index 14d37047..fa82ceee 100644 --- a/app/(route)/setting/profile/page.tsx +++ b/app/(route)/setting/profile/page.tsx @@ -38,10 +38,18 @@ const ProfilePage = () => { if (!nickName || !session) { return; } - setSubmitState((prev) => ({ isError: false, isLoading: true })); + setSubmitState({ isError: false, isLoading: true }); setTimeout(async () => { try { + const nickNameRes = await instance.get("/users/nickname"); + if (nickNameRes.isDuplicated) { + toast.error("이미 사용 중인 닉네임입니다.", { + className: "text-16 font-600", + }); + return; + } + let url; if (!formState.dirtyFields.profileImage) { url = session.user.profileImage; diff --git a/app/(route)/signup/page.tsx b/app/(route)/signup/page.tsx index f5a9ad9a..3143d6ad 100644 --- a/app/(route)/signup/page.tsx +++ b/app/(route)/signup/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useRouter } from "next/navigation"; +import { useParams, useRouter, useSearchParams } from "next/navigation"; import { useState } from "react"; import MetaTag from "@/components/MetaTag"; import PinkLayout from "@/components/layout/PinkLayout"; @@ -25,6 +25,7 @@ const DEFAULT_VALUES = { }; const SignUp = () => { + const emailFromSignin = useSearchParams().get("email"); const router = useRouter(); const [pcWidth, setPcWidth] = useState<"narrow" | "wide">("narrow"); @@ -51,7 +52,7 @@ const SignUp = () => {
- formOptions={{ mode: "onBlur", defaultValues: DEFAULT_VALUES }}> + formOptions={{ mode: "onBlur", defaultValues: { ...DEFAULT_VALUES, email: emailFromSignin ?? "" } }}>
diff --git a/app/_api/api.ts b/app/_api/api.ts index 18be58e6..e50cf3c1 100644 --- a/app/_api/api.ts +++ b/app/_api/api.ts @@ -125,7 +125,7 @@ export class Api { return res; } - async delete(endPoint: T, body: DeleteBodyType) { + async delete(endPoint: T, body?: DeleteBodyType) { this.baseUrl = "/api" + endPoint; const newEndPoint = this.baseUrl; @@ -136,7 +136,7 @@ export class Api { "Content-type": "application/json", }, }; - const res = await fetch(newEndPoint); + const res = await fetch(newEndPoint, config); if (await this.updateToken(res)) { const refetchResult = await this.refetch(newEndPoint, config); return refetchResult; @@ -255,7 +255,9 @@ type GetQueryType = T extends "/event" ? Req_Query_Type["그룹조회"] : T extends "/artist" ? Req_Query_Type["멤버조회"] - : unknown; + : T extends "/users/nickname" + ? Req_Query_Type["닉네임"] + : unknown; // 사용하실 때 직접 추가 부탁드립니다! type PutBodyType = T extends `/event/${string}` ? Req_Post_Type["event"] diff --git a/app/_components/GenericFormProvider.tsx b/app/_components/GenericFormProvider.tsx index d84b5127..c91e7338 100644 --- a/app/_components/GenericFormProvider.tsx +++ b/app/_components/GenericFormProvider.tsx @@ -71,7 +71,7 @@ const GenericFormProvider = ({ children, formOptions }: G if (path === "/signup") { const res = await handleSignupSubmit(userInputValue, instance); if (!res.error) { - router.push("/"); + router.refresh(); } } }; diff --git a/app/_components/header/PcHeader.tsx b/app/_components/header/PcHeader.tsx index 711903df..25cd824a 100644 --- a/app/_components/header/PcHeader.tsx +++ b/app/_components/header/PcHeader.tsx @@ -30,7 +30,7 @@ const PcHeader = () => { return; } setSession(undefined); - }, [newSession?.isAuth]); + }, [newSession?.user.profileImage]); return (
diff --git a/app/_components/input/InputText.tsx b/app/_components/input/InputText.tsx index d6f074e9..638770e1 100644 --- a/app/_components/input/InputText.tsx +++ b/app/_components/input/InputText.tsx @@ -7,7 +7,7 @@ import ClearIcon from "@/public/icon/x_gray.svg"; interface Prop extends InputHTMLAttributes { children?: ReactNode; - type?: "text" | "password"; + type?: "text" | "password" | "email"; horizontal?: boolean; hint?: string; onKeyDown?: (e: KeyboardEvent) => void; @@ -117,8 +117,10 @@ const InputText: Function = ({ onKeyDown={onKeyDown} {...field} className={classNames( - "focus:border-1 mt-8 h-48 w-full rounded-sm bg-gray-50 px-16 py-12 pr-36 text-16 text-gray-900 placeholder:text-gray-400 focus:outline focus:outline-1 focus:outline-blue", - { "outline outline-1 outline-red": fieldState.error }, + "mt-8 h-48 w-full rounded-sm bg-gray-50 px-16 py-12 pr-36 text-16 text-gray-900 outline-none placeholder:text-gray-400 focus:border focus:border-blue", + { + "border border-red": fieldState.error, + }, )} />