Skip to content

Commit

Permalink
Merge pull request #155 from jirum-alarm/feature/153/mypage-speed
Browse files Browse the repository at this point in the history
[feature] ํ™ˆ ํ™”๋ฉด์—์„œ ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€ ํ”„๋ฆฌํŒจ์นญ ์ถ”๊ฐ€
  • Loading branch information
tolluset committed Feb 25, 2024
2 parents dbf494e + b178ebe commit 3608174
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default async function Home() {
<main>
<div className="mx-auto max-w-screen-lg">
<div className="px-5">
<NavBar></NavBar>
<NavBar />
<ProductList />
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Alert, Logo, My } from '@/components/common/icons';
import { QueryMe } from '../graphql/auth';
import { User } from '../types/user';
import { useQuery } from '@apollo/client';
import { IS_DEV } from '@/constants/env';
import { IS_VERCEL_PRD } from '@/constants/env';
import { QueryUnreadNotificationsCount } from '@/graphql/notification';
import { UnreadNotificationsCount } from '@/graphql/interface';

Expand All @@ -17,7 +17,7 @@ export default function NavBar() {
const { data } = useQuery<{ me: User }>(QueryMe);
const unreadNotificationsCount = useQuery<{ unreadNotificationsCount: UnreadNotificationsCount }>(
QueryUnreadNotificationsCount,
{ skip: !IS_DEV || !data?.me },
{ skip: IS_VERCEL_PRD || !data?.me },
);

return (
Expand All @@ -32,15 +32,15 @@ export default function NavBar() {
</Link>
<div className="w-3/12" />
<div className="flex w-3/12 justify-end gap-x-3">
{IS_DEV && data?.me && (
{!IS_VERCEL_PRD && data?.me && (
<Link href={ALARM_PATH} className="relative">
{unreadNotificationsCount.data?.unreadNotificationsCount ? (
<div className="absolute left-[15.5px] top-[4.6px] h-1.5 w-1.5 animate-fade-in rounded-full bg-error-500"></div>
) : undefined}
<Alert />
</Link>
)}
<Link href={data?.me ? MYPAGE_PATH : LOGIN_PATH}>
<Link href={data?.me ? MYPAGE_PATH : LOGIN_PATH} prefetch={true}>
<My />
</Link>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/constants/env.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const IS_API_MOCKING = process.env.NEXT_PUBLIC_API_MOCKING === 'enable';
export const IS_DEV = process.env.NODE_ENV === 'development';
export const IS_VERCEL_PRD =
process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' || process.env.VERCEL_ENV === 'production';

0 comments on commit 3608174

Please sign in to comment.