-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: semantic tag로 변경 - div 떡칠되어 있던 것을 table 관련 태그로 바꿈 Dae-Hwa/airbnb/#19 * feat: 서치바 UI - 서치바 UI 조금 더 기획서에 가깝게 디자인 - 타입스크립트를 약간 사용했음 Dae-Hwa/airbnb/#2
- Loading branch information
1 parent
0e4f312
commit 6412dee
Showing
7 changed files
with
128 additions
and
58 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
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 was deleted.
Oops, something went wrong.
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,89 @@ | ||
import { Center, Container, Flex, Spacer } from '@chakra-ui/layout'; | ||
import styled from 'styled-components'; | ||
import SearchButton from '../SearchButton'; | ||
import SearchBarBtn from './SearchBarBtn'; | ||
|
||
function SearchBar() { | ||
return ( | ||
<Center> | ||
<SearchBarContainer> | ||
<Flex> | ||
<SearchBarBtn> | ||
<CheckInOut> | ||
<Flex direction="column"> | ||
<SearchBarSubTitle>체크인</SearchBarSubTitle> | ||
<SelectedContent contentType="placeholder">날짜 입력</SelectedContent> | ||
</Flex> | ||
<CustomSpacer /> | ||
<Flex direction="column"> | ||
<SearchBarSubTitle>체크아웃</SearchBarSubTitle> | ||
<SelectedContent contentType="placeholder">날짜 입력</SelectedContent> | ||
</Flex> | ||
</CheckInOut> | ||
</SearchBarBtn> | ||
|
||
<SearchBarBtn> | ||
<Flex direction="column"> | ||
<SearchBarSubTitle>요금</SearchBarSubTitle> | ||
<SelectedContent contentType="placeholder">금액대 설정</SelectedContent> | ||
</Flex> | ||
</SearchBarBtn> | ||
|
||
<SearchBarBtn> | ||
<Flex direction="column"> | ||
<SearchBarSubTitle>인원</SearchBarSubTitle> | ||
<SelectedContent contentType="placeholder">게스트 추가</SelectedContent> | ||
</Flex> | ||
</SearchBarBtn> | ||
|
||
<SearchButtonContainer> | ||
<SearchButton size="compact" /> | ||
</SearchButtonContainer> | ||
</Flex> | ||
</SearchBarContainer> | ||
</Center> | ||
); | ||
}; | ||
|
||
const SearchBarContainer = styled.div` | ||
width: 916px; | ||
height: 76px; | ||
background-color: ${({ theme }) => theme.colors.white}; | ||
border: 1px solid ${({ theme }) => theme.colors.gray4}; | ||
border-radius: ${({ theme }) => theme.borders.XL}; | ||
position: relative; | ||
`; | ||
|
||
const SearchBarSubTitle = styled.div` | ||
font-size: ${({theme}) => theme.fontSizes.XS}; | ||
font-weight: bold; | ||
width: 112px; | ||
height: 17px; | ||
margin-bottom: 4px; | ||
` | ||
|
||
const CheckInOut = styled.div` | ||
display: flex; | ||
` | ||
|
||
const CustomSpacer = styled.div` | ||
width: 24px; | ||
` | ||
|
||
type SelectedContentProps = { | ||
contentType: string | ||
} | ||
const SelectedContent = styled.div<SelectedContentProps>` | ||
font-size: ${({theme}) => theme.fontSizes.SM}; | ||
color: ${({contentType, theme}) => contentType === 'placeholder' ? theme.colors.gray2 : theme.colors.black}; | ||
width: 112px; | ||
height: 23px; | ||
` | ||
|
||
const SearchButtonContainer = styled.div` | ||
position: absolute; | ||
top: 18px; | ||
right: 18px; | ||
` | ||
|
||
export default SearchBar; |
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,29 @@ | ||
import styled from 'styled-components'; | ||
import { ReactElement } from 'react' | ||
|
||
type SearchBarBtnProps = { | ||
children: ReactElement[] | any; | ||
} | ||
|
||
function SearchBarBtn({children}: SearchBarBtnProps): ReactElement { | ||
return ( | ||
<SearchBarBtnContainer> | ||
{children} | ||
</SearchBarBtnContainer> | ||
) | ||
} | ||
|
||
const SearchBarBtnContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
padding: 14px 24px; | ||
width: 100%; | ||
height: 76px; | ||
border-radius: ${({theme}) => theme.borders.XL}; | ||
&:hover { | ||
background-color: ${({theme}) => theme.colors.gray5}; | ||
} | ||
` | ||
|
||
export default SearchBarBtn |