11import styled from '@emotion/styled' ;
2- import { useSearchParams } from 'react-router-dom' ;
3- import { CLUB_CATEGORY } from '@/app/constants/clubCategory' ;
42import { ClubSearchInput } from '@/pages/user/Main/components/BannerSection/ClubSearchInput.tsx' ;
5- import { CLUB_RECRUIT_STATUS_KOR , type RecruitStatus } from '@/pages/user/Main/types/club.ts' ;
6- import { Dropdown } from '@/shared/components/Dropdown/index.tsx' ;
7- import {
8- engToKorCategory ,
9- korToEngCategory ,
10- korToEngRecruitStatus ,
11- } from '@/shared/utils/formatting.ts' ;
123import * as S from './Banner.styled.ts' ;
134import { BannerSlideshow } from './BannerSlideshow' ;
145import * as B from './BannerText.styled.ts' ;
15- import type { ClubCategory , ClubCategoryEng } from '@/shared/types/club' ;
166
17- type FilterRecruitStatus = RecruitStatus | '์ ์ฒด' ;
187type Props = {
198 onChangeSearch : ( searchText : string ) => void ;
20- onSelectCategory : ( category : ClubCategoryEng ) => void ;
21- onSelectStatus : ( recruitStatus : FilterRecruitStatus ) => void ;
22- selectedCategory : ClubCategoryEng ;
23- selectedRecruitStatus : RecruitStatus | undefined ;
249} ;
2510
26- export const BannerSection = ( {
27- onChangeSearch,
28- onSelectCategory,
29- onSelectStatus,
30- selectedCategory,
31- selectedRecruitStatus,
32- } : Props ) => {
33- const [ filterParams , setFilterParams ] = useSearchParams ( ) ;
34-
35- const handleCategoryClick = ( newCategory : ClubCategory ) => {
36- const engCategory = korToEngCategory [ newCategory ] ;
37- onSelectCategory ( engCategory ) ;
38- filterParams . set ( 'category' , engCategory ) ;
39- setFilterParams ( filterParams ) ;
40- } ;
41-
42- const handleRecruitStatusClick = ( status : RecruitStatus ) => {
43- onSelectStatus ( status ) ;
44- if ( status === '์ ์ฒด' ) {
45- filterParams . delete ( 'status' ) ;
46- } else {
47- filterParams . set ( 'status' , korToEngRecruitStatus [ status ] ) ;
48- }
49- setFilterParams ( filterParams ) ;
50- } ;
51-
11+ export const BannerSection = ( { onChangeSearch } : Props ) => {
5212 return (
5313 < S . BannerWrapper >
5414 < BannerSlideshow />
@@ -58,25 +18,11 @@ export const BannerSection = ({
5818 < B . HeaderText > ํจ๊ปํ ์ฌ๋์ด ์๋ ๊ณณ, ๋์๋ฆฌ์.</ B . HeaderText >
5919 < B . SubText > ๊ด์ฌ ์๋ ๋์๋ฆฌ๋ฅผ ์ฐพ๊ณ , ์ฐธ์ฌํด๋ณด์ธ์.</ B . SubText >
6020 </ B . BannerTextWrapper >
61-
62- < SearchContainer >
63- < ClubSearchInput onChangeSearch = { onChangeSearch } />
64- < DropdownWrapper >
65- < Dropdown
66- placeholder = '๋์๋ฆฌ ์นดํ
๊ณ ๋ฆฌ'
67- value = { engToKorCategory [ selectedCategory ] }
68- options = { CLUB_CATEGORY }
69- onSelect = { handleCategoryClick }
70- />
71- < Dropdown
72- placeholder = '๋ชจ์ง ์ํ'
73- value = { selectedRecruitStatus === '์ ์ฒด' ? undefined : selectedRecruitStatus }
74- options = { [ '์ ์ฒด' , ...CLUB_RECRUIT_STATUS_KOR ] as RecruitStatus [ ] }
75- onSelect = { handleRecruitStatusClick }
76- />
77- </ DropdownWrapper >
78- </ SearchContainer >
7921 </ ContentContainer >
22+
23+ < SearchContainer >
24+ < ClubSearchInput onChangeSearch = { onChangeSearch } />
25+ </ SearchContainer >
8026 </ S . BannerWrapper >
8127 ) ;
8228} ;
@@ -89,50 +35,39 @@ const ContentContainer = styled.div(({ theme }) => ({
8935 margin : '0 auto' ,
9036 display : 'flex' ,
9137 flexDirection : 'column' ,
92- gap : '16px ' ,
38+ gap : '24px ' ,
9339 padding : '0 1.5rem' ,
9440 boxSizing : 'border-box' ,
41+ paddingBottom : '60px' ,
9542
9643 [ `@media (max-width: ${ theme . breakpoints . mobile } )` ] : {
9744 padding : '0 1rem' ,
98- gap : '12px' ,
45+ paddingBottom : '50px' ,
46+ gap : '16px' ,
9947 } ,
10048} ) ) ;
10149
10250export const SearchContainer = styled . div ( ( { theme } ) => ( {
103- position : 'relative' ,
51+ position : 'absolute' ,
52+ bottom : '-30px' ,
53+ left : '0' ,
54+ right : '0' ,
10455 zIndex : 10 ,
105- display : 'flex' ,
106- flexDirection : 'row' ,
107- justifyContent : 'flex-start' ,
108- alignItems : 'center' ,
109- width : '100%' ,
110- gap : 16 ,
56+ width : '700px' ,
57+ maxWidth : '90%' ,
58+ marginLeft : 'max(20px, calc((100vw - 1200px) / 2))' ,
11159 boxSizing : 'border-box' ,
112- opacity : 1 ,
11360
114- [ `@media(max-width: ${ theme . breakpoints . mobile } )` ] : {
115- flexDirection : 'column' ,
116- gap : 12 ,
117- width : '100%' ,
118- '& > *' : {
119- width : '100%' ,
120- boxSizing : 'border-box' ,
121- } ,
61+ [ `@media (max-width: ${ theme . breakpoints . web } )` ] : {
62+ width : '600px' ,
63+ bottom : '-25px' ,
64+ marginLeft : '1.5rem' ,
12265 } ,
123- } ) ) ;
12466
125- export const DropdownWrapper = styled . div ( ( { theme } ) => ( {
126- display : 'flex' ,
127- flexDirection : 'row' ,
128- gap : 16 ,
129- zIndex : 3 ,
130-
131- [ `@media(max-width: ${ theme . breakpoints . mobile } )` ] : {
132- width : '100%' ,
133- gap : 12 ,
134- '& > *' : {
135- width : 'calc(50% - 6px)' ,
136- } ,
67+ [ `@media (max-width: ${ theme . breakpoints . mobile } )` ] : {
68+ width : 'calc(100% - 2rem)' ,
69+ bottom : '-25px' ,
70+ marginLeft : '1rem' ,
71+ marginRight : '1rem' ,
13772 } ,
13873} ) ) ;
0 commit comments