-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: 리액트 헬멧 라이브러리 제거 (#658) * chore: 리액트 헬멧 라이브러리 제거 (#658) * refactor: 셀럽잇 추천 맛집 섹션 분리 (#658) * refactor: 배너 섹션 분리 (#658) * refactor: 카테고리 섹션 분리 (#658) * refactor: 셀럽 베스트 섹션 분리 (#658) * refactor: 지역맛집 섹션 분리 (#658) * refactor: 메인페이지 리팩터링 (#658)
- Loading branch information
1 parent
b6d6998
commit cf6eb1b
Showing
12 changed files
with
3,739 additions
and
1,111 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
25 changes: 25 additions & 0 deletions
25
frontend/src/pages/MainPage/BannerSection/BannerSection.tsx
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 @@ | ||
import styled from 'styled-components'; | ||
import useMediaQuery from '~/hooks/useMediaQuery'; | ||
import BannerSlider from './components/BannerSlider'; | ||
|
||
function BannerSection() { | ||
const { isMobile } = useMediaQuery(); | ||
|
||
return ( | ||
<section> | ||
{isMobile ? ( | ||
<BannerSlider /> | ||
) : ( | ||
<StyledSliderContainer> | ||
<BannerSlider /> | ||
</StyledSliderContainer> | ||
)} | ||
</section> | ||
); | ||
} | ||
|
||
export default BannerSection; | ||
|
||
const StyledSliderContainer = styled.div` | ||
padding: 2rem 4rem; | ||
`; |
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
frontend/src/pages/MainPage/CategorySection/CategorySection.tsx
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,39 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import CategoryNavbar from '~/components/CategoryNavbar'; | ||
import RESTAURANT_CATEGORY from '~/constants/restaurantCategory'; | ||
|
||
function CategorySection() { | ||
const navigate = useNavigate(); | ||
|
||
const clickRestaurantCategory = (e: React.MouseEvent<HTMLElement>) => { | ||
const currentCategory = e.currentTarget.dataset.label; | ||
|
||
navigate(`/category/${currentCategory}`); | ||
}; | ||
|
||
return ( | ||
<section> | ||
<StyledTitle>카테고리</StyledTitle> | ||
<StyledCategoryBox> | ||
<CategoryNavbar | ||
categories={RESTAURANT_CATEGORY} | ||
externalOnClick={clickRestaurantCategory} | ||
includeAll={false} | ||
grid | ||
/> | ||
</StyledCategoryBox> | ||
</section> | ||
); | ||
} | ||
|
||
export default CategorySection; | ||
|
||
const StyledTitle = styled.h5` | ||
margin-left: 1.6rem; | ||
`; | ||
|
||
const StyledCategoryBox = styled.div` | ||
padding: 1.6rem 0.8rem; | ||
`; |
87 changes: 87 additions & 0 deletions
87
frontend/src/pages/MainPage/CelebBestSection/CelebBestSection.tsx
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,87 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import Slider from 'react-slick'; | ||
import styled from 'styled-components'; | ||
import ProfileImage from '~/components/@common/ProfileImage'; | ||
import { CelebCarouselSettings } from '~/constants/carouselSettings'; | ||
import { celebOptions } from '~/constants/celeb'; | ||
import useMediaQuery from '~/hooks/useMediaQuery'; | ||
import { FONT_SIZE } from '~/styles/common'; | ||
|
||
function CelebBestSection() { | ||
const { isMobile } = useMediaQuery(); | ||
const navigate = useNavigate(); | ||
|
||
const clickCelebIcon = (id: number) => { | ||
navigate(`/celeb/${id}`); | ||
}; | ||
|
||
return ( | ||
<section> | ||
<StyledTitle>셀럽 BEST</StyledTitle> | ||
{isMobile ? ( | ||
<StyledIconBox> | ||
{celebOptions.map(celeb => { | ||
const { name, profileImageUrl, id } = celeb; | ||
return ( | ||
<StyledCeleb onClick={() => clickCelebIcon(id)}> | ||
<ProfileImage name={name} imageUrl={profileImageUrl} size="64px" boxShadow /> | ||
<span>{name}</span> | ||
</StyledCeleb> | ||
); | ||
})} | ||
</StyledIconBox> | ||
) : ( | ||
<StyledSliderContainer> | ||
<Slider {...CelebCarouselSettings}> | ||
{celebOptions.map(celeb => { | ||
const { name, profileImageUrl, id } = celeb; | ||
return ( | ||
<StyledCeleb onClick={() => clickCelebIcon(id)}> | ||
<ProfileImage name={name} imageUrl={profileImageUrl} size="64px" boxShadow /> | ||
<span>{name}</span> | ||
</StyledCeleb> | ||
); | ||
})} | ||
</Slider> | ||
</StyledSliderContainer> | ||
)} | ||
</section> | ||
); | ||
} | ||
|
||
export default CelebBestSection; | ||
|
||
const StyledIconBox = styled.div` | ||
display: flex; | ||
gap: 2rem; | ||
padding: 1.6rem; | ||
justify-items: flex-start; | ||
overflow-x: scroll; | ||
&::-webkit-scrollbar { | ||
display: none; | ||
} | ||
`; | ||
|
||
const StyledCeleb = styled.div` | ||
display: flex !important; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 0.8rem; | ||
font-size: ${FONT_SIZE.sm}; | ||
cursor: pointer; | ||
`; | ||
|
||
const StyledTitle = styled.h5` | ||
margin-left: 1.6rem; | ||
`; | ||
|
||
const StyledSliderContainer = styled.div` | ||
padding: 2rem 4rem; | ||
`; |
Oops, something went wrong.