Skip to content

Commit 31939a8

Browse files
committed
feat: 결제 배포 버전
1 parent 4959c82 commit 31939a8

7 files changed

Lines changed: 78 additions & 25 deletions

File tree

src/app/favorites/_components/Favorites.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
'use client'
22

33
import useGetFavorites from '@/api/useGetFavorites'
4-
import LoginButtonSection from '@/components/shared/LoginButtonSection'
5-
import memberStore from '@/store/user'
64
import FavoritesStoreList from './FavoritesStoreList'
75
import RecentStoreList from './RecentStoreList'
86

97
const Favorites = () => {
10-
const { member } = memberStore()
118
const { data: favorites } = useGetFavorites()
129

1310
return (
14-
<div className="flex h-full flex-col bg-neutral-100">
15-
{member && favorites ? (
16-
<FavoritesStoreList favorites={favorites} />
17-
) : (
18-
<div className="px-mobile_safe pb-4 pt-[calc(20px+1rem)]">
19-
<LoginButtonSection
20-
text={`찜한 맛집을 확인하려면 로그인이 필요해요.\n 지금 가입하고 행복에 가까워지세요!`}
21-
/>
22-
</div>
23-
)}
24-
25-
<RecentStoreList favorites={favorites} />
11+
<div className="flex h-full flex-col bg-white">
12+
<FavoritesStoreList favorites={favorites} />
13+
<RecentStoreList favorites={favorites || []} />
2614
</div>
2715
)
2816
}

src/app/favorites/_components/FavoritesStoreList.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
'use client'
22

33
import { Favorites } from '@/api/useGetFavorites'
4+
import FullpageLoader from '@/components/FullpageLoader'
5+
import LoginButtonSection from '@/components/shared/LoginButtonSection'
6+
import memberStore from '@/store/user'
47
import { ROUTE_PATHS } from '@/utils/routes'
58
import { useRouter } from 'next/navigation'
69
import FavoritesListItem from './FavoritesListItem'
710

8-
const FavoritesStoreList = ({ favorites }: { favorites: Favorites[] }) => {
11+
const FavoritesStoreList = ({ favorites }: { favorites?: Favorites[] }) => {
12+
const { member } = memberStore()
13+
14+
if (!member)
15+
return (
16+
<div className="px-mobile_safe pb-4 pt-[calc(20px+1rem)]">
17+
<LoginButtonSection
18+
text={`찜한 맛집을 확인하려면 로그인이 필요해요.\n 지금 가입하고 행복에 가까워지세요!`}
19+
/>
20+
</div>
21+
)
22+
23+
if (!favorites) return <FullpageLoader useNavigation useBottomNavigation />
24+
925
return (
1026
<div>
1127
<p className="flex items-center gap-2 bg-neutral-100 px-mobile_safe py-3 text-base font-bold text-black">

src/app/globals.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ button {
198198
--chart-4: 280 65% 60%;
199199
--chart-5: 340 75% 55%;
200200
}
201+
* {
202+
-webkit-text-decoration: none !important;
203+
text-decoration: none !important;
204+
-webkit-touch-callout: none;
205+
-webkit-user-select: none;
206+
-webkit-text-size-adjust: none;
207+
-webkit-text-fill-color: currentColor;
208+
}
201209
}
202210
@layer base {
203211
* {

src/app/pay/_components/OrderInfo.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ const OrderInfo = () => {
264264
// customerMobilePhone: "01012341234",
265265
card: {
266266
useEscrow: false,
267-
// flowMode: 'DIRECT',
268-
flowMode: 'DEFAULT',
269-
// cardCompany: 'TOSSBANK',
267+
flowMode: 'DIRECT',
268+
// flowMode: 'DEFAULT',
269+
cardCompany: 'TOSSBANK',
270270
useCardPoint: false,
271271
useAppCardOnly: false,
272272
},
@@ -410,13 +410,10 @@ const OrderInfo = () => {
410410
</div>
411411
</div>
412412
<div className="flex flex-col gap-4 rounded-xl border border-solid border-gray-400 px-5 py-4">
413-
<div className="flex flex-row justify-between">
413+
<div className="flex flex-row justify-between" onClick={handleSelectOrderPay}>
414414
<div className="place-content-center text-base font-extrabold">결제수단</div>
415415
<div className="flex flex-row items-center gap-1">
416-
<div
417-
className="place-content-center text-sm font-semibold text-primary"
418-
onClick={handleSelectOrderPay}
419-
>
416+
<div className="place-content-center text-sm font-semibold text-primary">
420417
{!paymentType ? (
421418
'결제수단을 선택해주세요'
422419
) : (
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use client'
2+
3+
import Icon from '@/components/Icon'
4+
import { ROUTE_PATHS } from '@/utils/routes'
5+
import { useRouter } from 'next/navigation'
6+
import { useEffect, useState } from 'react'
7+
8+
const PayFail = () => {
9+
const router = useRouter()
10+
const [timer, setTimer] = useState(3)
11+
12+
useEffect(() => {
13+
const timer = setInterval(() => {
14+
setTimer((prev) => prev - 1)
15+
}, 1000)
16+
17+
return () => clearInterval(timer)
18+
}, [])
19+
20+
useEffect(() => {
21+
if (timer <= 0) {
22+
router.push(ROUTE_PATHS.PAY)
23+
}
24+
}, [timer])
25+
26+
return (
27+
<div className="flex h-full flex-col items-center justify-center gap-6">
28+
<Icon name="CircleX" className="size-10 text-primary" size={40} />
29+
<div className="flex flex-col items-center gap-1">
30+
<p className="text-2xl font-bold">결제 중 오류가 발생했어요.</p>
31+
{timer > 0 && <p className="text-sm text-gray-500">{timer}초 후 자동으로 이동합니다.</p>}
32+
</div>
33+
</div>
34+
)
35+
}
36+
37+
export default PayFail

src/app/pay/fail/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PayFail from './_components/PayFail'
2+
3+
const PayFailPage = () => {
4+
return <PayFail />
5+
}
6+
7+
export default PayFailPage

src/components/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as React from 'react'
44
import { cn } from '@/lib/utils'
55

66
export const badgeVariants = cva(
7-
'inline-flex items-center border px-[4px] py-[3px] text-[11px] leading-[11px] size-fit rounded-sm',
7+
'inline-flex items-center border px-[4px] py-[3px] text-[11px] leading-[11px] size-fit rounded-sm [-webkit-tap-highlight-color:transparent] [-webkit-text-decoration:none]',
88
{
99
variants: {
1010
variant: {

0 commit comments

Comments
 (0)