Skip to content

Commit 3324e92

Browse files
committed
[feat] ๐Ÿ€๊ฒฐ์ œ ์ƒ์„ธ์— ์—ฐ๋™ ๋ฒ„ํŠผ ์ถ”๊ฐ€
1 parent e20b9df commit 3324e92

File tree

14 files changed

+167
-60
lines changed

14 files changed

+167
-60
lines changed

Diff for: โ€Žapp/(default)/statistics/goal/register/page.tsx

+75-19
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Input } from '@/components/ui/input';
55
import { QUERY_KEYS } from '@/constants/queryKey';
66
import { useGenericMutation } from '@/hooks/query/globalQuery';
77
import { useQueryClient } from '@tanstack/react-query';
8+
import { cubicBezier, motion } from 'framer-motion';
89
import Image from 'next/image';
910
import Link from 'next/link';
1011
import { useRouter, useSearchParams } from 'next/navigation';
@@ -57,33 +58,71 @@ function GoalRegisterContent() {
5758
}
5859
};
5960

61+
const easeCustom = cubicBezier(0.4, 0, 0.2, 1);
62+
63+
const container = {
64+
hidden: { opacity: 0 },
65+
show: {
66+
opacity: 1,
67+
transition: {
68+
staggerChildren: 0.2,
69+
ease: easeCustom,
70+
},
71+
},
72+
};
73+
74+
const item = {
75+
hidden: { opacity: 0, height: 0, scale: 0.8 },
76+
show: {
77+
opacity: [0, 0.5, 1],
78+
height: 'auto',
79+
scale: 1,
80+
transition: {
81+
duration: 0.7,
82+
ease: easeCustom,
83+
opacity: {
84+
duration: 1,
85+
ease: easeCustom,
86+
},
87+
},
88+
},
89+
};
90+
6091
if (!complete) {
6192
return (
62-
<div className='min-h-screen w-[90%] mx-auto z-50 flex flex-col justify-start items-start gap-10'>
93+
<motion.div
94+
variants={container}
95+
initial='hidden'
96+
animate='show'
97+
className='min-h-screen w-[90%] mx-auto z-50 flex flex-col justify-start items-start gap-10'
98+
>
6399
<form
64100
className='w-full flex flex-col items-start justify-start gap-4 pt-40 sm:pt-24'
65101
onSubmit={handleSubmit}
66102
>
67-
<span className='text-[1.25rem] font-bold'>
103+
<motion.div variants={item} className='text-[1.25rem] font-bold'>
68104
์ด๋ฒˆ ๋‹ฌ ๋ชฉํ‘œ ๊ธˆ์•ก์„ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
69-
</span>
70-
<div className='mx-auto w-[150px] sm:w-[200px] h-auto'>
105+
</motion.div>
106+
<motion.div
107+
variants={item}
108+
className='mx-auto w-[150px] sm:w-[200px] h-auto'
109+
>
71110
<Image
72111
src='/images/money.svg'
73112
alt='documentList'
74113
width={200}
75114
height={200}
76115
className='float-animation'
77116
/>
78-
</div>
79-
<div className='flex flex-col gap-1'>
117+
</motion.div>
118+
<motion.div variants={item} className='flex flex-col gap-1'>
80119
<span className='text-[1.625rem] font-bold'>
81120
{formatNumber(avgSpent)}
82121
<span className='font-medium text-[1rem] ml-1'>์›</span>
83122
</span>
84123
<span>์ตœ๊ทผ 3๊ฐœ์›” ๊ฐ„ ํ‰๊ท  ์ง€์ถœ์•ก์ด์—์š”</span>
85-
</div>
86-
<div className='flex items-end gap-2'>
124+
</motion.div>
125+
<motion.div variants={item} className='flex items-end gap-2'>
87126
<Input
88127
value={formatNumber(goal)}
89128
onChange={(e) => setGoal(e.target.value)}
@@ -92,20 +131,34 @@ function GoalRegisterContent() {
92131
className='bg-darkGrey border-none outline-none focus:outline-none focus:bg-[#515151]'
93132
/>
94133
<span className='font-medium'>์›</span>
134+
</motion.div>
135+
<div className='absolute bottom-8 left-1/2 transform -translate-x-1/2 w-[90%] max-w-[460px] flex items-center justify-between'>
136+
<Button
137+
type='button'
138+
className='w-[35%] bg-white hover:bg-grey text-deepDarkGrey'
139+
onClick={() => router.back()}
140+
>
141+
์ทจ์†Œ
142+
</Button>
143+
<Button
144+
type='submit'
145+
className='w-[60%] bg-main hover:bg-[#476BE3]'
146+
>
147+
๋“ฑ๋ก
148+
</Button>
95149
</div>
96-
<Button
97-
type='submit'
98-
className='absolute bottom-8 left-1/2 transform -translate-x-1/2 w-[90%] max-w-[460px] bg-main hover:bg-[#476BE3]'
99-
>
100-
๋“ฑ๋ก
101-
</Button>
102150
</form>
103-
</div>
151+
</motion.div>
104152
);
105153
}
106154

107155
return (
108-
<div className='relative h-[100dvh] mx-auto z-50 flex flex-col justify-center items-center gap-10 pb-12 pt-40 sm:pt-20'>
156+
<motion.div
157+
variants={container}
158+
initial='hidden'
159+
animate='show'
160+
className='relative h-[100dvh] mx-auto z-50 flex flex-col justify-center items-center gap-10 pb-12 pt-40 sm:pt-20'
161+
>
109162
<div className='mx-auto w-[300px] sm:w-[350px] h-auto'>
110163
<video
111164
src='/images/complete.mp4'
@@ -117,10 +170,13 @@ function GoalRegisterContent() {
117170
playsInline
118171
/>
119172
</div>
120-
<div className='flex flex-col gap-3 text-[1rem] font-semibold'>
173+
<motion.div
174+
variants={item}
175+
className='flex flex-col gap-3 text-[1.25rem] font-semibold'
176+
>
121177
<span>๋ชฉํ‘œ ์„ค์ •์ด ์™„๋ฃŒ๋˜์—ˆ์–ด์š”.</span>
122178
<span>๋ชฉํ‘œ๋ฅผ ๋‹ฌ์„ฑํ•˜๋Ÿฌ ๊ฐ€๋ณผ๊นŒ์š”?</span>
123-
</div>
179+
</motion.div>
124180
<Link href='/statistics/goal' className='w-full'>
125181
<Button
126182
type='submit'
@@ -129,7 +185,7 @@ function GoalRegisterContent() {
129185
๋ชฉํ‘œ ๋‹ฌ์„ฑํ•˜๋Ÿฌ ๊ฐ€๊ธฐ
130186
</Button>
131187
</Link>
132-
</div>
188+
</motion.div>
133189
);
134190
}
135191

Diff for: โ€Žapp/(head)/accounts/[accountId]/page.tsx

+4-18
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import { AccountDetailCard } from '@/components/molecules/sion/AccountDetailCard
66
import TitleBottomLine from '@/components/ui/TitleBottomLine';
77
import { QUERY_KEYS } from '@/constants/queryKey';
88
import { useGenericQuery } from '@/hooks/query/globalQuery';
9+
import usePlatformCheck from '@/hooks/usePlatformCheck';
910
import { AccountsPayment } from '@/types';
10-
import { PlatformType } from '@/types/authType';
1111
import dayjs from 'dayjs';
1212
import 'dayjs/locale/ko';
13-
import { getAccountsDetail, getPlatform } from '@/lib/api';
13+
import { getAccountsDetail } from '@/lib/api';
1414

1515
dayjs.locale('ko');
1616

17-
export const PLATFORMS = ['์ฟ ํŒก', '11๋ฒˆ๊ฐ€', '๋„ค์ด๋ฒ„ํŽ˜์ด'];
1817
export default function AccountDetail({
1918
params,
2019
}: {
2120
params: { accountId: string };
2221
}) {
22+
const { platforms } = usePlatformCheck();
2323
const { resData: accountsDetail, isLoading } = useGenericQuery(
2424
[QUERY_KEYS.ACCOUNTS_DETAIL, params.accountId],
2525
() =>
@@ -29,24 +29,10 @@ export default function AccountDetail({
2929
})
3030
);
3131

32-
const { resData: platformData, isLoading: platformLoading } =
33-
useGenericQuery<PlatformType>([QUERY_KEYS.PLATFORM], () => getPlatform());
34-
35-
if (isLoading || platformLoading || !platformData || !accountsDetail) {
32+
if (!platforms || isLoading || !accountsDetail) {
3633
return <Loading />;
3734
}
3835

39-
const platforms = platformData?.data?.platformInfos
40-
?.map(({ platformName }) => {
41-
const platformMap: Record<string, string> = {
42-
COUPANG: '์ฟ ํŒก',
43-
'11ST': '11๋ฒˆ๊ฐ€',
44-
NAVER: '๋„ค์ด๋ฒ„ํŽ˜์ด',
45-
};
46-
return platformMap[platformName];
47-
})
48-
.filter((platform) => !PLATFORMS.includes(platform ?? ''));
49-
5036
return (
5137
<>
5238
<div className='overflow-y-scroll scrollbar-hide min-h-full'>

Diff for: โ€Žapp/(head)/mypage/membership/[shop]/page.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ export default function MembershipDetail({
3333
{
3434
onSuccess: (data) => {
3535
if (data.code === 200) {
36-
router.push(from === 'payments' ? `/payments` : `/mypage/membership`);
36+
if (from === 'accounts') {
37+
router.back();
38+
} else {
39+
router.push(
40+
from === 'payments' ? '/payments' : '/mypage/membership'
41+
);
42+
}
3743

3844
queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.PLATFORM] });
3945
}

Diff for: โ€Žapp/(head)/page.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function Home() {
8181
animate='show'
8282
className='flex justify-center flex-col items-center w-full'
8383
>
84-
<AdCarousel />
84+
<AdCarousel userName={statisticsDiff?.data?.userName ?? ''} />
8585

8686
<motion.div
8787
variants={item}
@@ -107,8 +107,8 @@ export default function Home() {
107107
<AccentText
108108
prefix='์ง€๋‚œ๋‹ฌ ๋Œ€๋น„'
109109
accent={
110-
(
111-
Math.abs(statisticsDiff?.data?.monthlyPaymentDifference) ?? 0
110+
Math.abs(
111+
statisticsDiff?.data?.monthlyPaymentDifference
112112
)?.toLocaleString() ?? 0
113113
}
114114
suffix='์› ์ง€์ถœํ–ˆ์–ด์š”.'

Diff for: โ€Žapp/(head)/statistics/[category]/page.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { CATEGORY } from '@/constants/category';
99
import { COLORS } from '@/constants/color';
1010
import { QUERY_KEYS } from '@/constants/queryKey';
1111
import { useGenericQuery } from '@/hooks/query/globalQuery';
12+
import usePlatformCheck from '@/hooks/usePlatformCheck';
1213
import { AccountsPayment, AccountsPayments } from '@/types/paymentType';
1314
import { Category } from '@/types/table';
1415
import dayjs from 'dayjs';
@@ -24,13 +25,16 @@ function PaymentCategoryContent({ category }: { category: Category }) {
2425
const searchParams = useSearchParams();
2526
const date = searchParams.get('date');
2627

28+
const { platforms } = usePlatformCheck();
29+
2730
const { resData: paymentsData, isLoading } =
2831
useGenericQuery<AccountsPayments>(
2932
[QUERY_KEYS.STATISTICS_CATEGORY, category],
3033
() => getPaymentsCategory({ category })
3134
);
3235

33-
if (!paymentsData || !paymentsData.data || isLoading) return <Loading />;
36+
if (!platforms || !paymentsData || !paymentsData.data || isLoading)
37+
return <Loading />;
3438

3539
const {
3640
// paymentCount,
@@ -95,7 +99,13 @@ function PaymentCategoryContent({ category }: { category: Category }) {
9599
>
96100
{paymentDetail?.map((pd) => (
97101
<div key={pd.paymentId}>
98-
<PaymentCard showAccount={true} paymentInfo={pd} />
102+
<PaymentCard
103+
showAccount={true}
104+
paymentInfo={pd}
105+
isConnect={
106+
platforms?.includes(pd?.paymentPlace ?? '11๋ฒˆ๊ฐ€') ?? false
107+
}
108+
/>
99109
</div>
100110
))}
101111
</TitleBottomLine>

Diff for: โ€Žapp/(head)/statistics/recommend/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function RecommendationContent() {
135135
>
136136
<div>
137137
<CategorySubCard
138-
img={`/images/subscribes/${productId}.png`}
138+
img={`/images/products/${productId}.png`}
139139
category={category}
140140
color={COLORS[idx]}
141141
paymentName={storeName}

Diff for: โ€Žcomponents/molecules/CardBenefitContent.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function CardBenefitContent({
1515
selectedIdx: number;
1616
productId: number;
1717
}) {
18-
console.log(selectedIdx, productId);
1918
const { resData: productData, isLoading } =
2019
useGenericQuery<ProductDetailType>(
2120
[QUERY_KEYS.PRODUCT_DETAIL, selectedIdx],

Diff for: โ€Žcomponents/molecules/CardCarousel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const CardCarousel = ({ cards }: { cards: RecommendationsType[] }) => {
9595
>
9696
<Image
9797
ref={imageRef}
98-
src={`/images/subscribes/${productId}.png`}
98+
src={`/images/products/${productId}.png`}
9999
alt='card'
100100
width={0}
101101
height={0}

Diff for: โ€Žcomponents/molecules/PaymentCard.tsx

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { PLATFORMS } from '@/app/(head)/accounts/[accountId]/page';
1+
import { platformMap, PLATFORMS } from '@/constants/category';
22
import { AccountsPaymentsDetail } from '@/types';
3-
import { Badge, ChevronRight } from 'lucide-react';
3+
import { ChevronRight } from 'lucide-react';
44
import { parseCategory, parsePaymentType } from '@/lib/utils';
55
import UploadButton from './ui/UploadButton';
66

@@ -62,18 +62,31 @@ function PaymentCard({
6262
</span>
6363
) : null}
6464
</div>
65-
{shootNeed && paymentType === 'OFFLINE' ? (
65+
{shootNeed ? (
6666
<UploadButton paymentId={paymentId} />
67-
) : generalPlatform && !isConnect ? (
68-
<Badge className='bg-main text-white text-[0.5rem] font-medium'>
69-
์—ฐ๋™ํ•˜๊ธฐ
70-
</Badge>
67+
) : generalPlatform ? (
68+
isConnect ? (
69+
<a
70+
href={`/accounts/payments/${paymentId}`}
71+
className='text-[0.5rem] font-medium flex items-center gap-1'
72+
>
73+
์ƒ์„ธ๋‚ด์—ญ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ
74+
<ChevronRight className='w-2 h-2' />
75+
</a>
76+
) : (
77+
<a
78+
className='px-3 py-1 text-[.625rem] rounded-full cursor-pointer bg-main text-white font-medium'
79+
href={`/mypage/membership/${platformMap[paymentPlace]}?from=accounts`}
80+
>
81+
์—ฐ๋™ํ•˜๊ธฐ
82+
</a>
83+
)
7184
) : (
7285
<a
7386
href={`/accounts/payments/${paymentId}`}
7487
className='text-[0.5rem] font-medium flex items-center gap-1'
7588
>
76-
{shootNeed ? '์ƒ์„ธ๋‚ด์—ญ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ' : '์ƒ์„ธ๋ณด๊ธฐ'}{' '}
89+
์ƒ์„ธ๋ณด๊ธฐ
7790
<ChevronRight className='w-2 h-2' />
7891
</a>
7992
)}

Diff for: โ€Žcomponents/molecules/sion/CardSlide.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function CardSlide({ cards: initialCards }: CardSlideProps) {
7777
})}
7878
</ul>
7979
</div>
80-
<div className='absolute bottom-0 left-0 w-full h-10 flex flex-col justify-center items-center'>
80+
<div className='absolute -bottom-1 left-0 w-full h-10 flex flex-col justify-center items-center'>
8181
<p className='text-sm font-medium text-darkGrey'>{cards[0].bankName}</p>
8282
<p className='text-[0.9375rem]'>{cards[0].cardNumber}</p>
8383
</div>

Diff for: โ€Žcomponents/molecules/ui/SimpleBottomSheet.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ function SimpleBottomSheet({
3838
<DrawerContent
3939
ref={drawerRef}
4040
className='pb-24 pt-6 mx-auto max-w-[512px] px-2 w-full flex flex-col items-start justify-center border-none bg-black text-white'
41-
tabIndex={-1} // ํฌ์ปค์Šค ๊ฐ€๋Šฅํ•˜๋„๋ก ์„ค์ •
42-
role='dialog' // ์ ‘๊ทผ์„ฑ ์—ญํ•  ์ถ”๊ฐ€
43-
aria-modal='true' // ๋ชจ๋‹ฌ ์ƒํƒœ ๋ช…์‹œ
41+
role='dialog'
42+
aria-modal='true'
4443
>
4544
<DrawerHeader className='w-full'>
4645
<DrawerTitle></DrawerTitle>
47-
<DrawerDescription></DrawerDescription>
4846
{content}
47+
<DrawerDescription />
4948
</DrawerHeader>
5049
</DrawerContent>
5150
</Drawer>

Diff for: โ€Žconstants/category.ts

+11
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ export const CATEGORY: Record<Category, string> = {
1212
HEALTH: '๋ณ‘์›',
1313
OTHERS: '๊ธฐํƒ€',
1414
};
15+
16+
export const PLATFORMS = ['์ฟ ํŒก', '11๋ฒˆ๊ฐ€', '๋„ค์ด๋ฒ„ํŽ˜์ด'];
17+
18+
export const platformMap: Record<string, string> = {
19+
COUPANG: '์ฟ ํŒก',
20+
'11ST': '11๋ฒˆ๊ฐ€',
21+
NAVER: '๋„ค์ด๋ฒ„ํŽ˜์ด',
22+
์ฟ ํŒก: 'COUPANG',
23+
'11๋ฒˆ๊ฐ€': '11ST',
24+
๋„ค์ด๋ฒ„ํŽ˜์ด: 'NAVER',
25+
};

0 commit comments

Comments
ย (0)