Skip to content

Commit 579ec6c

Browse files
authored
Merge pull request #67 from Nexters/feat/mobile-web-banner
feat: 모바일 웹 상단 배너, 로딩 ui 수정
2 parents 10b0731 + dba3090 commit 579ec6c

File tree

14 files changed

+199
-43
lines changed

14 files changed

+199
-43
lines changed

apps/tuk-web/public/logo.png

267 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use client';
2+
3+
import Image from 'next/image';
4+
5+
export default function Loading() {
6+
return (
7+
<div className="flex h-screen w-full items-center justify-center bg-white-default">
8+
<Image src="/logo.png" alt="App Logo" width={200} height={200} priority />
9+
</div>
10+
);
11+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import InviteGathering from '@/app/invite/gathering/[gatheringId]/src/components/InviteGathering';
2+
import SplashGate from '@/shared/components/SplashGate';
23

3-
export default function InviteGatheringPage() {
4-
return <InviteGathering />;
4+
export default async function InviteGatheringPage() {
5+
return (
6+
<SplashGate minMs={1000} fadeMs={250} logoSrc="/logo.png" logoSize={200}>
7+
<InviteGathering />
8+
</SplashGate>
9+
);
510
}

apps/tuk-web/src/app/invite/gathering/[gatheringId]/src/components/InviteGathering.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import { ErrorBoundary } from 'react-error-boundary';
77
import InviteGatheringContent from '@/app/invite/gathering/[gatheringId]/src/components/InviteGatheringContent';
88
import InviteGatheringErrorFallback from '@/app/invite/gathering/[gatheringId]/src/components/InviteGatheringErrorFallback';
99
import InviteGatheringSkeleton from '@/app/invite/gathering/[gatheringId]/src/components/InviteGatheringSkeleton';
10-
import SkeletonGuard from '@/app/invite/meet/[meetId]/src/components/SkeletonGuard';
1110
import { BackgroundTemplate, Button } from '@/shared/components';
11+
import SkeletonGuard from '@/shared/components/SkeletonGuard';
1212
import { useParam } from '@/shared/hooks/useParam';
1313

1414
const InviteGathering = () => {
1515
const gatheringId = Number(useParam('gatheringId'));
1616

1717
return (
1818
<BackgroundTemplate>
19-
<BackgroundTemplate.Main className="overflow-y-auto px-5">
20-
<BackgroundTemplate.Gradient />
19+
<BackgroundTemplate.Main className="px-5">
20+
<BackgroundTemplate.Gradient className="pointer-events-none" />
2121

2222
<QueryErrorResetBoundary>
2323
{({ reset }) => (
2424
<ErrorBoundary onReset={reset} FallbackComponent={InviteGatheringErrorFallback}>
2525
<SkeletonGuard minMs={250} skeleton={<InviteGatheringSkeleton />}>
26-
<Suspense fallback={<InviteGatheringSkeleton />}>
26+
<Suspense fallback={null}>
2727
<InviteGatheringContent />
2828
</Suspense>
2929
</SkeletonGuard>

apps/tuk-web/src/app/invite/gathering/[gatheringId]/src/components/InviteGatheringContent.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import { useSuspenseQuery } from '@tanstack/react-query';
24
import { useEffect, useState } from 'react';
35

@@ -18,7 +20,7 @@ const InviteGatheringContent = () => {
1820
queryFn: () => gatheringAPIService.getGatheringName(gatheringId),
1921
});
2022

21-
const [showBanner, setShowBanner] = useState(false);
23+
const [showBanner, setShowBanner] = useState(true);
2224

2325
const handleCloseBanner = () => {
2426
localStorage.setItem(BANNER_KEY, Date.now().toString());
@@ -28,7 +30,6 @@ const InviteGatheringContent = () => {
2830
useEffect(() => {
2931
const dismissedAt = localStorage.getItem(BANNER_KEY);
3032
const now = Date.now();
31-
3233
if (!dismissedAt) {
3334
setShowBanner(true);
3435
} else {
@@ -47,21 +48,18 @@ const InviteGatheringContent = () => {
4748
<h2
4849
className={cn(
4950
'serif-title-22-M font-bold text-gray-900',
50-
showBanner ? 'mt-[6.875rem]' : 'mt-[1.875rem]'
51+
showBanner ? 'mt-[calc(70px+env(safe-area-inset-top,0px))]' : 'mt-[1.875rem]'
5152
)}
5253
>
5354
모임에
5455
<br />
5556
참여하시겠어요?
5657
</h2>
5758

58-
<div className="relative mt-[70px] flex flex-col items-center justify-center">
59+
<div className="relative mt-[56px] flex flex-col items-center justify-center">
5960
<div className="h-[320px] w-[278px] rounded-[10px] bg-gray-50" />
60-
<div
61-
className={cn(
62-
'absolute bottom-[-80px] left-1/2 h-[421px] w-[408px] -translate-x-1/2 translate-y-0'
63-
)}
64-
>
61+
62+
<div className="pointer-events-none absolute bottom-[-80px] left-1/2 h-[421px] w-[408px] -translate-x-1/2">
6563
<div className="relative size-full">
6664
<div className="absolute inset-0 z-0">
6765
<CardFrame />

apps/tuk-web/src/app/invite/gathering/[gatheringId]/src/components/InviteGatheringSkeleton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const InviteGatheringSkeleton = () => {
22
return (
3-
<div className="mt-12 flex flex-col items-center justify-center">
3+
<div className="mt-[200px] flex flex-col items-center justify-center">
44
<div
55
className="relative h-[321px] w-[288px] animate-pulse overflow-hidden rounded-[0.625rem] bg-[#f0f1f3] px-4 py-3"
66
aria-busy="true"
@@ -27,8 +27,6 @@ const InviteGatheringSkeleton = () => {
2727
<div className="h-3 w-10 rounded bg-gray-200" />
2828
<div className="h-3 w-16 rounded bg-gray-200" />
2929
</div>
30-
31-
<div className="pointer-events-none absolute inset-0 -skew-x-12 bg-gradient-to-r from-transparent via-[rgba(255,255,255,0.3)] to-transparent" />
3230
</div>
3331
</div>
3432
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use client';
2+
3+
import Image from 'next/image';
4+
5+
export default function Loading() {
6+
return (
7+
<div className="flex h-screen w-full items-center justify-center bg-white-default">
8+
<Image src="/logo.png" alt="App Logo" width={200} height={200} priority />
9+
</div>
10+
);
11+
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import InviteProposal from '@/app/invite/meet/[meetId]/src/components/InviteProposal';
2+
import SplashGate from '@/shared/components/SplashGate';
23

34
export default function InviteProposalPage() {
4-
return <InviteProposal />;
5+
return (
6+
<SplashGate minMs={1000} fadeMs={250} logoSrc="/logo.png" logoSize={200}>
7+
<InviteProposal />
8+
</SplashGate>
9+
);
510
}

apps/tuk-web/src/app/invite/meet/[meetId]/src/components/InviteProposal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ import { ErrorBoundary } from 'react-error-boundary';
77
import InviteProposalContent from '@/app/invite/meet/[meetId]/src/components/InviteProposalContent';
88
import InviteProposalErrorFallback from '@/app/invite/meet/[meetId]/src/components/InviteProposalErrorFallback';
99
import InviteProposalSkeleton from '@/app/invite/meet/[meetId]/src/components/InviteProposalSkeleton';
10-
import SkeletonGuard from '@/app/invite/meet/[meetId]/src/components/SkeletonGuard';
1110
import { BackgroundTemplate, Button } from '@/shared/components';
11+
import SkeletonGuard from '@/shared/components/SkeletonGuard';
1212
import { useParam } from '@/shared/hooks/useParam';
1313

1414
const InviteProposal = () => {
1515
const proposalId = Number(useParam('meetId'));
1616

1717
return (
1818
<BackgroundTemplate>
19-
<BackgroundTemplate.Main className="overflow-y-auto px-5">
20-
<BackgroundTemplate.Gradient />
19+
<BackgroundTemplate.Main className="px-5">
20+
<BackgroundTemplate.Gradient className="pointer-events-none" />
2121

2222
<QueryErrorResetBoundary>
2323
{({ reset }) => (
2424
<ErrorBoundary onReset={reset} FallbackComponent={InviteProposalErrorFallback}>
2525
<SkeletonGuard minMs={250} skeleton={<InviteProposalSkeleton />}>
26-
<Suspense fallback={<InviteProposalSkeleton />}>
26+
<Suspense fallback={null}>
2727
<InviteProposalContent />
2828
</Suspense>
2929
</SkeletonGuard>

apps/tuk-web/src/app/invite/meet/[meetId]/src/components/InviteProposalContent.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
CardFrame,
88
} from '@/app/proposal/[proposalId]/detail/components/GatheringProposalContent';
99
import AppInstallBanner from '@/shared/components/AppInstallBanner';
10+
import { useSplashGate } from '@/shared/components/SplashGate';
1011
import { useParam } from '@/shared/hooks/useParam';
1112
import { cn } from '@/shared/lib';
1213

@@ -16,6 +17,8 @@ const BANNER_RESHOW_MINUTES = 30;
1617
const InviteProposalContent = () => {
1718
const proposalId = Number(useParam('meetId'));
1819

20+
const { done: splashDone } = useSplashGate();
21+
1922
const [slideDown, setSlideDown] = useState(false);
2023

2124
const [showBanner, setShowBanner] = useState(false);
@@ -50,11 +53,11 @@ const InviteProposalContent = () => {
5053
}, []);
5154

5255
useEffect(() => {
53-
if (!isLoading && !isError) {
56+
if (splashDone && !isLoading && !isError) {
5457
const id = requestAnimationFrame(() => setSlideDown(true));
5558
return () => cancelAnimationFrame(id);
5659
}
57-
}, [isLoading, isError]);
60+
}, [splashDone, isLoading, isError]);
5861

5962
return (
6063
<>
@@ -63,7 +66,7 @@ const InviteProposalContent = () => {
6366
<h2
6467
className={cn(
6568
'serif-title-22-M font-bold text-gray-900',
66-
showBanner ? 'mt-[6.875rem]' : 'mt-[1.875rem]'
69+
showBanner ? 'mt-[calc(70px+env(safe-area-inset-top,0px))]' : 'mt-[1.875rem]'
6770
)}
6871
>
6972
보고 싶은 마음이
@@ -78,8 +81,8 @@ const InviteProposalContent = () => {
7881

7982
<div
8083
className={cn(
81-
'ease-outmotion-reduce:transition-none absolute bottom-[-100px] left-1/2 h-[421px] w-[408px] -translate-x-1/2 transition-transform duration-1000',
82-
slideDown ? 'translate-y-52' : 'translate-y-0'
84+
'ease-outmotion-reduce:transition-none absolute bottom-[-80px] left-1/2 h-[421px] w-[408px] -translate-x-1/2 transition-transform duration-1000',
85+
slideDown ? 'translate-y-56' : 'translate-y-0'
8386
)}
8487
style={{ willChange: 'transform', transitionDelay: '150ms' }}
8588
>

0 commit comments

Comments
 (0)