Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ const config: StorybookConfig = {
name: '@storybook/nextjs-vite',
options: {},
},
staticDirs: ['..\\public'],
// staticDirs: ['../public'],
async viteFinal(config, { configType }) {
if (configType === 'PRODUCTION') {
config.base = '/storybook/';
}
return config;
},
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"build": "next build && storybook build -o public/storybook",
"start": "next start",
"lint": "next lint",
"type-check": "tsc --noEmit",
Expand Down
12 changes: 12 additions & 0 deletions src/app/storybook/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';

import { useRouter } from 'next/navigation';
import { useEffect } from 'react';

export default function StorybookRedirect() {
const router = useRouter();
useEffect(() => {
router.replace('/storybook/index.html');
}, []);
Comment on lines +8 to +10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

useEffect 의존성 배열에 router 추가가 필요합니다.

React Hook 규칙에 따라 useEffect 내부에서 사용되는 router는 의존성 배열에 포함되어야 합니다.

   useEffect(() => {
     router.replace('/storybook/index.html');
-  }, []);
+  }, [router]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
router.replace('/storybook/index.html');
}, []);
useEffect(() => {
router.replace('/storybook/index.html');
}, [router]);
🤖 Prompt for AI Agents
In src/app/storybook/page.tsx around lines 8 to 10, the useEffect hook uses the
router object but does not include it in the dependency array. To comply with
React Hook rules, add router to the dependency array of useEffect to ensure the
effect runs correctly when router changes.

return null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default function ActivityDropdown({
try {
await deleteActivity(id);
queryClient.invalidateQueries({ queryKey: activitiesKeys.all });
queryClient.invalidateQueries({ queryKey: ['carousel-activities'] });
router.push('/activities');
} catch (e) {
console.error(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function DeleteMyActivityModal({
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: ['my-activities'] });
queryClient.invalidateQueries({ queryKey: ['carousel-activities'] });
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ export default function DayCell({
status: 'declined',
}),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['reservationsBySchedule'] });
queryClient.invalidateQueries({
queryKey: [
'allReservationsByDate',
selectedActivityId,
day.format('YYYY-MM-DD'),
],
});
queryClient.invalidateQueries({ queryKey: ['schedules'] });
queryClient.invalidateQueries({ queryKey: ['reservationDashboard'] });
},
Expand Down
8 changes: 8 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rewrites": [
{
"source": "/storybook",
"destination": "/_next/static/storybook/index.html"
}
]
}