-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
271 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
|
||
import WeatherBar from "@/component/WeatherBar"; | ||
import Image from "next/image"; | ||
|
||
export default function Detail(): JSX.Element { | ||
return ( | ||
<div className="container"> | ||
<div className="w-full h-12 flex items-center "> | ||
<Image src="/images/back.svg" width={15} height={15} alt="back" /> | ||
</div> | ||
<hr className="w-full h-px" /> | ||
<WeatherBar /> | ||
<hr className="w-full h-px" /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
"use client"; | ||
import { useState } from "react"; | ||
import { useRouter } from "next/router"; | ||
import { useSession } from "next-auth/react"; | ||
import axios from "axios"; | ||
|
||
export default function CompleteProfile() { | ||
const [name, setName] = useState<string>(""); | ||
const [nickname, setNickname] = useState<string>(""); | ||
const router = useRouter(); | ||
const { data: session } = useSession(); | ||
|
||
// 닉네임 설정 완료 후 다음 단계로 이동 | ||
const handleNicknameSubmit = async (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault(); | ||
try { | ||
const response = await axios({ | ||
method: "POST", | ||
url: "", | ||
data: { | ||
name, | ||
nickname, | ||
}, | ||
}); | ||
router.push("/"); | ||
} catch (error) { | ||
console.error("닉네임 저장 오류:", error); | ||
} | ||
}; | ||
|
||
if (!session) { | ||
router.push("/login"); | ||
return null; | ||
} | ||
|
||
return ( | ||
<div> | ||
<h1>닉네임 설정</h1> | ||
<form onSubmit={handleNicknameSubmit}> | ||
<input | ||
type="text" | ||
placeholder="이름을 입력하세요" | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
/> | ||
<input | ||
type="text" | ||
placeholder="닉네임을 입력하세요" | ||
value={nickname} | ||
onChange={(e) => setNickname(e.target.value)} | ||
/> | ||
<button type="submit">저장</button> | ||
</form> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.