Skip to content

Commit

Permalink
Merge pull request #359 from TripInfoWeb/dev_auth
Browse files Browse the repository at this point in the history
fix: 빌드 오류 수정
  • Loading branch information
ssssksss authored Sep 21, 2024
2 parents f7394c9 + 4ddfea3 commit a3e9b5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/components/mypage/MyProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const MyProfile = (props: IMyProfileProps) => {
>
<div
className={
"relative flex gap-y-[1rem] max-h-[24rem] p-[2.75rem] w-[calc(100vw-1rem)] max-w-[40rem] flex-col overflow-y-scroll rounded-b-xl bg-white scrollbar-hide"
"relative flex max-h-[24rem] w-[calc(100vw-1rem)] max-w-[40rem] flex-col gap-y-[1rem] overflow-y-scroll rounded-b-xl bg-white p-[2.75rem] scrollbar-hide"
}
>
<div className={"flex flex-col gap-y-[.5rem]"}>
Expand All @@ -53,8 +53,10 @@ const MyProfile = (props: IMyProfileProps) => {
</p>
<p>3. 필요한 정보는 회원탈퇴하기전에 따로 보관해주시기 바랍니다.</p>
</div>
<div className="select-none flex items-end gap-x-[.25rem]">
<span className={"text-main text-lg"}> '회원탈퇴를 하겠습니다.' </span>
<div className="flex select-none items-end gap-x-[.25rem]">
<span className={"text-lg text-main"}>
{`'회원탈퇴를 하겠습니다.'`}
</span>
<span> 라고 입력해주세요. </span>
</div>
<input
Expand All @@ -66,7 +68,7 @@ const MyProfile = (props: IMyProfileProps) => {
disabled={props.userDeleteText !== "회원탈퇴를 하겠습니다."}
onClick={props.userDeleteHandler}
className={
"h-[3rem] flex-shrink-0 w-full rounded-full bg-main text-white disabled:bg-gray2"
"h-[3rem] w-full flex-shrink-0 rounded-full bg-main text-white disabled:bg-gray2"
}
>
회원탈퇴
Expand Down Expand Up @@ -166,24 +168,22 @@ const MyProfile = (props: IMyProfileProps) => {
{props.userInfo.userImage.createdDate}
</span>
<div className="relative flex h-[2.5rem] w-[2.5rem] items-center justify-center rounded-[18px] bg-[#FEE501]">
{
props.userInfo.provider == "kakao" &&
{props.userInfo.provider == "kakao" && (
<Image
src={"/user/kakao-icon.svg"}
alt={"kakao-icon-image"}
width={20}
height={20}
/>
}
{
props.userInfo.provider == "google" &&
)}
{props.userInfo.provider == "google" && (
<Image
src={"/user/google-icon.svg"}
alt={"google-icon-image"}
width={20}
height={20}
/>
}
)}
</div>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/containers/auth/AuthKaKaoContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useAuthStore from "@/store/authStore";
import UrlQueryStringToObject from "@/utils/UrlQueryStringToObject";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
import { userResponseDto } from "../../types/UserDto";

const AuthKaKaoContainer = () => {
const router = useRouter();
Expand Down Expand Up @@ -37,7 +36,7 @@ const AuthKaKaoContainer = () => {
const userDataResponse = await fetch("/api/auth/user");
if (userDataResponse.status == 200) {
const userData = await userDataResponse.json();
authStore.setUser(userData as userResponseDto);
authStore.setUser(userData);
router.push("/");
} else {
throw new Error("Failed to fetch user data");
Expand Down
3 changes: 1 addition & 2 deletions src/containers/common/HeaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import Header from "@/components/common/Header";
import useAuthStore from "@/store/authStore";
import { userResponseDto } from "@/types/UserDto";
import { fetchWithAuth } from "@/utils/fetchWithAuth";
import { usePathname, useRouter } from "next/navigation";
import { useEffect, useState } from "react";
Expand Down Expand Up @@ -62,7 +61,7 @@ const HeaderContainer = () => {
try {
const data = await fetchWithAuth("/api/auth/user");
if (data.status == 200) {
data.json().then((res: userResponseDto) => {
data.json().then((res) => {
authStore.setUser(res);
});
} else {
Expand Down

0 comments on commit a3e9b5c

Please sign in to comment.