Skip to content

Commit

Permalink
Merge pull request #58 from feedback-forest/develop
Browse files Browse the repository at this point in the history
[Release] QA Bug Fix
  • Loading branch information
kyubumjang authored Oct 18, 2024
2 parents bd85cd2 + 8e1ec75 commit 75a7e6c
Show file tree
Hide file tree
Showing 24 changed files with 293 additions and 203 deletions.
4 changes: 4 additions & 0 deletions public/icons/sijak_footer_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/sijak_footer_logo.png
Binary file not shown.
11 changes: 0 additions & 11 deletions src/app/class/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,6 @@ const LectureInfoPage = () => {
/>
</Link>
</div>
{/* {isLoading && (
<div className="desktop:flex tablet:hidden mobile:hidden w-full">
<div className="flex flex-row w-full desktop:px-[120px] desktop:pt-[80px] gap-10">
<Skeleton className="desktop:w-[588px] tablet:w-[330px] desktop:h-[588px] tablet:h-[330px]" />
<div className="flex flex-col gap-6">
<LectureSummary lectureInfo={lectureInfo} isLoading={isLoading} />
<LectureMinimap lectureInfo={lectureInfo} isLoading={isLoading} />
</div>
</div>
</div>
)} */}
{renderSummary()}
{lectureInfo && (
<LectureDetail lectureInfo={lectureInfo} isLoading={isLoading} />
Expand Down
134 changes: 68 additions & 66 deletions src/app/like/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import {
import { useEffect, useState } from "react";

import Paginator from "@/shared/ui/Pagination/Paginator";
import { toast } from "sonner";
import useDeleteDeactivatesLikeLecture from "@/features/like/api/useDeleteDeactivatesLikeLecture";
import { useInView } from "react-intersection-observer";
import useLikeLectureList from "@/features/like/api/useLikeLectureList";
import { useToast } from "@/shared/hooks/useToast";

const LikePage = () => {
const [lectureListData, setLectureListData] = useState<
Expand All @@ -41,17 +41,19 @@ const LikePage = () => {
const [openDeleteLectureDialog, setOpenDeleteLectureDialog] =
useState<boolean>(false);

const { toast } = useToast();

const { control, watch } = useForm({
defaultValues: {
onlyCanApply: likeLectureParams.mode,
},
});

const { ref, inView } = useInView({
threshold: 1.0, // 100% 보일 때 트리거
});
// const { ref, inView } = useInView({
// threshold: 1.0, // 100% 보일 때 트리거
// });

const { data, isLoading, isSuccess, refetch } = useLikeLectureList({
const { data, isLoading, isSuccess } = useLikeLectureList({
page: likeLectureParams.page,
size: likeLectureParams.size,
mode: likeLectureParams.mode,
Expand All @@ -65,12 +67,12 @@ const LikePage = () => {
if (data?.data.data.some((lecture) => lecture.status === false)) {
deleteDeactivatesLecture.mutate(undefined, {
onSuccess: () => {
toast("마감된 찜 클래스를 삭제했어요");
toast({ title: "마감된 찜 클래스가 삭제됐어요." });
setOpenDeleteLectureDialog(false);
},
});
} else {
toast("마감된 찜 클래스가 없어요");
toast({ title: "마감된 찜 클래스가 없어요." });
setOpenDeleteLectureDialog(false);
}
};
Expand All @@ -93,6 +95,7 @@ const LikePage = () => {
// setHasNext(data.data.hasNext);
// }
// }, [data, isSuccess]);

useEffect(() => {
if (isSuccess) {
setLectureListData(data.data.data);
Expand All @@ -108,16 +111,16 @@ const LikePage = () => {
}));
}, [onlyCanApply]);

useEffect(() => {
if (inView && hasNext && !isLoading) {
setLikeLectureParams((prev) => {
return {
...prev,
page: prev.page + 1,
};
});
}
}, [inView, hasNext, isLoading]);
// useEffect(() => {
// if (inView && hasNext && !isLoading) {
// setLikeLectureParams((prev) => {
// return {
// ...prev,
// page: prev.page + 1,
// };
// });
// }
// }, [inView, hasNext, isLoading]);

const triggerItem = () => {
return (
Expand Down Expand Up @@ -197,7 +200,8 @@ const LikePage = () => {

return (
<NotFoundLecture
description="아직 찜한 클래스가 없습니다. 마음에 드는 강좌를 찾아 찜해보세요!"
description="아직 찜한 클래스가 없습니다."
subDescription="마음에 드는 강좌를 찾아 찜해보세요!"
isHideIcon
/>
);
Expand All @@ -218,56 +222,54 @@ const LikePage = () => {
</div>
</div>
</div>
<div className="flex flex-col desktop:pt-0 tablet:pt-10 pb-[209px] gap-20">
<div className="flex flex-col gap-4">
{!isLoading && lectureListData && lectureListData.length > 0 && (
<div className="flex justify-between desktop:px-[120px] tablet:px-8 mobile:px-6">
<div className="flex flex-row items-center gap-2">
<Controller
name="onlyCanApply"
control={control}
rules={{ required: false }}
render={({ field: { onChange, onBlur, value, ref } }) => (
// FIXME: 로직 확인 필요 - 멘토님 도움 필요
<Checkbox
id="onlyCanApply"
className="w-6 h-6"
checked={value}
onCheckedChange={(checked) => {
onChange(checked);
setLikeLectureParams((prev) => ({
...prev,
mode: !!checked,
page: 0,
}));
}}
onBlur={onBlur}
ref={ref}
/>
)}
/>
<Label
htmlFor="onlyCanApply"
className="text-base text-custom-textBlackColor"
>
<div className="desktop:flex tablet:flex mobile:hidden">
신청 가능한 클래스만 보기
</div>
<div className="desktop:hidden tablet:hidden mobile:flex">
신청 가능만 보기
</div>
</Label>
</div>
<UnifiedDialog
open={openDeleteLectureDialog}
setOpen={setOpenDeleteLectureDialog}
triggerItem={triggerItem()}
dialogTitle="로그아웃 다이얼로그"
dialogDescription="로그아웃 확인 다이얼로그"
dialogContent={dialogContent()}
<div className="flex flex-col w-full desktop:pt-0 tablet:pt-10 pb-[209px] gap-20">
<div className="flex flex-col gap-4">
<div className="flex justify-between desktop:px-[120px] tablet:px-8 mobile:px-6">
<div className="flex flex-row items-center gap-2">
<Controller
name="onlyCanApply"
control={control}
rules={{ required: false }}
render={({ field: { onChange, onBlur, value, ref } }) => (
// FIXME: 로직 확인 필요 - 멘토님 도움 필요
<Checkbox
id="onlyCanApply"
className="w-6 h-6"
checked={value}
onCheckedChange={(checked) => {
onChange(checked);
setLikeLectureParams((prev) => ({
...prev,
mode: !!checked,
page: 0,
}));
}}
onBlur={onBlur}
ref={ref}
/>
)}
/>
<Label
htmlFor="onlyCanApply"
className="text-base text-custom-textBlackColor"
>
<div className="desktop:flex tablet:flex mobile:hidden">
신청 가능한 클래스만 보기
</div>
<div className="desktop:hidden tablet:hidden mobile:flex">
신청 가능만 보기
</div>
</Label>
</div>
)}
<UnifiedDialog
open={openDeleteLectureDialog}
setOpen={setOpenDeleteLectureDialog}
triggerItem={triggerItem()}
dialogTitle="로그아웃 다이얼로그"
dialogDescription="로그아웃 확인 다이얼로그"
dialogContent={dialogContent()}
/>
</div>
<div className="flex items-center justify-center desktop:px-[120px] tablet:px-8 mobile:px-6">
{renderLikeCardContent()}
</div>
Expand Down
21 changes: 15 additions & 6 deletions src/app/login/callback/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ import { useRouter, useSearchParams } from "next/navigation";

import { SquareLoader } from "react-spinners";
import { setCookie } from "cookies-next";
import { toast } from "sonner";
import useGetAccessToken from "@/features/authentication/api/useGetAccessToken";
import useGetLoginUserInfo from "@/entities/user/api/useGetLoginUserInfo";
import useLoginedUserStore from "@/shared/store/user";
import { useToast } from "@/shared/hooks/useToast";

const LoginCallback = () => {
const router = useRouter();
const searchParams = useSearchParams();
const code = searchParams.get("code");

const { toast } = useToast();

// Access Token을 가져오는 훅
const {
data: tokenData,
Expand Down Expand Up @@ -56,9 +58,16 @@ const LoginCallback = () => {
// 로그인 사용자 정보 요청
if (isLoginUserSuccess) {
setLoginedUser(loginUserData.data.data);
toast("회원가입 / 로그인 성공", {
description: "시ː니어를 위한 문화생활 플랫폼에 오신 걸 환영합니다!",
});
if (tokenData.is_new === true) {
toast({
title: "회원가입이 완료되었습니다.",
});
}
if (tokenData.is_new === false) {
toast({
title: "로그인 성공!",
});
}

if (tokenData.is_new) {
router.push("/signup");
Expand All @@ -71,8 +80,8 @@ const LoginCallback = () => {
}

if (tokenError) {
toast("로그인 실패", {
description: `${tokenError}`,
toast({
title: "로그인 실패!",
});
}
}, [
Expand Down
18 changes: 13 additions & 5 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ const Home = () => {
);
}

return <NotFoundLecture />;
return (
<div className="flex w-full items-center justify-center">
<NotFoundLecture />
</div>
);
};

return (
Expand Down Expand Up @@ -339,7 +343,9 @@ const Home = () => {
</div>
</div>
</div>
<div>{renderHomeLectureList()}</div>
<div className="flex justify-center items-center">
{renderHomeLectureList()}
</div>
</div>
</div>
<div className="desktop:px-[120px] tablet:px-8 mobile:px-6 ">
Expand All @@ -349,16 +355,18 @@ const Home = () => {
<IntroductionBanner />
)}
</div>
<div className="flex flex-col pb-4 desktop:items-start tablet:items-start mobile:items-center desktop:justify-start tablet:justify-start mobile:justify-center desktop:px-[120px] tablet:px-8 mobile:px-6 desktop:gap-8 tablet:gap-5 mobile:gap-5">
<div className="flex flex-col mobile:w-[312px] gap-2">
<div className="flex flex-col pb-4 desktop:items-start tablet:items-center mobile:items-center desktop:justify-start tablet:justify-start mobile:justify-center desktop:px-[120px] tablet:px-8 mobile:px-6 desktop:gap-8 tablet:gap-5 mobile:gap-5">
<div className="flex flex-col tablet:w-[704px] mobile:w-[312px] gap-2">
<div className="font-bold desktop:text-2xl tablet:text-xl mobile:text-xl">
시ː작 PICK 클래스 📌
</div>
<div className="text-custom-tooltipBackground font-medium desktop:text-xl tablet:text-base mobile:text-base">
조회 수 많은 추천 클래스를 소개할게요!
</div>
</div>
<div>{renderPickLectureList()}</div>
<div className="flex justify-center items-center">
{renderPickLectureList()}
</div>
</div>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
BackToPrevious,
Button,
InputLabel,
RadioGroup,
RadioGroupItem,
Select,
SelectContent,
SelectGroup,
Expand All @@ -23,10 +21,10 @@ import { InputLabelStatus } from "@/shared/ui/InputLabel/InputLabel";
import { UserServiceAgreeDialog } from "@/entities/user/ui";
import axios from "axios";
import { debounce } from "lodash";
import { toast } from "sonner";
import useGetRandomNickname from "@/entities/user/api/useGetRandomNickname";
import usePostNickname from "@/entities/user/api/usePostNickname";
import { useRouter } from "next/navigation";
import { useToast } from "@/shared/hooks/useToast";
import useValidateNickname from "@/entities/user/api/useValidateNickname";
import { userAgeList } from "@/entities/user/model/user";

Expand Down Expand Up @@ -56,6 +54,7 @@ const SignUpPage = () => {
const getRandomNickname = useGetRandomNickname();
const validateNickname = useValidateNickname();
const postNickname = usePostNickname();
const { toast } = useToast();

const makeRandomNickname = () => {
getRandomNickname.mutate(undefined, {
Expand Down Expand Up @@ -115,7 +114,7 @@ const SignUpPage = () => {
},
{
onSuccess: () => {
toast("닉네임이 성공적으로 업데이트됐어요");
toast({ title: "시ː작에 오신 걸 환영합니다." });
router.push("/");
},
},
Expand Down
Loading

0 comments on commit 75a7e6c

Please sign in to comment.