Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions src/components/common/Filter/Filter.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Badge } from '@/components/ui/badge';
import { DualSlider } from '@/components/ui/dual-slider';
import { Label } from '@/components/ui/label';
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
import useFilterStore, { WineType } from '@/stores/filterStore';

import DualSlider from '../slider/DualSlider';

const Filter = () => {
const { type, setType, minPrice, maxPrice, setPriceRange, rating, setRating } = useFilterStore();

Expand All @@ -13,8 +14,8 @@ const Filter = () => {
return (
<div className='m-8 flex flex-col gap-9'>
<div className='flex flex-col gap-3'>
<span className='text-xl font-bold'>WINE TYPES</span>
<div className='flex gap-2.5'>
<span className='custom-text-xl-bold'>WINE TYPES</span>
<div className='flex gap-3'>
{/* todo: 공통 뱃지로 변경 필요 */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

뱃지 컴포넌트 넣어주셨다면 주석 제거하셔도 좋을 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

놓친 부분인데 찾아주셨네요! 주석 제거하겠습니다

{wineTypeOptions.map((option, index) => (
<Badge
Expand All @@ -28,29 +29,22 @@ const Filter = () => {
))}
</div>
</div>
<div className='flex flex-col gap-5'>
<span className='text-xl font-bold'>PRICE</span>
{/* todo: 공통 레인지 슬라이더로 변경 필요 */}
<DualSlider
min={0}
max={100000}
step={1000}
defaultValue={[0, 100000]}
value={priceRange}
onValueChange={setPriceRange}
minStepsBetweenThumbs={5}
/>
<div className='flex flex-col gap-2'>
<span className='custom-text-xl-bold'>PRICE</span>
<DualSlider max={1000000} value={priceRange} onChange={setPriceRange} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 넘겨주신 것 같습니다!

</div>
<div className='flex flex-col gap-2.5'>
<span className='text-xl font-bold'>RATING</span>
<span className='custom-text-xl-bold'>RATING</span>
{/* todo: 공통 라디오, 라벨 컴포넌트로 변경 필요 */}
<RadioGroup value={rating} onValueChange={setRating}>
<div className='flex items-center gap-3'>
{/* 전체인 경우 rating값을 아예 안보내는 것 같아 임의로 all로 설정 */}
<RadioGroupItem value='all' id='rate-all' />
<Label htmlFor='rate-all'>전체</Label>
<Label htmlFor='rate-all' className='custom-text-lg-medium'>
전체
</Label>
</div>
<div className='flex items-center gap-3'>
<div className='flex items-center gap-3 custom-text-lg-medium'>
<RadioGroupItem value='4.6' id='rate1' />
<Label htmlFor='rate1'>4.5 - 5.0</Label>
</div>
Expand Down
27 changes: 18 additions & 9 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
import '@/styles/globals.css';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import clsx from 'clsx';
import Head from 'next/head';
import { useRouter } from 'next/router';

import Gnb from '@/components/common/Gnb';

import type { AppProps } from 'next/app';

const queryClient = new QueryClient();

export default function App({ Component, pageProps }: AppProps) {
const { pathname } = useRouter();
const pagesWithoutGnb = ['/login', '/signup', '/_error'];
const pagesWithoutGnb = ['/login', '/signup', '/signin', '/_error'];
const hideHeader = pagesWithoutGnb.includes(pathname);

return (
<>
{!hideHeader && <Gnb />}
<div
className={clsx({
'pt-[70px] md:pt-[100px] xl:pt-[110px]': !hideHeader,
})}
>
<Component {...pageProps} />
</div>
<Head>
<title>WINE</title>
</Head>
<QueryClientProvider client={queryClient}>
{!hideHeader && <Gnb />}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

불필요한 렌더링까지 잘 줄이신 것 같습니다. 고생하셨습니다!

<div
className={clsx({
'pt-[70px] md:pt-[100px] xl:pt-[110px]': !hideHeader,
})}
>
<Component {...pageProps} />
</div>
</QueryClientProvider>
</>
);
}
9 changes: 9 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ export default function Document() {
<Html lang='ko'>
<Head>
<link rel='icon' href='/favicon.ico' />
<meta charSet='UTF-8' />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta name='description' content='와인 리뷰 사이트' />
<meta property='og:title' content='WINE' />
<meta property='og:description' content='와인 리뷰 사이트' />
{/* todo: 배포 후 이미지, url 변경 필요 */}
<meta property='og:image' content='' />
<meta property='og:url' content='' />
<meta property='og:type' content='website' />
</Head>
<body>
<Main />
Expand Down