From 2adcfc66f59737a086341e3818373e767afbacc0 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:14:10 +0900 Subject: [PATCH 01/14] =?UTF-8?q?refactor(user)=20:=20app=20router=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20=ED=81=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EC=96=B8=ED=8A=B8=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/next.config.js | 2 +- apps/user/src/app/layout.tsx | 28 +++++++++++ .../{pages/myinfo.tsx => app/myinfo/page.tsx} | 0 apps/user/src/app/page.tsx | 15 ++++++ .../src/{pages => app}/register/[grade].tsx | 0 .../src/{pages/sign.tsx => app/sign/page.tsx} | 2 +- apps/user/src/components/Auth/index.tsx | 2 + .../src/components/Home/Notifiction/index.tsx | 2 + apps/user/src/components/Home/index.tsx | 1 + .../src/components/common/Layout/index.tsx | 7 +-- .../components/common/Nav/NavItem/index.tsx | 5 +- .../src/components/common/Provider/index.tsx | 50 +++++++++---------- .../src/components/common/Provider/types.ts | 1 - apps/user/src/config/index.ts | 14 ------ .../user/src/hooks/Absence/useApplyAbsence.ts | 2 + .../src/hooks/Attendance/useAttendance.ts | 1 + apps/user/src/hooks/Auth/useLogin.ts | 2 +- apps/user/src/hooks/Auth/useLogout.ts | 2 +- apps/user/src/libs/Auth/customAxios.ts | 5 +- apps/user/src/libs/Style/registry.tsx | 30 +++++++++++ apps/user/src/pages/404.tsx | 7 --- apps/user/src/pages/_app.tsx | 17 ------- apps/user/src/pages/_document.tsx | 48 ------------------ apps/user/src/pages/_error.tsx | 16 ------ apps/user/src/pages/index.tsx | 48 ------------------ apps/user/src/pages/suggestion.tsx | 7 --- apps/user/src/queries/Member/Member.query.ts | 2 +- apps/user/tsconfig.json | 25 ++++++++-- .../components/UI/Select/Select.tsx | 2 + .../checkin-util/hooks/useBooleanState.ts | 2 + .../checkin-util/hooks/useOutsideClick.ts | 2 + packages/checkin-util/util/setLectureId.ts | 2 + 32 files changed, 146 insertions(+), 203 deletions(-) create mode 100644 apps/user/src/app/layout.tsx rename apps/user/src/{pages/myinfo.tsx => app/myinfo/page.tsx} (100%) create mode 100644 apps/user/src/app/page.tsx rename apps/user/src/{pages => app}/register/[grade].tsx (100%) rename apps/user/src/{pages/sign.tsx => app/sign/page.tsx} (64%) delete mode 100644 apps/user/src/config/index.ts create mode 100644 apps/user/src/libs/Style/registry.tsx delete mode 100644 apps/user/src/pages/404.tsx delete mode 100644 apps/user/src/pages/_app.tsx delete mode 100644 apps/user/src/pages/_document.tsx delete mode 100644 apps/user/src/pages/_error.tsx delete mode 100644 apps/user/src/pages/index.tsx delete mode 100644 apps/user/src/pages/suggestion.tsx diff --git a/apps/user/next.config.js b/apps/user/next.config.js index d940678..7d3f6a8 100644 --- a/apps/user/next.config.js +++ b/apps/user/next.config.js @@ -4,7 +4,7 @@ const { withSentryConfig } = require("@sentry/nextjs"); const ENV = { ENV: process.env.NODE_ENV ?? "", - API_HOST: process.env.API_HOST ?? process.env.REACT_APP_API_KEY, + API_HOST: process.env.API_HOST ?? process.env.NEXT_PUBLIC_BASE_URL, }; const nextConfig = { diff --git a/apps/user/src/app/layout.tsx b/apps/user/src/app/layout.tsx new file mode 100644 index 0000000..ef61e29 --- /dev/null +++ b/apps/user/src/app/layout.tsx @@ -0,0 +1,28 @@ +import Providers from "@/components/common/Provider"; +import StyledComponentsRegistry from "@/libs/Style/registry"; +import type { ReactNode } from "react"; +import PageLayout from "@/components/common/Layout"; +export const metadata = { + title: "교내 방과후 관리 시스템 | 체크인", + description: "교내 방과후 관리 시스템 체크인 입니다.", +}; + +interface Props { + children: ReactNode; +} + +const Layout = ({ children }: Props) => { + return ( + + + + + {children} + + + + + ); +}; + +export default Layout; diff --git a/apps/user/src/pages/myinfo.tsx b/apps/user/src/app/myinfo/page.tsx similarity index 100% rename from apps/user/src/pages/myinfo.tsx rename to apps/user/src/app/myinfo/page.tsx diff --git a/apps/user/src/app/page.tsx b/apps/user/src/app/page.tsx new file mode 100644 index 0000000..b3560fd --- /dev/null +++ b/apps/user/src/app/page.tsx @@ -0,0 +1,15 @@ +import Home from "@/components/Home"; +import Head from "next/head"; + +function HomePage() { + return ( + <> + + 홈 | check-in + + + + ); +} + +export default HomePage; diff --git a/apps/user/src/pages/register/[grade].tsx b/apps/user/src/app/register/[grade].tsx similarity index 100% rename from apps/user/src/pages/register/[grade].tsx rename to apps/user/src/app/register/[grade].tsx diff --git a/apps/user/src/pages/sign.tsx b/apps/user/src/app/sign/page.tsx similarity index 64% rename from apps/user/src/pages/sign.tsx rename to apps/user/src/app/sign/page.tsx index 6f426c7..c2e1d0b 100644 --- a/apps/user/src/pages/sign.tsx +++ b/apps/user/src/app/sign/page.tsx @@ -1,4 +1,4 @@ -import Auth from "../components/Auth"; +import Auth from "@/components/Auth"; const Signup = () => { return ; diff --git a/apps/user/src/components/Auth/index.tsx b/apps/user/src/components/Auth/index.tsx index fc1adfa..e62003c 100644 --- a/apps/user/src/components/Auth/index.tsx +++ b/apps/user/src/components/Auth/index.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState } from "react"; import AuthImg from "../../assets/Image/AuthImg.svg"; import Login from "./Login"; diff --git a/apps/user/src/components/Home/Notifiction/index.tsx b/apps/user/src/components/Home/Notifiction/index.tsx index 7ca5974..15c5be6 100644 --- a/apps/user/src/components/Home/Notifiction/index.tsx +++ b/apps/user/src/components/Home/Notifiction/index.tsx @@ -1,3 +1,5 @@ +"use client"; + import { CardTitle } from "@checkin/ui"; import React, { useState } from "react"; import { NotifictionIcon } from "@checkin/icon"; diff --git a/apps/user/src/components/Home/index.tsx b/apps/user/src/components/Home/index.tsx index 4468287..4a56524 100644 --- a/apps/user/src/components/Home/index.tsx +++ b/apps/user/src/components/Home/index.tsx @@ -1,3 +1,4 @@ +"use client"; import React from "react"; import * as S from "./style"; import { Flex } from "@checkin/ui"; diff --git a/apps/user/src/components/common/Layout/index.tsx b/apps/user/src/components/common/Layout/index.tsx index ee3564d..3cef64b 100644 --- a/apps/user/src/components/common/Layout/index.tsx +++ b/apps/user/src/components/common/Layout/index.tsx @@ -1,14 +1,15 @@ +"use client"; + import Nav from "../Nav"; import { Container, Wrap } from "./style"; -import { useRouter } from "next/router"; +import { usePathname } from "next/navigation"; interface Props { children: React.ReactNode; } const Layout = ({ children }: Props) => { - const { pathname } = useRouter(); - + const pathname = usePathname(); return ( <> diff --git a/apps/user/src/components/common/Nav/NavItem/index.tsx b/apps/user/src/components/common/Nav/NavItem/index.tsx index 67e9590..6f3d5a3 100644 --- a/apps/user/src/components/common/Nav/NavItem/index.tsx +++ b/apps/user/src/components/common/Nav/NavItem/index.tsx @@ -1,11 +1,10 @@ -import { useRouter } from "next/router"; import { NAV_ITEM } from "../constant"; import * as S from "./style"; import Link from "next/link"; +import { usePathname } from "next/navigation"; const NavItem = () => { - const { pathname } = useRouter(); - + const pathname = usePathname(); return ( {NAV_ITEM.map((data, idx) => ( diff --git a/apps/user/src/components/common/Provider/index.tsx b/apps/user/src/components/common/Provider/index.tsx index b5b2b7c..20dd42e 100644 --- a/apps/user/src/components/common/Provider/index.tsx +++ b/apps/user/src/components/common/Provider/index.tsx @@ -1,38 +1,38 @@ "use client"; import { ProvidersProps } from "./types"; -import React from "react"; +import React, { useState } from "react"; import { RecoilRoot } from "recoil"; -import { Hydrate, QueryClient, QueryClientProvider } from "react-query"; +import { QueryClient, QueryClientProvider } from "react-query"; import { CheckinToastContainer } from "@checkin/toast"; import { GlobalStyle } from "@checkin/styled-theme"; import { captureException } from "@sentry/nextjs"; -const queryClient = new QueryClient({ - defaultOptions: { - queries: { - retry: false, - retryOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - staleTime: 1000, - onError: (error) => { - captureException(error); - }, - }, - }, -}); - -const Providers = ({ children, pageProps }: ProvidersProps) => { +const Providers = ({ children }: ProvidersProps) => { + const [queryClient] = useState( + () => + new QueryClient({ + defaultOptions: { + queries: { + retry: false, + retryOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + staleTime: 1000, + onError: (error) => { + captureException(error); + }, + }, + }, + }) + ); return ( - - - - - {children} - - + + + + {children} + ); }; diff --git a/apps/user/src/components/common/Provider/types.ts b/apps/user/src/components/common/Provider/types.ts index 823d4d9..1889086 100644 --- a/apps/user/src/components/common/Provider/types.ts +++ b/apps/user/src/components/common/Provider/types.ts @@ -1,4 +1,3 @@ export interface ProvidersProps { children: React.ReactNode; - pageProps: any; } diff --git a/apps/user/src/config/index.ts b/apps/user/src/config/index.ts deleted file mode 100644 index dd21ef1..0000000 --- a/apps/user/src/config/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import getConfig from "next/config"; - -const { publicRuntimeConfig } = getConfig(); - -interface RuntimeConfig { - ENV: "production" | "development"; - API_HOST: string; -} - -const runtimeConfig: RuntimeConfig = publicRuntimeConfig; - -export const CONFIG: RuntimeConfig = { - ...runtimeConfig, -}; diff --git a/apps/user/src/hooks/Absence/useApplyAbsence.ts b/apps/user/src/hooks/Absence/useApplyAbsence.ts index f3f89cf..9717527 100644 --- a/apps/user/src/hooks/Absence/useApplyAbsence.ts +++ b/apps/user/src/hooks/Absence/useApplyAbsence.ts @@ -1,3 +1,5 @@ +"use client"; + import { useApplyAbsenceMutation } from "@/queries/Absence/query"; import { useGetTodayMyLecturesQuery } from "@/queries/Lectures/query"; import { CheckInQueryKey } from "@checkin/querykey"; diff --git a/apps/user/src/hooks/Attendance/useAttendance.ts b/apps/user/src/hooks/Attendance/useAttendance.ts index c94eebe..0a9a650 100644 --- a/apps/user/src/hooks/Attendance/useAttendance.ts +++ b/apps/user/src/hooks/Attendance/useAttendance.ts @@ -1,3 +1,4 @@ +"use client"; import { useAttendanceLectureMutation } from "@/queries/Attendance/query"; import { CheckinToast } from "@checkin/toast"; import { ChangeEvent, FormEvent, useState } from "react"; diff --git a/apps/user/src/hooks/Auth/useLogin.ts b/apps/user/src/hooks/Auth/useLogin.ts index 9b3ce18..b3387d4 100644 --- a/apps/user/src/hooks/Auth/useLogin.ts +++ b/apps/user/src/hooks/Auth/useLogin.ts @@ -1,4 +1,4 @@ -import { useRouter } from "next/router"; +import { useRouter } from "next/navigation"; import { FormEvent, useRef } from "react"; import { sha512 } from "js-sha512"; import { diff --git a/apps/user/src/hooks/Auth/useLogout.ts b/apps/user/src/hooks/Auth/useLogout.ts index 21d7d3b..c808642 100644 --- a/apps/user/src/hooks/Auth/useLogout.ts +++ b/apps/user/src/hooks/Auth/useLogout.ts @@ -1,5 +1,5 @@ import Token from "@/libs/token/Token"; -import { useRouter } from "next/router"; +import { useRouter } from "next/navigation"; const useLogout = () => { const router = useRouter(); diff --git a/apps/user/src/libs/Auth/customAxios.ts b/apps/user/src/libs/Auth/customAxios.ts index bae9ba1..0ebec0f 100644 --- a/apps/user/src/libs/Auth/customAxios.ts +++ b/apps/user/src/libs/Auth/customAxios.ts @@ -1,4 +1,3 @@ -import { CONFIG } from "@/config"; import axios, { AxiosRequestConfig } from "axios"; import { requestInterceptor } from "./requestInterceptor"; import { @@ -7,10 +6,8 @@ import { } from "@/constant/Token/Token.constant"; import Token from "../token/Token"; -export const apiHost = CONFIG.API_HOST; - const axiosRequestConfig: AxiosRequestConfig = { - baseURL: apiHost, + baseURL: process.env.NEXT_PUBLIC_BASE_URL, headers: { [REQUEST_TOKEN_KEY]: `Bearer ${Token.getToken(ACCESS_TOKEN_KEY)}`, }, diff --git a/apps/user/src/libs/Style/registry.tsx b/apps/user/src/libs/Style/registry.tsx new file mode 100644 index 0000000..c5fb9c5 --- /dev/null +++ b/apps/user/src/libs/Style/registry.tsx @@ -0,0 +1,30 @@ +"use client"; + +import { useServerInsertedHTML } from "next/navigation"; +import type { ReactNode } from "react"; +import { useState } from "react"; +import { ServerStyleSheet, StyleSheetManager } from "styled-components"; + +interface Props { + children: ReactNode; +} + +const StyledComponentsRegistry = ({ children }: Props) => { + const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet()); + + useServerInsertedHTML(() => { + const styles = styledComponentsStyleSheet.getStyleElement(); + styledComponentsStyleSheet.instance.clearTag(); + return <>{styles}; + }); + + if (typeof window !== "undefined") return <>{children}; + + return ( + + {children} + + ); +}; + +export default StyledComponentsRegistry; diff --git a/apps/user/src/pages/404.tsx b/apps/user/src/pages/404.tsx deleted file mode 100644 index 7952df5..0000000 --- a/apps/user/src/pages/404.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const ErrorPage = () => { - return
Loading...
; -}; - -export default ErrorPage; diff --git a/apps/user/src/pages/_app.tsx b/apps/user/src/pages/_app.tsx deleted file mode 100644 index 7cac6fc..0000000 --- a/apps/user/src/pages/_app.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import type { AppProps } from "next/app"; -import Providers from "@/components/common/Provider"; -import Layout from "@/components/common/Layout"; -import "@/styles/font.css"; -import "@/styles/reset.css"; - -export default function App({ Component, pageProps }: AppProps) { - return ( - <> - - - - - - - ); -} diff --git a/apps/user/src/pages/_document.tsx b/apps/user/src/pages/_document.tsx deleted file mode 100644 index 7c861de..0000000 --- a/apps/user/src/pages/_document.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import Document, { - Html, - Head, - Main, - NextScript, - DocumentContext, -} from "next/document"; -import { ServerStyleSheet } from "styled-components"; - -class MyDocument extends Document { - static async getInitialProps(ctx: DocumentContext) { - const sheet = new ServerStyleSheet(); - const originalRenderPage = ctx.renderPage; - try { - ctx.renderPage = () => - originalRenderPage({ - enhanceApp: (App) => (props) => - sheet.collectStyles(), - }); - - const initialProps = await Document.getInitialProps(ctx); - return { - ...initialProps, - styles: ( - <> - {initialProps.styles} - {sheet.getStyleElement()} - - ), - }; - } finally { - sheet.seal(); - } - } - render() { - return ( - - - -
- - - - ); - } -} - -export default MyDocument; diff --git a/apps/user/src/pages/_error.tsx b/apps/user/src/pages/_error.tsx deleted file mode 100644 index b893551..0000000 --- a/apps/user/src/pages/_error.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { NextPage } from "next"; -import { ErrorProps } from "next/error"; -import NextErrorComponent from "next/error"; -import { captureUnderscoreErrorException } from "@sentry/nextjs"; - -const CustomErrorComponent: NextPage = (props) => { - return ; -}; - -CustomErrorComponent.getInitialProps = async (contextData) => { - await captureUnderscoreErrorException(contextData); - - return NextErrorComponent.getInitialProps(contextData); -}; - -export default CustomErrorComponent; diff --git a/apps/user/src/pages/index.tsx b/apps/user/src/pages/index.tsx deleted file mode 100644 index 32ad226..0000000 --- a/apps/user/src/pages/index.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import withAuth from "@/HOF/withAuthHOF"; -import Home from "@/components/Home"; -import LectureRepositoryImpl from "@/repositories/LectureRepository/LectureRepositoryImpl"; -import NoticeRepositoryImpl from "@/repositories/NoticeRepository/NoticeRepositoryImpl"; -import { CheckInQueryKey } from "@checkin/querykey"; -import Head from "next/head"; -import { QueryClient, dehydrate } from "react-query"; - -function HomePage() { - return ( - <> - - 홈 | check-in - - - - ); -} - -export const getServerSideProps = withAuth(async () => { - const queryClient = new QueryClient(); - - await Promise.all([ - queryClient.prefetchQuery({ - queryKey: CheckInQueryKey.lecture.getToday, - queryFn: LectureRepositoryImpl.getTodayLecture, - cacheTime: 1000 * 60 * 60, - staleTime: 1000 * 60 * 60, - }), - - queryClient.prefetchQuery({ - queryKey: CheckInQueryKey.notice.getActive, - queryFn: NoticeRepositoryImpl.getActiveNotice, - }), - - queryClient.prefetchQuery({ - queryKey: CheckInQueryKey.lecture.getTodayMyLectures, - queryFn: LectureRepositoryImpl.getTodayMyLectures, - }), - ]); - return { - props: { - dehydratedState: dehydrate(queryClient), - }, - }; -}); - -export default HomePage; diff --git a/apps/user/src/pages/suggestion.tsx b/apps/user/src/pages/suggestion.tsx deleted file mode 100644 index e650627..0000000 --- a/apps/user/src/pages/suggestion.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import Suggestion from "@/components/Suggestion"; - -const SuggestionPage = () => { - return ; -}; - -export default SuggestionPage; diff --git a/apps/user/src/queries/Member/Member.query.ts b/apps/user/src/queries/Member/Member.query.ts index 2492eea..cd63ed1 100644 --- a/apps/user/src/queries/Member/Member.query.ts +++ b/apps/user/src/queries/Member/Member.query.ts @@ -1,11 +1,11 @@ import { UseQueryOptions, useQuery } from "react-query"; -import { QueryKey } from "../queryKey"; import { CheckinToast } from "@checkin/toast"; import { AxiosError } from "axios"; import { MemberType } from "@checkin/types"; import MemberRepositoryImpl from "@/repositories/MemberRepository/MemberRepositoryImpl"; import Token from "@/libs/token/Token"; import { CheckInQueryKey } from "@checkin/querykey"; + export const useGetMemberInfo = ( options?: UseQueryOptions ) => diff --git a/apps/user/tsconfig.json b/apps/user/tsconfig.json index 5ba7600..2d17336 100644 --- a/apps/user/tsconfig.json +++ b/apps/user/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -15,8 +19,12 @@ "jsx": "preserve", "incremental": true, "paths": { - "@/*": ["./src/*"], - "react": ["./node_modules/@types/react"] + "@/*": [ + "./src/*" + ], + "react": [ + "./node_modules/@types/react" + ] }, "plugins": [ { @@ -24,6 +32,13 @@ } ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] } diff --git a/packages/checkin-ui/components/UI/Select/Select.tsx b/packages/checkin-ui/components/UI/Select/Select.tsx index fffd0ad..5c06946 100644 --- a/packages/checkin-ui/components/UI/Select/Select.tsx +++ b/packages/checkin-ui/components/UI/Select/Select.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useState } from "react"; import { SelectContainer, diff --git a/packages/checkin-util/hooks/useBooleanState.ts b/packages/checkin-util/hooks/useBooleanState.ts index d52dca3..0052a1e 100644 --- a/packages/checkin-util/hooks/useBooleanState.ts +++ b/packages/checkin-util/hooks/useBooleanState.ts @@ -1,3 +1,5 @@ +"use client"; + import { useCallback, useState } from "react"; export const useBooleanState = (initialValue?: boolean) => { diff --git a/packages/checkin-util/hooks/useOutsideClick.ts b/packages/checkin-util/hooks/useOutsideClick.ts index a39ba4d..3e62b14 100644 --- a/packages/checkin-util/hooks/useOutsideClick.ts +++ b/packages/checkin-util/hooks/useOutsideClick.ts @@ -1,3 +1,5 @@ +"use client"; + import { useRef, useEffect } from "react"; export const useOutsideClick = (callback: () => void) => { diff --git a/packages/checkin-util/util/setLectureId.ts b/packages/checkin-util/util/setLectureId.ts index 09a785a..e67d23f 100644 --- a/packages/checkin-util/util/setLectureId.ts +++ b/packages/checkin-util/util/setLectureId.ts @@ -1,3 +1,5 @@ +"use client"; + import { LectureType } from "@checkin/types"; import { useState } from "react"; From abbf3b2a04614a832d4c4c81844dac7c04e6e5b0 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:42:50 +0900 Subject: [PATCH 02/14] =?UTF-8?q?fix(user)=20:=20getServerSideProps=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/app/myinfo/page.tsx | 21 --------------------- apps/user/src/app/register/[grade].tsx | 17 ----------------- 2 files changed, 38 deletions(-) diff --git a/apps/user/src/app/myinfo/page.tsx b/apps/user/src/app/myinfo/page.tsx index ca0ef9a..06eb77e 100644 --- a/apps/user/src/app/myinfo/page.tsx +++ b/apps/user/src/app/myinfo/page.tsx @@ -10,25 +10,4 @@ const myinfo = () => { return ; }; -export const getServerSideProps = withAuth(async () => { - const queryClient = new QueryClient(); - - await Promise.all([ - queryClient.prefetchQuery({ - queryKey: CheckInQueryKey.member.getMyLectures, - queryFn: LectureRepositoryImpl.getMyLectures, - }), - queryClient.prefetchQuery({ - queryKey: CheckInQueryKey.member.getMy, - queryFn: MemberRepositoryImpl.getMemberInfo, - }), - ]); - - return { - props: { - dehydratedState: dehydrate(queryClient), - }, - }; -}); - export default myinfo; diff --git a/apps/user/src/app/register/[grade].tsx b/apps/user/src/app/register/[grade].tsx index b8ad752..56d9ced 100644 --- a/apps/user/src/app/register/[grade].tsx +++ b/apps/user/src/app/register/[grade].tsx @@ -9,21 +9,4 @@ const RegisterPage = () => { return ; }; -export const getServerSideProps = withAuth( - async ({ query }: GetServerSidePropsContext) => { - const queryClient = new QueryClient(); - - await queryClient.prefetchQuery({ - queryKey: ["lectures/getEnrolmentLectures", Number(query.grade)], - queryFn: () => - LectureRepositoryImpl.getEnrolmentLectures(Number(query.grade)), - }); - - return { - props: { - dehydratedState: dehydrate(queryClient), - }, - }; - } -); export default RegisterPage; From e60edc829585094aa97cbd8b42fd27ae991590ab Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:08:00 +0900 Subject: [PATCH 03/14] =?UTF-8?q?feat(user)=20:=20suspensive=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20QueryClinetProvider=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/package.json | 2 + apps/user/src/app/layout.tsx | 12 +++- .../Provider/QueryClientProvider/index.tsx | 37 ++++++++++++ .../src/components/common/Provider/index.tsx | 33 ++++------- pnpm-lock.yaml | 59 +++++++++++++++++++ 5 files changed, 118 insertions(+), 25 deletions(-) create mode 100644 apps/user/src/components/common/Provider/QueryClientProvider/index.tsx diff --git a/apps/user/package.json b/apps/user/package.json index 0e74e80..fb88d18 100644 --- a/apps/user/package.json +++ b/apps/user/package.json @@ -17,6 +17,8 @@ "@checkin/ui": "workspace:*", "@checkin/util": "workspace:*", "@sentry/nextjs": "^7.82.0", + "@suspensive/react": "^1.23.2", + "@suspensive/react-query": "^1.23.2", "axios": "^1.4.0", "eslint": "8.45.0", "eslint-config-next": "13.4.12", diff --git a/apps/user/src/app/layout.tsx b/apps/user/src/app/layout.tsx index ef61e29..06e885e 100644 --- a/apps/user/src/app/layout.tsx +++ b/apps/user/src/app/layout.tsx @@ -2,6 +2,10 @@ import Providers from "@/components/common/Provider"; import StyledComponentsRegistry from "@/libs/Style/registry"; import type { ReactNode } from "react"; import PageLayout from "@/components/common/Layout"; +import "@/styles/font.css"; +import "@/styles/reset.css"; +import QueryClientProvider from "@/components/common/Provider/QueryClientProvider"; + export const metadata = { title: "교내 방과후 관리 시스템 | 체크인", description: "교내 방과후 관리 시스템 체크인 입니다.", @@ -16,9 +20,11 @@ const Layout = ({ children }: Props) => { - - {children} - + + + {children} + + diff --git a/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx b/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx new file mode 100644 index 0000000..bff13db --- /dev/null +++ b/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx @@ -0,0 +1,37 @@ +"use client"; + +import { captureException } from "@sentry/nextjs"; +import React, { useState } from "react"; +import { QueryClient } from "react-query"; +import type { ReactNode } from "react"; +import { QueryClientProvider as CheckInQueryClinetProvider } from "react-query"; +interface Props { + children: ReactNode; +} + +const QueryClientProvider = ({ children }: Props) => { + const [queryClient] = useState( + () => + new QueryClient({ + defaultOptions: { + queries: { + retry: false, + retryOnMount: false, + refetchOnWindowFocus: false, + refetchOnReconnect: false, + staleTime: 1000, + onError: (error) => { + captureException(error); + }, + }, + }, + }) + ); + return ( + + {children} + + ); +}; + +export default QueryClientProvider; diff --git a/apps/user/src/components/common/Provider/index.tsx b/apps/user/src/components/common/Provider/index.tsx index 20dd42e..79dee5a 100644 --- a/apps/user/src/components/common/Provider/index.tsx +++ b/apps/user/src/components/common/Provider/index.tsx @@ -1,39 +1,28 @@ "use client"; import { ProvidersProps } from "./types"; -import React, { useState } from "react"; +import React from "react"; import { RecoilRoot } from "recoil"; -import { QueryClient, QueryClientProvider } from "react-query"; import { CheckinToastContainer } from "@checkin/toast"; import { GlobalStyle } from "@checkin/styled-theme"; -import { captureException } from "@sentry/nextjs"; +import { Suspensive, SuspensiveProvider } from "@suspensive/react"; const Providers = ({ children }: ProvidersProps) => { - const [queryClient] = useState( - () => - new QueryClient({ - defaultOptions: { - queries: { - retry: false, - retryOnMount: false, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - staleTime: 1000, - onError: (error) => { - captureException(error); - }, - }, - }, - }) - ); + const suspensive = new Suspensive({ + defaultOptions: { + suspense: { + fallback: Loading..., + }, + }, + }); return ( - + {children} - + ); }; export default Providers; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f712b1..a79db7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -235,6 +235,12 @@ importers: '@sentry/nextjs': specifier: ^7.82.0 version: 7.82.0(next@13.4.12)(react@18.2.0) + '@suspensive/react': + specifier: ^1.23.2 + version: 1.23.2(react@18.2.0) + '@suspensive/react-query': + specifier: ^1.23.2 + version: 1.23.2(@suspensive/react@1.23.2)(@tanstack/react-query@4.36.1)(react@18.2.0) axios: specifier: ^1.4.0 version: 1.6.0 @@ -4192,12 +4198,57 @@ packages: resolve-from: 5.0.0 dev: true + /@suspensive/react-query@1.23.2(@suspensive/react@1.23.2)(@tanstack/react-query@4.36.1)(react@18.2.0): + resolution: {integrity: sha512-WAOvs38HnAd+xON1QQFd46UFsDe490+umrn7OjMrFFNt8FADKBl3S/g6K+nYgyDFkmE10Y+2efxQND9SVMNG6g==} + peerDependencies: + '@suspensive/react': ^1.23.2 + '@tanstack/react-query': ^4 + react: ^16.8 || ^17 || ^18 + peerDependenciesMeta: + '@suspensive/react': + optional: true + dependencies: + '@suspensive/react': 1.23.2(react@18.2.0) + '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + dev: false + + /@suspensive/react@1.23.2(react@18.2.0): + resolution: {integrity: sha512-Nko+aLI9a3+g8n+ZzEf54i3NF8u376eObbTcWaFJrl6RcXZG8yUvOi6FtEBKSvV7Cq/taoB9g8c7MzKX9EL5ww==} + peerDependencies: + react: ^16.8 || ^17 || ^18 + dependencies: + react: 18.2.0 + dev: false + /@swc/helpers@0.5.1: resolution: {integrity: sha512-sJ902EfIzn1Fa+qYmjdQqh8tPsoxyBz+8yBKC2HKUxyezKJFwPGOn7pv4WY6QuQW//ySQi5lJjA/ZT9sNWWNTg==} dependencies: tslib: 2.6.2 dev: false + /@tanstack/query-core@4.36.1: + resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==} + dev: false + + /@tanstack/react-query@4.36.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.36.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + use-sync-external-store: 1.2.0(react@18.2.0) + dev: false + /@testing-library/dom@8.20.1: resolution: {integrity: sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==} engines: {node: '>=12'} @@ -14029,6 +14080,14 @@ packages: react: 18.2.0 dev: false + /use-sync-external-store@1.2.0(react@18.2.0): + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + /use@3.1.1: resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} engines: {node: '>=0.10.0'} From 895be10c12d0973714e644a7c27596c594e274bf Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Tue, 16 Jan 2024 17:09:37 +0900 Subject: [PATCH 04/14] =?UTF-8?q?feat=20:=20UseQueryOptions=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/queries/Lectures/query.ts | 13 ++++++++++--- apps/user/src/queries/Notice/query.ts | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/user/src/queries/Lectures/query.ts b/apps/user/src/queries/Lectures/query.ts index 4dcf9b2..27697ee 100644 --- a/apps/user/src/queries/Lectures/query.ts +++ b/apps/user/src/queries/Lectures/query.ts @@ -1,5 +1,4 @@ import LectureRepositoryImpl from "@/repositories/LectureRepository/LectureRepositoryImpl"; -import { CheckInQueryKey } from "@checkin/querykey"; import { LecturesResponse } from "@checkin/types"; import { AxiosError } from "axios"; import { UseQueryOptions, useQuery } from "react-query"; @@ -55,11 +54,19 @@ export const useGetEnrolmentLecturesQuery = ( } ); -export const useGetTodayMyLecturesQuery = () => +export const useGetTodayMyLecturesQuery = ( + options?: UseQueryOptions< + LecturesResponse, + AxiosError, + LecturesResponse, + "lectures/getMyTodayLectures" + > +) => useQuery( - CheckInQueryKey.lecture.getTodayMyLectures, + "lectures/getMyTodayLectures", () => LectureRepositoryImpl.getTodayMyLectures(), { + ...options, staleTime: 1000 * 60 * 60, cacheTime: 1000 * 60 * 60, } diff --git a/apps/user/src/queries/Notice/query.ts b/apps/user/src/queries/Notice/query.ts index b2ed2b6..7f2b323 100644 --- a/apps/user/src/queries/Notice/query.ts +++ b/apps/user/src/queries/Notice/query.ts @@ -1,11 +1,21 @@ import NoticeRepositoryImpl from "@/repositories/NoticeRepository/NoticeRepositoryImpl"; -import { useQuery } from "react-query"; +import { NoticeResponse } from "@checkin/types"; +import { AxiosError } from "axios"; +import { UseQueryOptions, useQuery } from "react-query"; -export const useGetActiveNoticeQuery = () => +export const useGetActiveNoticeQuery = ( + options?: UseQueryOptions< + NoticeResponse, + AxiosError, + NoticeResponse, + "notice/activeNotice" + > +) => useQuery( "notice/activeNotice", () => NoticeRepositoryImpl.getActiveNotice(), { + ...options, cacheTime: 1000 * 60 * 60, staleTime: 1000 * 60 * 60, } From 8516a488ba66d824d6f5e1b2495dc3ef66241a18 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:26:45 +0900 Subject: [PATCH 05/14] =?UTF-8?q?chore=20:=20member,=20lecture,=20absence?= =?UTF-8?q?=20=ED=83=80=EC=9E=85=20=EC=9E=AC=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkin-types/Absence/Absence.type.ts | 57 ++++++++++--------- .../checkin-types/Lecture/Lecture.type.ts | 9 +++ packages/checkin-types/Member/Member.type.ts | 46 +++++++++------ 3 files changed, 69 insertions(+), 43 deletions(-) diff --git a/packages/checkin-types/Absence/Absence.type.ts b/packages/checkin-types/Absence/Absence.type.ts index c3669be..ee843f6 100644 --- a/packages/checkin-types/Absence/Absence.type.ts +++ b/packages/checkin-types/Absence/Absence.type.ts @@ -1,33 +1,38 @@ +import { MemberInfoData } from "../Member/Member.type"; + // export interface AbsenceType export interface AbsencesResponse { - data: [ - { - absenceId: { - value: number; - }; - absenceStatus: AbsenceStatus; - reason: string; - createdAt: string; - lectureId: { - value: number; - }; - attendanceId: { - value: number; - }; - absentee: { - memberId: { - value: string; + data: { + info: MemberInfoData; + absences: [ + { + absenceId: { + value: number; + }; + absenceStatus: AbsenceStatus; + reason: string; + createdAt: string; + lectureId: { + value: number; + }; + attendanceId: { + value: number; }; - name: string; - studentInfo: { - year: number; - grade: number; - room: number; - number: number; + absentee: { + memberId: { + value: string; + }; + name: string; + studentInfo: { + year: number; + grade: number; + room: number; + number: number; + }; }; - }; - } - ]; + } + ]; + }; } export type AbsenceStatus = diff --git a/packages/checkin-types/Lecture/Lecture.type.ts b/packages/checkin-types/Lecture/Lecture.type.ts index ef32877..f390bcf 100644 --- a/packages/checkin-types/Lecture/Lecture.type.ts +++ b/packages/checkin-types/Lecture/Lecture.type.ts @@ -1,3 +1,5 @@ +import { MemberInfoData } from "../Member/Member.type"; + export type LectureStatusType = | "WAITING_PERIOD" | "ENROLMENT" @@ -25,6 +27,13 @@ export interface LecturesResponse extends Response { data: LectureType[]; } +export interface MemberLecturesResponse extends Response { + data: { + info: MemberInfoData; + lectures: LectureType[]; + }; +} + export interface LecturesAllResponse extends Response { data: { waitingPeriod: LectureTagType[]; diff --git a/packages/checkin-types/Member/Member.type.ts b/packages/checkin-types/Member/Member.type.ts index f6ced71..a8d9197 100644 --- a/packages/checkin-types/Member/Member.type.ts +++ b/packages/checkin-types/Member/Member.type.ts @@ -1,24 +1,36 @@ import { Response } from "../util/response"; +interface StudentInfo { + grade: number; + room: number; + number: number; +} + +interface MemberTypeData { + id: string; + email: string; + name: string; + memberRole: string; + studentInfo: StudentInfo; +} + export interface MemberType extends Response { - data: { - id: string; - email: string; - name: string; - memberRole: string; - studentInfo: { - grade: number; - room: number; - number: number; - }; - }; + data: MemberTypeData; +} + +export interface MemberInfoData extends MemberTypeData { + subject: string; +} + +export interface MemberInfo { + info: MemberInfoData; +} + +export interface TeacherData { + id: string; + name: string; } export interface TeachersResponse extends Response { - data: [ - { - id: string; - name: string; - } - ]; + data: TeacherData[]; } From 7d3134b791be29d7e95161db0c3c876d6dd82c4d Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:34:54 +0900 Subject: [PATCH 06/14] =?UTF-8?q?chore=20:=20query=20option=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EB=A6=AC=EC=8A=A4=ED=8F=B0=EC=8A=A4=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/queries/Absence/query.ts | 26 ++++++++++++------- apps/user/src/queries/Lectures/query.ts | 6 ++--- .../LectureRepository/LectureRepository.ts | 9 +++++-- .../LectureRepositoryImpl.ts | 9 +++++-- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/apps/user/src/queries/Absence/query.ts b/apps/user/src/queries/Absence/query.ts index 6a07ab0..9ee8249 100644 --- a/apps/user/src/queries/Absence/query.ts +++ b/apps/user/src/queries/Absence/query.ts @@ -1,18 +1,24 @@ import AbsenceRepositoryImpl from "@/repositories/AbsenceRepository/AbsenceRepositoryImpl"; import { CheckInQueryKey } from "@checkin/querykey"; -import { useMutation, useQuery } from "react-query"; +import { AbsencesResponse } from "@checkin/types"; +import { AxiosError } from "axios"; +import { UseQueryOptions, useMutation, useQuery } from "react-query"; export const useApplyAbsenceMutation = () => { const mutation = useMutation(AbsenceRepositoryImpl.applyAbsence); return mutation; }; -export const useGetMyAbsenceQuery = () => - useQuery( - CheckInQueryKey.absence.getMy, - () => AbsenceRepositoryImpl.getMyAbsence(), - { - cacheTime: 1000 * 60 * 60, - staleTime: 1000 * 60 * 60, - } - ); +export const useGetMyAbsenceQuery = ( + options?: UseQueryOptions< + AbsencesResponse, + AxiosError, + AbsencesResponse, + "absence/myAbsence" + > +) => + useQuery("absence/myAbsence", () => AbsenceRepositoryImpl.getMyAbsence(), { + ...options, + cacheTime: 1000 * 60 * 60, + staleTime: 1000 * 60 * 60, + }); diff --git a/apps/user/src/queries/Lectures/query.ts b/apps/user/src/queries/Lectures/query.ts index 27697ee..ffbd4f4 100644 --- a/apps/user/src/queries/Lectures/query.ts +++ b/apps/user/src/queries/Lectures/query.ts @@ -1,5 +1,5 @@ import LectureRepositoryImpl from "@/repositories/LectureRepository/LectureRepositoryImpl"; -import { LecturesResponse } from "@checkin/types"; +import { LecturesResponse, MemberLecturesResponse } from "@checkin/types"; import { AxiosError } from "axios"; import { UseQueryOptions, useQuery } from "react-query"; @@ -23,9 +23,9 @@ export const useGetTodayLectures = ( export const useGetMyLectures = ( options?: UseQueryOptions< - LecturesResponse, + MemberLecturesResponse, AxiosError, - LecturesResponse, + MemberLecturesResponse, "lectures/myLectures" > ) => diff --git a/apps/user/src/repositories/LectureRepository/LectureRepository.ts b/apps/user/src/repositories/LectureRepository/LectureRepository.ts index 265036d..7986d5b 100644 --- a/apps/user/src/repositories/LectureRepository/LectureRepository.ts +++ b/apps/user/src/repositories/LectureRepository/LectureRepository.ts @@ -1,10 +1,15 @@ -import { LecturesResponse, Lectures, Response } from "@checkin/types"; +import { + LecturesResponse, + Lectures, + Response, + MemberLecturesResponse, +} from "@checkin/types"; export interface LectureRepository { enrolLecture(id: enroLectureByIdParam): Promise; getLectureById(id: getLectureByIdParam): Promise; getTodayLecture(): Promise; - getMyLectures(): Promise; + getMyLectures(): Promise; getEnrolmentLectures(grade: number): Promise; getTodayMyLectures(): Promise; getMemberLectures(): Promise; diff --git a/apps/user/src/repositories/LectureRepository/LectureRepositoryImpl.ts b/apps/user/src/repositories/LectureRepository/LectureRepositoryImpl.ts index 53e9ee7..2ab9449 100644 --- a/apps/user/src/repositories/LectureRepository/LectureRepositoryImpl.ts +++ b/apps/user/src/repositories/LectureRepository/LectureRepositoryImpl.ts @@ -1,4 +1,9 @@ -import { Lectures, LecturesResponse, Response } from "@checkin/types"; +import { + Lectures, + LecturesResponse, + MemberLecturesResponse, + Response, +} from "@checkin/types"; import { LectureRepository, enroLectureByIdParam, @@ -22,7 +27,7 @@ class LectureRepositoryImpl implements LectureRepository { return data; } - public async getMyLectures(): Promise { + public async getMyLectures(): Promise { const { data } = await apiClient.get("/lecture/my"); return data; } From 778058bd8ffb58c24fa495a4e77d110d41a96f42 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:36:20 +0900 Subject: [PATCH 07/14] =?UTF-8?q?refactor(user)=20:=20app=20router=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20suspense=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/app/myinfo/page.tsx | 13 ------- apps/user/src/app/profile/page.tsx | 8 ++++ apps/user/src/app/register/[grade].tsx | 12 ------ apps/user/src/app/register/[grade]/page.tsx | 8 ++++ apps/user/src/app/suggestion/page.tsx | 8 ++++ .../Home/Attend/AttendList/index.tsx | 7 ++-- .../user/src/components/Home/Attend/index.tsx | 34 +++++++--------- .../src/components/Home/Notifiction/index.tsx | 2 +- .../components/Home/TodayLectures/index.tsx | 37 ++++++++++++------ apps/user/src/components/Home/index.tsx | 26 +++++++++++-- .../Mypage/MyCancelLecture/index.tsx | 21 ++++------ .../components/Mypage/MyLectures/index.tsx | 14 +++---- .../components/Mypage/MypageForm/index.tsx | 17 ++++---- apps/user/src/components/Mypage/index.tsx | 39 ++++++++++--------- apps/user/src/components/Register/index.tsx | 6 ++- .../src/components/common/Nav/constant.ts | 4 +- 16 files changed, 142 insertions(+), 114 deletions(-) delete mode 100644 apps/user/src/app/myinfo/page.tsx create mode 100644 apps/user/src/app/profile/page.tsx delete mode 100644 apps/user/src/app/register/[grade].tsx create mode 100644 apps/user/src/app/register/[grade]/page.tsx create mode 100644 apps/user/src/app/suggestion/page.tsx diff --git a/apps/user/src/app/myinfo/page.tsx b/apps/user/src/app/myinfo/page.tsx deleted file mode 100644 index 06eb77e..0000000 --- a/apps/user/src/app/myinfo/page.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import withAuth from "@/HOF/withAuthHOF"; -import Mypage from "@/components/Mypage"; -import LectureRepositoryImpl from "@/repositories/LectureRepository/LectureRepositoryImpl"; -import MemberRepositoryImpl from "@/repositories/MemberRepository/MemberRepositoryImpl"; -import { CheckInQueryKey } from "@checkin/querykey"; -import React from "react"; -import { QueryClient, dehydrate } from "react-query"; - -const myinfo = () => { - return ; -}; - -export default myinfo; diff --git a/apps/user/src/app/profile/page.tsx b/apps/user/src/app/profile/page.tsx new file mode 100644 index 0000000..66eccf0 --- /dev/null +++ b/apps/user/src/app/profile/page.tsx @@ -0,0 +1,8 @@ +import Mypage from "@/components/Mypage"; +import React from "react"; + +const ProfilePage = () => { + return ; +}; + +export default ProfilePage; diff --git a/apps/user/src/app/register/[grade].tsx b/apps/user/src/app/register/[grade].tsx deleted file mode 100644 index 56d9ced..0000000 --- a/apps/user/src/app/register/[grade].tsx +++ /dev/null @@ -1,12 +0,0 @@ -import withAuth from "@/HOF/withAuthHOF"; -import Register from "@/components/Register"; -import LectureRepositoryImpl from "@/repositories/LectureRepository/LectureRepositoryImpl"; -import { GetServerSidePropsContext } from "next"; -import React from "react"; -import { QueryClient, dehydrate } from "react-query"; - -const RegisterPage = () => { - return ; -}; - -export default RegisterPage; diff --git a/apps/user/src/app/register/[grade]/page.tsx b/apps/user/src/app/register/[grade]/page.tsx new file mode 100644 index 0000000..97a6a7c --- /dev/null +++ b/apps/user/src/app/register/[grade]/page.tsx @@ -0,0 +1,8 @@ +import Register from "@/components/Register"; +import React from "react"; + +const RegisterPage = () => { + return ; +}; + +export default RegisterPage; diff --git a/apps/user/src/app/suggestion/page.tsx b/apps/user/src/app/suggestion/page.tsx new file mode 100644 index 0000000..06e316f --- /dev/null +++ b/apps/user/src/app/suggestion/page.tsx @@ -0,0 +1,8 @@ +import React from "react"; +import Suggestion from "@/components/Suggestion"; + +const SuggestionPage = () => { + return ; +}; + +export default SuggestionPage; diff --git a/apps/user/src/components/Home/Attend/AttendList/index.tsx b/apps/user/src/components/Home/Attend/AttendList/index.tsx index d2c7426..b0b1c22 100644 --- a/apps/user/src/components/Home/Attend/AttendList/index.tsx +++ b/apps/user/src/components/Home/Attend/AttendList/index.tsx @@ -1,15 +1,16 @@ import React from "react"; import * as S from "./style"; import { EnrolLectureBox } from "@checkin/ui"; -import { LecturesResponse } from "@checkin/types"; +import { useGetTodayMyLecturesQuery } from "@/queries/Lectures/query"; interface Props { - data: LecturesResponse; lectureId: number; onClickSetId: (value: number) => void; } -const AttendList = ({ data, lectureId, onClickSetId }: Props) => { +const AttendList = ({ lectureId, onClickSetId }: Props) => { + const { data } = useGetTodayMyLecturesQuery({ suspense: true }); + return ( {data?.data.map((data) => ( diff --git a/apps/user/src/components/Home/Attend/index.tsx b/apps/user/src/components/Home/Attend/index.tsx index 8914772..2c3fb55 100644 --- a/apps/user/src/components/Home/Attend/index.tsx +++ b/apps/user/src/components/Home/Attend/index.tsx @@ -1,10 +1,11 @@ +"use client"; + import { Card, CardTitle, Flex } from "@checkin/ui"; -import React from "react"; -import { CalendarIcon } from "@checkin/icon"; +import React, { Suspense } from "react"; import useAttendance from "@/hooks/Attendance/useAttendance"; import AttendList from "./AttendList"; import AttendLectureForm from "./AttendLectureForm"; -import { useGetTodayMyLecturesQuery } from "@/queries/Lectures/query"; +import { CalendarIcon } from "@checkin/icon"; const Attend = () => { const { @@ -14,31 +15,26 @@ const Attend = () => { onClickSetId, onChangeAttendanceCode, } = useAttendance(); - const { data } = useGetTodayMyLecturesQuery(); return ( - - - - 출석코드 입력 - - {data?.data.length === 0 ? ( - <>오늘은 방과후가 없습니다 - ) : ( + <> + + + + 출석코드 입력 + - + loading...}> + + - )} - + + ); }; diff --git a/apps/user/src/components/Home/Notifiction/index.tsx b/apps/user/src/components/Home/Notifiction/index.tsx index 15c5be6..7f75a1b 100644 --- a/apps/user/src/components/Home/Notifiction/index.tsx +++ b/apps/user/src/components/Home/Notifiction/index.tsx @@ -7,7 +7,7 @@ import { useGetActiveNoticeQuery } from "@/queries/Notice/query"; import { NoticeContainer, NoticeContent } from "./style"; const Notifiction = () => { - const { data } = useGetActiveNoticeQuery(); + const { data } = useGetActiveNoticeQuery({ suspense: true }); const [noticeLength, setNoticeLength] = useState(data?.data.length! - 1); setTimeout(() => { diff --git a/apps/user/src/components/Home/TodayLectures/index.tsx b/apps/user/src/components/Home/TodayLectures/index.tsx index 4a84db7..3f8f8f5 100644 --- a/apps/user/src/components/Home/TodayLectures/index.tsx +++ b/apps/user/src/components/Home/TodayLectures/index.tsx @@ -1,21 +1,36 @@ -import { Card, CardTitle } from "@checkin/ui"; import React from "react"; import TodayLaectureList from "./TodayLectureList"; -import { LectureIcon } from "@checkin/icon"; import { useGetTodayLectures } from "@/queries/Lectures/query"; +import { LectureListWrapper } from "./TodayLectureList/style"; +import { LectureBox } from "@checkin/ui"; const TodayLectures = () => { - const { data } = useGetTodayLectures(); + const { data } = useGetTodayLectures({ suspense: true }); return ( - - - - 오늘의 방과후 - - {data?.data.length === 0 &&
오늘의 방과후는 없습니다
} - {data?.data && } -
+ <> + {data?.data.length === 0 ? ( +
오늘의 방과후는 없습니다
+ ) : ( +
+ +
+ {data?.data.map((data) => ( + + ))} +
+
+
+ )} + ); }; diff --git a/apps/user/src/components/Home/index.tsx b/apps/user/src/components/Home/index.tsx index 4a56524..5e3cc96 100644 --- a/apps/user/src/components/Home/index.tsx +++ b/apps/user/src/components/Home/index.tsx @@ -1,17 +1,37 @@ "use client"; + import React from "react"; import * as S from "./style"; -import { Flex } from "@checkin/ui"; +import { Card, CardTitle, Flex } from "@checkin/ui"; import TodayLectures from "./TodayLectures"; import Notifiction from "./Notifiction"; import Absence from "./Absence"; import Attend from "./Attend"; +import { Suspense } from "@suspensive/react"; +import { CalendarIcon, LectureIcon } from "@checkin/icon"; +import Token from "@/libs/token/Token"; +import { ACCESS_TOKEN_KEY } from "@/constant/Token/Token.constant"; const Home = () => { return ( - - + + + + 오늘의 방과후 + + loading...} + > + + + + + loading} + > + + { + const { data: myAbsenceData } = useGetMyAbsenceQuery({ suspense: true }); -const MyCancelLectures = ({ grade, name, number, room }: Props) => { - const { data: myAbsenceData } = useGetMyAbsenceQuery(); return ( - {myAbsenceData?.data.map((data) => ( + {myAbsenceData?.data.absences[0] === undefined && 없다} + {myAbsenceData?.data.absences.map((data) => ( ))} diff --git a/apps/user/src/components/Mypage/MyLectures/index.tsx b/apps/user/src/components/Mypage/MyLectures/index.tsx index 9b67dc9..5f519ef 100644 --- a/apps/user/src/components/Mypage/MyLectures/index.tsx +++ b/apps/user/src/components/Mypage/MyLectures/index.tsx @@ -2,19 +2,19 @@ import { LectureTagBox } from "@checkin/ui"; import React from "react"; import { MyLectusContainer } from "./style"; import { LecturesResponse } from "@checkin/types"; +import { useGetMyLectures } from "@/queries/Lectures/query"; -interface Props { - serverMemberLecturesData: LecturesResponse; -} - -const MyLectures = ({ serverMemberLecturesData }: Props) => { +const MyLectures = () => { + const { data: serverMemberLecturesData } = useGetMyLectures({ + suspense: true, + }); return ( <> - {serverMemberLecturesData.data.length === 0 && ( + {serverMemberLecturesData?.data.lectures.length === 0 && (
신청된 방과후가 없습니다
)} - {serverMemberLecturesData.data.map((data) => ( + {serverMemberLecturesData?.data.lectures.map((data) => ( { - const { email, id, memberRole, name, studentInfo } = serverMyInfo.data; +const MypageForm = () => { + const { data } = useGetMemberInfo({ suspense: true }); return ( @@ -22,13 +19,13 @@ const MypageForm = ({ serverMyInfo }: Props) => {
@@ -36,13 +33,13 @@ const MypageForm = ({ serverMyInfo }: Props) => { diff --git a/apps/user/src/components/Mypage/index.tsx b/apps/user/src/components/Mypage/index.tsx index 8727349..c241c09 100644 --- a/apps/user/src/components/Mypage/index.tsx +++ b/apps/user/src/components/Mypage/index.tsx @@ -1,32 +1,35 @@ -import React from "react"; +"use client"; + +import React, { Suspense } from "react"; import { SectionHeader } from "@checkin/ui"; import * as S from "./style"; import MypageForm from "./MypageForm"; import MyCancelLectures from "./MyCancelLecture"; import MyLectures from "./MyLectures"; import { useGetMemberInfo } from "@/queries/Member/Member.query"; -import { useGetMyLectures } from "@/queries/Lectures/query"; + const Mypage = () => { - const { data: serverMemberLecturesData } = useGetMyLectures(); - const { data: serverMyInfo } = useGetMemberInfo(); - const { name } = serverMyInfo?.data!; - const { grade, number, room } = serverMyInfo?.data.studentInfo!; + const { data } = useGetMemberInfo(); + return ( - + loading...}> + + + {`${ + data?.data.name === undefined ? "홍길동" : data.data.name + }님의 방과후`} + + loading...}> + + {`${serverMyInfo?.data.name}님의 방과후`} - {serverMemberLecturesData?.data ? ( - - ) : ( - <>Server Error... - )} - - {`${serverMyInfo?.data.name}님의 결강신청`} - - + style={{ marginTop: "22px" }} + >{`${data?.data.name}님의 결강신청`} + loading...}> + + ); }; diff --git a/apps/user/src/components/Register/index.tsx b/apps/user/src/components/Register/index.tsx index da7737d..85aa4ce 100644 --- a/apps/user/src/components/Register/index.tsx +++ b/apps/user/src/components/Register/index.tsx @@ -1,11 +1,13 @@ +"use client"; + import Link from "next/link"; import RegistList from "./RegistList"; import * as S from "./style"; import { Button, ButtonWrapper, SectionHeader } from "@checkin/ui"; -import { useRouter } from "next/router"; +import { useParams } from "next/navigation"; const Register = () => { - const { query } = useRouter(); + const query = useParams(); return ( diff --git a/apps/user/src/components/common/Nav/constant.ts b/apps/user/src/components/common/Nav/constant.ts index 4b7d159..ca841f4 100644 --- a/apps/user/src/components/common/Nav/constant.ts +++ b/apps/user/src/components/common/Nav/constant.ts @@ -15,8 +15,8 @@ export const NAV_ITEM = [ }, { title: "마이페이지", - pathname: "/myinfo", - path: "/myinfo", + pathname: "/profile", + path: "/profile", icon: MypageIcon, }, ]; From 447a96f8530286171a9c5182f33e1cb829a3f42b Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:54:25 +0900 Subject: [PATCH 08/14] =?UTF-8?q?chore(user)=20:=20Nav=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EB=A7=A4=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/components/common/Nav/NavItem/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/user/src/components/common/Nav/NavItem/index.tsx b/apps/user/src/components/common/Nav/NavItem/index.tsx index 6f3d5a3..c468c76 100644 --- a/apps/user/src/components/common/Nav/NavItem/index.tsx +++ b/apps/user/src/components/common/Nav/NavItem/index.tsx @@ -5,15 +5,21 @@ import { usePathname } from "next/navigation"; const NavItem = () => { const pathname = usePathname(); + + const isPathMatch = (path: string, currentPath: string): boolean => { + const regex = new RegExp(`^${path.replace(/\[.*\]/, "\\d+")}$`); + return regex.test(currentPath); + }; + return ( {NAV_ITEM.map((data, idx) => ( - + {data.title} From a81aa1f161e36b2de77ad02e8c296bfc4fe636f5 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:54:50 +0900 Subject: [PATCH 09/14] =?UTF-8?q?chore(user)=20:=20=EC=88=98=EC=97=85=20?= =?UTF-8?q?=EC=A0=9C=EC=95=88=20=ED=81=B4=EB=9D=BC=EC=9D=B4=EC=96=B8?= =?UTF-8?q?=ED=8A=B8=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/components/Suggestion/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/user/src/components/Suggestion/index.tsx b/apps/user/src/components/Suggestion/index.tsx index e61b698..cf95aa5 100644 --- a/apps/user/src/components/Suggestion/index.tsx +++ b/apps/user/src/components/Suggestion/index.tsx @@ -1,3 +1,5 @@ +"use client"; + import React from "react"; import * as S from "./style"; import { SectionHeader } from "@checkin/ui"; From ebaa26b29b3527cea3a4cf7e8b3cefe6d88900bb Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:34:33 +0900 Subject: [PATCH 10/14] =?UTF-8?q?test(user)=20:=20susepnse=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/components/Home/Attend/index.tsx | 6 ++---- .../common/Provider/QueryClientProvider/index.tsx | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/user/src/components/Home/Attend/index.tsx b/apps/user/src/components/Home/Attend/index.tsx index 2c3fb55..3a6270c 100644 --- a/apps/user/src/components/Home/Attend/index.tsx +++ b/apps/user/src/components/Home/Attend/index.tsx @@ -1,7 +1,7 @@ "use client"; import { Card, CardTitle, Flex } from "@checkin/ui"; -import React, { Suspense } from "react"; +import React from "react"; import useAttendance from "@/hooks/Attendance/useAttendance"; import AttendList from "./AttendList"; import AttendLectureForm from "./AttendLectureForm"; @@ -24,9 +24,7 @@ const Attend = () => { 출석코드 입력 - loading...}> - - + { new QueryClient({ defaultOptions: { queries: { - retry: false, - retryOnMount: false, refetchOnWindowFocus: false, - refetchOnReconnect: false, - staleTime: 1000, onError: (error) => { captureException(error); }, From d23ba3589e62178f151e2f85d17f5a9ef600e6f6 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:50:27 +0900 Subject: [PATCH 11/14] =?UTF-8?q?chore(user)=20:=20sentry=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/next.config.js | 10 +--------- apps/user/package.json | 1 - apps/user/sentry.client.config.ts | 13 +------------ apps/user/sentry.server.config.ts | 10 +--------- .../common/Provider/QueryClientProvider/index.tsx | 4 ---- pnpm-lock.yaml | 3 --- 6 files changed, 3 insertions(+), 38 deletions(-) diff --git a/apps/user/next.config.js b/apps/user/next.config.js index 7d3f6a8..4903d6f 100644 --- a/apps/user/next.config.js +++ b/apps/user/next.config.js @@ -1,7 +1,5 @@ /** @type {import('next').NextConfig} */ -const { withSentryConfig } = require("@sentry/nextjs"); - const ENV = { ENV: process.env.NODE_ENV ?? "", API_HOST: process.env.API_HOST ?? process.env.NEXT_PUBLIC_BASE_URL, @@ -19,12 +17,6 @@ const nextConfig = { publicRuntimeConfig: { ...ENV }, }; -const sentryWebpackPluginOptions = { - org: "checkin", - project: "checkin-user", - slient: true, -}; - -module.exports = withSentryConfig(nextConfig, sentryWebpackPluginOptions); +module.exports = nextConfig; // Injected content via Sentry wizard below diff --git a/apps/user/package.json b/apps/user/package.json index fb88d18..782f3ff 100644 --- a/apps/user/package.json +++ b/apps/user/package.json @@ -16,7 +16,6 @@ "@checkin/types": "workspace:*", "@checkin/ui": "workspace:*", "@checkin/util": "workspace:*", - "@sentry/nextjs": "^7.82.0", "@suspensive/react": "^1.23.2", "@suspensive/react-query": "^1.23.2", "axios": "^1.4.0", diff --git a/apps/user/sentry.client.config.ts b/apps/user/sentry.client.config.ts index a7c583e..0519ecb 100644 --- a/apps/user/sentry.client.config.ts +++ b/apps/user/sentry.client.config.ts @@ -1,12 +1 @@ -import * as Sentry from "@sentry/nextjs"; - -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; - -Sentry.init({ - dsn: SENTRY_DSN || "", - integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], - tracesSampleRate: 1.0, - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, - environment: process.env.NODE_ENV, -}); + \ No newline at end of file diff --git a/apps/user/sentry.server.config.ts b/apps/user/sentry.server.config.ts index 651c140..0519ecb 100644 --- a/apps/user/sentry.server.config.ts +++ b/apps/user/sentry.server.config.ts @@ -1,9 +1 @@ -import * as Sentry from "@sentry/nextjs"; - -const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; - -Sentry.init({ - dsn: SENTRY_DSN || "", - tracesSampleRate: 1.0, - environment: process.env.NODE_ENV, -}); + \ No newline at end of file diff --git a/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx b/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx index 339bda9..e1dd396 100644 --- a/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx +++ b/apps/user/src/components/common/Provider/QueryClientProvider/index.tsx @@ -1,6 +1,5 @@ "use client"; -import { captureException } from "@sentry/nextjs"; import React, { useState } from "react"; import { QueryClient } from "react-query"; import type { ReactNode } from "react"; @@ -16,9 +15,6 @@ const QueryClientProvider = ({ children }: Props) => { defaultOptions: { queries: { refetchOnWindowFocus: false, - onError: (error) => { - captureException(error); - }, }, }, }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a79db7d..f981f57 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -232,9 +232,6 @@ importers: '@checkin/util': specifier: workspace:* version: link:../../packages/checkin-util - '@sentry/nextjs': - specifier: ^7.82.0 - version: 7.82.0(next@13.4.12)(react@18.2.0) '@suspensive/react': specifier: ^1.23.2 version: 1.23.2(react@18.2.0) From 31072caabe0563e5bd30a0e5e6e0b569ba6c2b05 Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:00:35 +0900 Subject: [PATCH 12/14] =?UTF-8?q?delete(user)=20:=20sentry=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/sentry.client.config.ts | 1 - apps/user/sentry.server.config.ts | 1 - 2 files changed, 2 deletions(-) delete mode 100644 apps/user/sentry.client.config.ts delete mode 100644 apps/user/sentry.server.config.ts diff --git a/apps/user/sentry.client.config.ts b/apps/user/sentry.client.config.ts deleted file mode 100644 index 0519ecb..0000000 --- a/apps/user/sentry.client.config.ts +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/user/sentry.server.config.ts b/apps/user/sentry.server.config.ts deleted file mode 100644 index 0519ecb..0000000 --- a/apps/user/sentry.server.config.ts +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From e08f449b3a5b112c69856b3c04eed397cfd5c4ce Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Sat, 20 Jan 2024 00:15:27 +0900 Subject: [PATCH 13/14] =?UTF-8?q?chore(admin)=20:=20=EA=B2=B0=EA=B0=95=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8F=B0=EC=8A=A4=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/src/components/Absence/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/admin/src/components/Absence/index.tsx b/apps/admin/src/components/Absence/index.tsx index 1417ed4..5c5ff05 100644 --- a/apps/admin/src/components/Absence/index.tsx +++ b/apps/admin/src/components/Absence/index.tsx @@ -42,7 +42,7 @@ const Absence = () => { /> - {data?.data.map((data) => ( + {data?.data.absences.map((data) => ( From 4bdcbb51bdb7c948549b8dadc4aa877d25ae6bce Mon Sep 17 00:00:00 2001 From: baekseungha <101560680+BaekSeungHa@users.noreply.github.com> Date: Sat, 20 Jan 2024 00:16:00 +0900 Subject: [PATCH 14/14] =?UTF-8?q?chore(user)=20:=20use=20client=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20susepnse=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/components/Home/Attend/AttendList/index.tsx | 2 +- apps/user/src/hooks/Suggestion/useSuggestionLecture.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/user/src/components/Home/Attend/AttendList/index.tsx b/apps/user/src/components/Home/Attend/AttendList/index.tsx index b0b1c22..2a4cbae 100644 --- a/apps/user/src/components/Home/Attend/AttendList/index.tsx +++ b/apps/user/src/components/Home/Attend/AttendList/index.tsx @@ -9,7 +9,7 @@ interface Props { } const AttendList = ({ lectureId, onClickSetId }: Props) => { - const { data } = useGetTodayMyLecturesQuery({ suspense: true }); + const { data } = useGetTodayMyLecturesQuery(); return ( diff --git a/apps/user/src/hooks/Suggestion/useSuggestionLecture.ts b/apps/user/src/hooks/Suggestion/useSuggestionLecture.ts index a5a3ce3..6feaf23 100644 --- a/apps/user/src/hooks/Suggestion/useSuggestionLecture.ts +++ b/apps/user/src/hooks/Suggestion/useSuggestionLecture.ts @@ -1,3 +1,5 @@ +"use client"; + import { usePostSuggestionMutation } from "@/queries/Suggestion/query"; import { CheckinToast } from "@checkin/toast"; import { dataTransform } from "@checkin/util";