-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New : 주류 아이콘 추가 * Refactor : AlcoholNameTag 디렉토리 변경 * Refactor : Custom Appbar 컴포넌트 리팩토링 * Refactor : AlcoholNameTag 디렉토리 변경 * Refactor : 버튼베이스 컴포넌트 스타일 변경 * Refactor : BFF 분리 * New : 술백과 페이지 퍼블리싱
- Loading branch information
1 parent
fd86219
commit 4377bf2
Showing
21 changed files
with
270 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Paper, Container } from "@mui/material"; | ||
import WikiAppbar from "@/components/wiki/WikiAppbar"; | ||
import { ReactNode } from "react"; | ||
|
||
const layout = ({ children }: { children: ReactNode }) => { | ||
return ( | ||
<Paper> | ||
<WikiAppbar /> | ||
<Container sx={{ p: { xs: 0, sm: 4 } }} maxWidth={"lg"}> | ||
<Paper | ||
sx={{ | ||
display: "flex", | ||
position: "relative", | ||
flexDirection: "column", | ||
gap: 2, | ||
p: 2, | ||
}} | ||
> | ||
{children} | ||
</Paper> | ||
</Container> | ||
</Paper> | ||
); | ||
}; | ||
|
||
export default layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
import DevelopingPage from "@/components/DevelopingPage"; | ||
import AlcoholList from "@/components/wiki/AlcoholList"; | ||
import WikiAlcoholSelector from "@/components/wiki/WikiAlcoholSelector"; | ||
import { Stack } from "@mui/material"; | ||
import SectionHeading from "@/components/SectionHeading"; | ||
|
||
const WikiPage = () => { | ||
return <DevelopingPage />; | ||
import DevelopingNoticeImgae from "@/assets/images/developing.png"; | ||
import Image from "next/image"; | ||
|
||
const WikiPage = async () => { | ||
return ( | ||
<> | ||
<SectionHeading | ||
title={"투파이아 게시판"} | ||
subTitle={"투파이아들이 쓴 리뷰를 확인할 수 있어요!"} | ||
/> | ||
<WikiAlcoholSelector /> | ||
<AlcoholList /> | ||
|
||
<SectionHeading title={"술 정보"} subTitle={"곧 출시 됩니다!"} /> | ||
<Stack alignItems="center"> | ||
<Image src={DevelopingNoticeImgae} alt="개발중" /> | ||
</Stack> | ||
</> | ||
); | ||
}; | ||
|
||
export default WikiPage; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Stack, StackProps, Typography } from "@mui/material"; | ||
import React from "react"; | ||
|
||
interface SectionHeadingProps extends StackProps { | ||
title?: string; | ||
subTitle?: string; | ||
} | ||
|
||
const SectionHeading = ({ | ||
title, | ||
subTitle, | ||
...stackProps | ||
}: SectionHeadingProps) => { | ||
return ( | ||
<Stack {...stackProps}> | ||
<Typography variant={"subtitle2"} sx={{ fontWeight: "bold" }}> | ||
{title} | ||
</Typography> | ||
<Typography variant={"label"} sx={{ color: "text.secondary" }}> | ||
{subTitle} | ||
</Typography> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default SectionHeading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use client"; | ||
import AlcoholNameTag from "@/components/wiki/AlcoholNameTag"; | ||
import useGetAlcoholListQuery from "@/queries/alcohol/useGetAlcoholListQuery"; | ||
import { Pagination, Stack } from "@mui/material"; | ||
|
||
const AlcoholList = () => { | ||
const { data: alcohols } = useGetAlcoholListQuery(); | ||
return ( | ||
<Stack alignItems="center" gap={2}> | ||
<Stack gap={1} alignItems="center" width={'100%'}> | ||
{alcohols && | ||
alcohols.list.map((alcohol) => ( | ||
<AlcoholNameTag | ||
key={alcohol.alcoholNo} | ||
alcoholName={alcohol.alcoholName} | ||
alcoholType={alcohol.alcoholType} | ||
/> | ||
))} | ||
</Stack> | ||
<Pagination count={alcohols?.totalCount} /> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default AlcoholList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"use client"; | ||
import { useState, useCallback, useMemo } from "react"; | ||
import { Stack } from "@mui/material"; | ||
import WikiAlcoholSelectorBtn from "./WikiAlcoholSelectorBtn"; | ||
import WineIcon from "@/assets/icons/Alcohol/WineIcon.svg"; | ||
import WiskyIcon from "@/assets/icons/Alcohol/WiskyIcon.svg"; | ||
import SpiritsIcon from "@/assets/icons/Alcohol/SpiritsIcon.svg"; | ||
import TraditionalAlcoholIcon from "@/assets/icons/Alcohol/TraditionalAlcoholIcon.svg"; | ||
import SakeIcon from "@/assets/icons/Alcohol/SakeIcon.svg"; | ||
|
||
const WikiAlcoholSelector = () => { | ||
|
||
const btnList =useMemo(()=>[ | ||
{ title: "포도주", iconComponent: <WineIcon /> }, | ||
{ title: "위스키", iconComponent: <WiskyIcon /> }, | ||
{ title: "증류주", iconComponent: <SpiritsIcon /> }, | ||
{ title: "우리술", iconComponent: <TraditionalAlcoholIcon /> }, | ||
{ title: "사케", iconComponent: <SakeIcon /> }, | ||
],[]) | ||
|
||
const [selectedAlcohol, setSelectedAlcohol] = useState(btnList[0].title); | ||
|
||
const clickHandler = useCallback((title:string)=>{ | ||
setSelectedAlcohol(title) | ||
},[]) | ||
|
||
return ( | ||
<Stack direction="row" justifyContent='center' gap={2}> | ||
{btnList.map((btnInfo) => ( | ||
<WikiAlcoholSelectorBtn | ||
key={btnInfo.title} | ||
isSelected={selectedAlcohol === btnInfo.title} | ||
onClick={()=>clickHandler(btnInfo.title)} | ||
{...btnInfo} | ||
/> | ||
))} | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default WikiAlcoholSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Stack, Typography, ButtonBase, ButtonBaseProps } from "@mui/material"; | ||
import { ReactNode, memo } from "react"; | ||
|
||
interface WiciAlcoholSelectorBtnProps extends Omit<ButtonBaseProps, "onClick"> { | ||
isSelected?: boolean; | ||
title: string; | ||
iconComponent: ReactNode; | ||
onClick: () => void; | ||
} | ||
|
||
const WikiAlcoholSelectorBtn = ({ | ||
isSelected, | ||
title, | ||
iconComponent, | ||
onClick, | ||
...buttonBaseProps | ||
}: WiciAlcoholSelectorBtnProps) => { | ||
return ( | ||
<ButtonBase onClick={onClick} {...buttonBaseProps}> | ||
<Stack alignItems="center"> | ||
<Stack | ||
justifyContent="center" | ||
alignItems="center" | ||
sx={{ | ||
borderRadius: "50%", | ||
width: 56, | ||
height: 56, | ||
backgroundColor: isSelected ? "primary.main" : "#F6EAFB", | ||
transitionDuration: 200, | ||
}} | ||
> | ||
{iconComponent} | ||
</Stack> | ||
<Typography sx={{ p: 1 }}>{title}</Typography> | ||
</Stack> | ||
</ButtonBase> | ||
); | ||
}; | ||
|
||
export default memo(WikiAlcoholSelectorBtn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use client' | ||
import CustomAppbar from "@/components/CustomAppbar"; | ||
import SearchIcon from "@/assets/icons/SearchIcon.svg"; | ||
|
||
const WikiAppbar = () => { | ||
return ( | ||
<CustomAppbar | ||
title="술백과" | ||
buttonComponent={<SearchIcon />} | ||
onClickButton={() => console.log("눌림")} | ||
/> | ||
); | ||
}; | ||
|
||
export default WikiAppbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters