Skip to content

Commit

Permalink
fix: 스토리북 환경에서의 prefetch 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
cobocho committed Jun 13, 2024
1 parent b32c5a0 commit 2ecec55
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions apps/web/src/app/(onboarding)/onboarding/funnel/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const OnboardingFunnelPage = () => {
setFunnel(funnel)
}

const isStorybook = process.env.IS_STORYBOOK !== undefined

return (
<div>
<OnboardingHeader step={1} />
Expand Down Expand Up @@ -99,12 +101,12 @@ const OnboardingFunnelPage = () => {
</SelectBoxGroup>
</div>
<div className={buttonGroup}>
<Link href="/onboarding/job">
<Link prefetch={!isStorybook} href="/onboarding/job">
<Text type="body-2" color="label-alternative">
건너뛰기
</Text>
</Link>
<Link href="/onboarding/job">
<Link prefetch={!isStorybook} href="/onboarding/job">
<Button disabled={selectedFunnel === null} size="middle">
다음
</Button>
Expand Down
8 changes: 5 additions & 3 deletions apps/web/src/app/(onboarding)/onboarding/job/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ const OnboardingJobPage = () => {
setJob(job)
}

const isStorybook = process.env.IS_STORYBOOK !== undefined

return (
<div>
<OnboardingHeader step={2} />
Expand Down Expand Up @@ -116,17 +118,17 @@ const OnboardingJobPage = () => {
</SelectBoxGroup>
</div>
<div className={buttonGroup}>
<Link href="/">
<Link prefetch={!isStorybook} href="/">
<Text type="body-2" color="label-alternative">
건너뛰기
</Text>
</Link>
<Link href="/onboarding/funnel">
<Link prefetch={!isStorybook} href="/onboarding/funnel">
<Button filled={false} blueLine={false} size="middle">
뒤로가기
</Button>
</Link>
<Link href="/onboarding/job">
<Link prefetch={!isStorybook} href="/onboarding/job">
<Button
onClick={onSubmitFunnel}
size="middle"
Expand Down
1 change: 1 addition & 0 deletions apps/workshop/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const config: StorybookConfig = {
return mergeConfig(config, {
define: {
'process.env.NEXT_PUBLIC_API_URL': false,
'process.env.IS_STORYBOOK': true,
},
plugins: [require('@vanilla-extract/vite-plugin').vanillaExtractPlugin()],
esbuild: {
Expand Down

0 comments on commit 2ecec55

Please sign in to comment.