Skip to content
Merged
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Metadata } from 'next';

import '@/styles/globals.css';
import KakaoInitializer from '@/components/common/Button/KakaoButton/KakaoInitializer';
import ScrollToTop from '@/components/common/ScrollToTop';
import ReactQueryProvider from '@/components/ReactQueryProvider';
import { suite } from '@/styles/font';

Expand All @@ -19,6 +20,7 @@ export default function RootLayout({
<html lang="ko">
<body className={`${suite.className} bg-gray-100`}>
<div className="mx-auto min-h-screen w-full max-w-[430px] bg-white shadow-md">
<ScrollToTop />
<ReactQueryProvider>{children}</ReactQueryProvider>
<KakaoInitializer />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/pick/invite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const InviteHandler = () => {
: WishpoolCardImage;
return (
<>
<div className="relative mt-[14rem] w-full rounded-[16px] bg-white">
<div className="relative mt-[9rem] w-full rounded-[16px] bg-white">
<Icon
name="ribbon"
width={120}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pick/select/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const SelectLayout = ({ children }: { children: React.ReactNode }) => {
router.push(PATH.PICK_LIST);
}}
/>
<main className="bg-blue-6">{children}</main>
<main className="bg-blue-6 h-[100vh]">{children}</main>
<SwipeGuide />
</>
);
Expand Down
15 changes: 14 additions & 1 deletion src/app/pick/select/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';

import Button from '@/components/common/Button';
import Toast from '@/components/common/Toast';
import CarouselCard from '@/components/pick/select/CarouselCard';
import GiftLoading from '@/components/pick/select/GiftLoading';
import { PATH } from '@/constants/common/path';
Expand All @@ -17,6 +18,7 @@ const SelectPage = () => {

const [items, setItems] = useState<GiftCardType[]>([]);
const [loading, setLoading] = useState(false);
const [toast, setToast] = useState(false);

useEffect(() => {
const initialItems = getInitialItems();
Expand All @@ -26,6 +28,16 @@ const SelectPage = () => {
const { ref, active } = useCarouselCard<HTMLDivElement>();

const handleRemove = (id: number) => {
if (items.length <= 1) {
setToast(true);

setTimeout(() => {
window.location.reload();
}, 1000);

return;
}

const updatedItems = items.filter((item) => item.giftId !== id);
setItems(updatedItems);
};
Expand All @@ -47,6 +59,7 @@ const SelectPage = () => {

return (
<div className="flex flex-col">
{toast && <Toast>선물은 최소 1개 이상 선택해야 해요!</Toast>}
<section
ref={ref}
className="no-scrollbar bg-blue-5 flex snap-x snap-mandatory gap-[2.4rem] overflow-x-auto overflow-y-hidden px-[2rem] pt-[7rem] pb-[5rem]"
Expand All @@ -67,7 +80,7 @@ const SelectPage = () => {
<div aria-hidden className="w-[calc(50vw-9rem)] shrink-0 snap-none" />
</section>

<section className="bg-background-02 relative">
<section className="bg-background-02 relative pb-[12rem]">
<div className="flex flex-col items-center py-[3rem]">
<Image
src="/images/hole.svg"
Expand Down
15 changes: 9 additions & 6 deletions src/app/wishpool/(viewer)/[id]/(detail)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const DetailPage = () => {
const { isOpen, onOpen, onClose } = useModal();

const [isError, setIsError] = useState(false);

const { data: wishpool } = useGetWishpoolDetail(wishpoolId);
const imageKey = wishpool?.imageKey || '';
const { data: wishpoolImage } = useGetWishpoolImage(imageKey);
Expand Down Expand Up @@ -77,14 +76,18 @@ const DetailPage = () => {
</div>
<div className="mt-[2rem]">
<h2 className="head1 mb-[0.4rem]">
{wishpool?.celebrant}에게 보내는 위시풀
{wishpool?.celebrant}님을 위한 위시풀
</h2>
<span className="body1 flex items-center gap-[0.8rem]">
{wishpool?.joinCount}명 참여
<Icon
name="plus"
className="h-[1.8rem] w-[1.8rem] rounded-[3px] bg-gray-400 text-white"
/>
<button
onClick={() => router.push(PATH.WISHPOOL_SHARE(wishpoolId))}
>
<Icon
name="plus"
className="h-[1.8rem] w-[1.8rem] rounded-[3px] bg-gray-400 text-white"
/>
</button>
</span>
<button
type="button"
Expand Down
6 changes: 1 addition & 5 deletions src/app/wishpool/(viewer)/[id]/invite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import { PATH } from '@/constants/common/path';
import { useGetWishpoolId } from '@/hooks/common/useGetWishpoolId';
import { useGetChosenUrl } from '@/hooks/pick/useGetChosenUrl';
import { ShareSectionType } from '@/types/common/ShareSectionType';

const getOrigin = () => {
if (typeof window !== 'undefined') return window.location.origin;
return process.env.NEXT_PUBLIC_API_URL;
};
import { getOrigin } from '@/utils/commons/getOrigin';

const InvitePage = () => {
const content = 'share' as ShareSectionType;
Expand Down
51 changes: 0 additions & 51 deletions src/app/wishpool/history/data.ts

This file was deleted.

24 changes: 24 additions & 0 deletions src/app/wishpool/history/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
'use client';

import { useRouter } from 'next/navigation';

import { useGetWishpools } from '@/api/domain/home/hooks';
import BirthdayInfo from '@/components/common/BirthdayInfo';
import Button from '@/components/common/Button';
import EventCard from '@/components/common/EventCard';
import { PATH } from '@/constants/common/path';

const HistoryPage = () => {
const router = useRouter();

const { data: wishpools } = useGetWishpools();
return (
<>
Expand All @@ -24,6 +30,24 @@ const HistoryPage = () => {
/>
</div>
))}
{wishpools && wishpools.length === 0 && (
<div className="mt-[14rem] flex flex-col items-center justify-center">
<div className="text-text mb-[3.6rem] text-center">
<h2 className="title1 mb-[0.4rem]">
위시풀 기록이 아직 없어요.
</h2>
<p className="body1">첫 위시풀을 만들어볼까요?</p>
</div>
<div className="w-[17.1rem]">
<Button
textSize="sm"
onClick={() => router.push(PATH.WISHPOOL_CREATE_STEP1)}
>
위시풀 만들기
</Button>
</div>
</div>
)}
</div>
</div>
</>
Expand Down
Binary file modified src/assets/images/congrats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/common/InfoBox/InfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const INFO_MESSAGE = {

export const INFO_NOTICE_LIST = [
{
title: '생일자는 진짜 필요한 고를 수 있어요.',
title: '생일자는 진짜 필요한 선물을 고를 수 있어요.',
content: (
<>
친구들이 제안한 선물 중에서 <br />
Expand Down
16 changes: 16 additions & 0 deletions src/components/common/ScrollToTop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client';

import { usePathname } from 'next/navigation';
import { useEffect } from 'react';

const ScrollToTop = () => {
const pathname = usePathname();

useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);

return null;
};

export default ScrollToTop;
4 changes: 4 additions & 0 deletions src/utils/commons/getOrigin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const getOrigin = () => {
if (typeof window !== 'undefined') return window.location.origin;
return process.env.NEXT_PUBLIC_API_URL;
};
Loading