From c5778263be88e503a4712ad57a26c4c2f8d172d1 Mon Sep 17 00:00:00 2001 From: FIRO <72495729+iamfiro@users.noreply.github.com> Date: Sun, 9 Mar 2025 14:30:19 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=A7=20update=20@tapie-kr/api-clien?= =?UTF-8?q?t=20version=20to=200.1.17=20in=20package.json=20and=20pnpm-lock?= =?UTF-8?q?.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/tapie/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/tapie/package.json b/packages/tapie/package.json index f2b3cb2..ea8adf7 100644 --- a/packages/tapie/package.json +++ b/packages/tapie/package.json @@ -24,7 +24,7 @@ "@js-temporal/polyfill": "^0.4.4", "@sentry/nextjs": "^9", "@svgr/webpack": "^8.1.0", - "@tapie-kr/api-client": "0.1.16", + "@tapie-kr/api-client": "0.1.17", "@tapie-kr/api-database": "^0.0.3", "@tapie-kr/inspire-react": "^0.2.15", "@tapie-kr/web-shared": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06480e9..e8a3f6d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ importers: specifier: ^8.1.0 version: 8.1.0(typescript@5.7.3) '@tapie-kr/api-client': - specifier: 0.1.16 - version: 0.1.16(axios@1.8.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(zod@3.24.2) + specifier: 0.1.17 + version: 0.1.17(axios@1.8.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(zod@3.24.2) '@tapie-kr/api-database': specifier: ^0.0.3 version: 0.0.3(@prisma/client@6.2.1(prisma@6.2.1))(prisma@6.2.1) @@ -2102,8 +2102,8 @@ packages: react-dom: ^19.0.0 zod: ^3.24.2 - '@tapie-kr/api-client@0.1.16': - resolution: {integrity: sha512-d6QIfh6HO5u7Ni65/b5gzm6ZGcSLgjo4UTYgQp0cvaw3S3Nl/N7Xjd7Pf1ZYgGSv4VIL6kwNgbSeBnoB08+48Q==} + '@tapie-kr/api-client@0.1.17': + resolution: {integrity: sha512-Pm2rLd0b0SoYnWxtyyk7Qg3fC+kF17FvHOU2XKzl9Oue5YFmlXbEu+mxw3ip99LgKsU6i10lvZkTQeVbAIQ/xQ==} peerDependencies: axios: ^1.7.9 react: ^19.0.0 @@ -6176,7 +6176,7 @@ snapshots: rimraf: 6.0.1 zod: 3.24.2 - '@tapie-kr/api-client@0.1.16(axios@1.8.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(zod@3.24.2)': + '@tapie-kr/api-client@0.1.17(axios@1.8.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(zod@3.24.2)': dependencies: axios: 1.8.1 react: 19.0.0 From ba9ee0e3cd0bd6cb84089df7d8c43df5902b5019 Mon Sep 17 00:00:00 2001 From: FIRO <72495729+iamfiro@users.noreply.github.com> Date: Sun, 9 Mar 2025 14:31:08 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A7=20update=20ApplyPage=20logic?= =?UTF-8?q?=20to=20handle=20unavailable=20form=20data=20and=20trigger=20no?= =?UTF-8?q?tFound=20appropriately?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/tapie/src/app/apply/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tapie/src/app/apply/page.tsx b/packages/tapie/src/app/apply/page.tsx index eb585ed..eef4e02 100644 --- a/packages/tapie/src/app/apply/page.tsx +++ b/packages/tapie/src/app/apply/page.tsx @@ -28,7 +28,7 @@ export default function ApplyPage() { // 기본 Form 정보를 가져온 후 Application 정보를 가져옴 useEffect(() => { - if (currentForm?.data === null) notFound(); + if (currentForm?.data === null || !currentForm?.data.available) notFound(); if (currentForm?.data.id) { getMyApplication({ param: { formId: currentForm?.data.id } }); From 1c6e93215970e0be2ee9632650b1f2d67a8f8daa Mon Sep 17 00:00:00 2001 From: FIRO <72495729+iamfiro@users.noreply.github.com> Date: Sun, 9 Mar 2025 19:16:17 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A7=20refactor=20Sentry=20configur?= =?UTF-8?q?ation=20for=20improved=20readability;=20remove=20example=20API?= =?UTF-8?q?=20route=20and=20update=20ApplyPage=20logic=20to=20handle=20una?= =?UTF-8?q?vailable=20form=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/tapie/next.config.mjs | 77 ++++++++++--------- .../src/app/api/sentry-example-api/route.ts | 9 --- packages/tapie/src/app/apply/page.tsx | 2 +- 3 files changed, 43 insertions(+), 45 deletions(-) delete mode 100644 packages/tapie/src/app/api/sentry-example-api/route.ts diff --git a/packages/tapie/next.config.mjs b/packages/tapie/next.config.mjs index ac826d2..2f11102 100644 --- a/packages/tapie/next.config.mjs +++ b/packages/tapie/next.config.mjs @@ -1,39 +1,46 @@ -import {withSentryConfig} from '@sentry/nextjs'; +import { withSentryConfig } from '@sentry/nextjs'; import { withTAPIEWebConfig } from '@tapie-kr/web-shared/configs/nextjs.mjs'; export default withSentryConfig(withTAPIEWebConfig(), { -// For all available options, see: -// https://www.npmjs.com/package/@sentry/webpack-plugin#options -org: "tapie-ne", -project: "tapie-web", - -// Only print logs for uploading source maps in CI -silent: !process.env.CI, - -// For all available options, see: -// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ - -// Upload a larger set of source maps for prettier stack traces (increases build time) -widenClientFileUpload: true, - -// Automatically annotate React components to show their full name in breadcrumbs and session replay -reactComponentAnnotation: { -enabled: true, -}, - -// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. -// This can increase your server load as well as your hosting bill. -// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- -// side errors will fail. -tunnelRoute: "/monitoring", - -// Automatically tree-shake Sentry logger statements to reduce bundle size -disableLogger: true, - -// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) -// See the following for more information: -// https://docs.sentry.io/product/crons/ -// https://vercel.com/docs/cron-jobs -automaticVercelMonitors: true, -}); \ No newline at end of file + /* + * For all available options, see: + * https://www.npmjs.com/package/@sentry/webpack-plugin#options + */ + + org: 'tapie-ne', + project: 'tapie-web', + + // Only print logs for uploading source maps in CI + silent: !process.env.CI, + + /* + * For all available options, see: + * https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ + */ + + // Upload a larger set of source maps for prettier stack traces (increases build time) + widenClientFileUpload: true, + + // Automatically annotate React components to show their full name in breadcrumbs and session replay + reactComponentAnnotation: { enabled: true }, + + /* + * Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. + * This can increase your server load as well as your hosting bill. + * Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- + * side errors will fail. + */ + tunnelRoute: '/monitoring', + + // Automatically tree-shake Sentry logger statements to reduce bundle size + disableLogger: true, + + /* + * Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) + * See the following for more information: + * https://docs.sentry.io/product/crons/ + * https://vercel.com/docs/cron-jobs + */ + automaticVercelMonitors: true, +}); diff --git a/packages/tapie/src/app/api/sentry-example-api/route.ts b/packages/tapie/src/app/api/sentry-example-api/route.ts deleted file mode 100644 index f486f3d..0000000 --- a/packages/tapie/src/app/api/sentry-example-api/route.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NextResponse } from "next/server"; - -export const dynamic = "force-dynamic"; - -// A faulty API route to test Sentry's error monitoring -export function GET() { - throw new Error("Sentry Example API Route Error"); - return NextResponse.json({ data: "Testing Sentry Error..." }); -} diff --git a/packages/tapie/src/app/apply/page.tsx b/packages/tapie/src/app/apply/page.tsx index eef4e02..af8b21b 100644 --- a/packages/tapie/src/app/apply/page.tsx +++ b/packages/tapie/src/app/apply/page.tsx @@ -28,7 +28,7 @@ export default function ApplyPage() { // 기본 Form 정보를 가져온 후 Application 정보를 가져옴 useEffect(() => { - if (currentForm?.data === null || !currentForm?.data.available) notFound(); + if (currentForm?.data === null || currentForm?.data.available === false) notFound(); if (currentForm?.data.id) { getMyApplication({ param: { formId: currentForm?.data.id } }); From f3b14577f32f6b7306d4b156ceecef986c2797a2 Mon Sep 17 00:00:00 2001 From: FIRO <72495729+iamfiro@users.noreply.github.com> Date: Sun, 9 Mar 2025 19:17:06 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=A7=20update=20error=20handling=20?= =?UTF-8?q?in=20PortfoliosDetailPage;=20simplify=20catch=20block=20and=20r?= =?UTF-8?q?emove=20unused=20import=20in=20PortfolioPage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/tapie/src/app/portfolios/[id]/page.tsx | 2 +- packages/tapie/src/app/portfolios/page.tsx | 1 - packages/tapie/src/sections/apply/Form/shared.ts | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/tapie/src/app/portfolios/[id]/page.tsx b/packages/tapie/src/app/portfolios/[id]/page.tsx index 4e6940b..e3d29b6 100644 --- a/packages/tapie/src/app/portfolios/[id]/page.tsx +++ b/packages/tapie/src/app/portfolios/[id]/page.tsx @@ -72,7 +72,7 @@ export default function PortfoliosDetailPage() { client.get(`/projects/${id}`).then(res => { setData(res.data.data as PortfolioDetail); }) - .catch(err => { + .catch(() => { // if (err.response.status === 404) { setError(true); diff --git a/packages/tapie/src/app/portfolios/page.tsx b/packages/tapie/src/app/portfolios/page.tsx index 955cc70..763fe6f 100644 --- a/packages/tapie/src/app/portfolios/page.tsx +++ b/packages/tapie/src/app/portfolios/page.tsx @@ -1,7 +1,6 @@ import Hero from '@/sections/portfolios/index/Hero'; import Members from '@/sections/portfolios/index/Members'; import Projects from '@/sections/portfolios/index/Projects'; -// import RecentAwards from '@/sections/portfolios/index/RecentAwards'; import RecentProjects from '@/sections/portfolios/index/RecentProjects'; export default function PortfolioPage() { diff --git a/packages/tapie/src/sections/apply/Form/shared.ts b/packages/tapie/src/sections/apply/Form/shared.ts index 0396b90..a6d957f 100644 --- a/packages/tapie/src/sections/apply/Form/shared.ts +++ b/packages/tapie/src/sections/apply/Form/shared.ts @@ -1,3 +1,3 @@ export type ApplyFormStructure = { - -} \ No newline at end of file + +}; From 73172b791f40d33487dc08a3a8c69f8b39243fe2 Mon Sep 17 00:00:00 2001 From: FIRO <72495729+iamfiro@users.noreply.github.com> Date: Sun, 9 Mar 2025 21:54:39 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A7=20refactor=20ApplyBanner=20com?= =?UTF-8?q?ponent;=20replace=20current=20time=20tracking=20with=20early=20?= =?UTF-8?q?status=20check=20based=20on=20form=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/home/ApplyBanner/index.tsx | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/packages/tapie/src/components/home/ApplyBanner/index.tsx b/packages/tapie/src/components/home/ApplyBanner/index.tsx index 258809c..dece553 100644 --- a/packages/tapie/src/components/home/ApplyBanner/index.tsx +++ b/packages/tapie/src/components/home/ApplyBanner/index.tsx @@ -9,18 +9,32 @@ import ApplyBannerNow from './categories/Now'; export default function ApplyBanner() { const { fetch: getForm, data } = useForm(); - const [currentTime, setCurrentTime] = useState(new Date); + const [isEarly, setIsEarly] = useState(true); useEffect(() => { getForm(); + }, []); + + useEffect(() => { + if (data?.data) { + const startAt = toTemporalDateTime(data.data.startsAt); - // Update current time - const timer = setInterval(() => { - setCurrentTime(new Date); - }, 1000); + // 초기 상태 설정 + const checkTime = () => { + const now = Temporal.Now.plainDateTimeISO(); - return () => clearInterval(timer); - }, []); + setIsEarly(Temporal.PlainDateTime.compare(now, startAt) < 0); + }; + + // 처음 한 번 체크 + checkTime(); + + // 1초마다 체크 + const intervalId = setInterval(checkTime, 1000); + + return () => clearInterval(intervalId); + } + }, [data]); if (data?.data === null || !data) { return null; @@ -28,8 +42,6 @@ export default function ApplyBanner() { const startAt = toTemporalDateTime(data.data.startsAt); const endAt = toTemporalDateTime(data.data.endsAt); - const now = toTemporalDateTime(currentTime.toISOString()); - const isEarly = Temporal.PlainDateTime.compare(now, startAt) < 0; return ( <>