diff --git a/src/components/common/SearchBar.tsx b/src/components/common/SearchBar.tsx new file mode 100644 index 0000000..c6d81ed --- /dev/null +++ b/src/components/common/SearchBar.tsx @@ -0,0 +1,45 @@ +import styled from '@emotion/styled'; +import { Icon } from '@iconify/react'; +import { theme } from '@/style/theme'; +import { InputHTMLAttributes } from 'react'; + +interface SearchBarType extends InputHTMLAttributes { + width: number; + onChange?: (e: React.ChangeEvent) => void; +} + +export const SearchBar = ({ + width, + onChange = () => { + console.log('change!'); + }, + ...props +}: SearchBarType) => { + return ( + + <_SearchBar placeholder={props.placeholder} onChange={onChange} /> + + + ); +}; + +const Wrapper = styled.div<{ width: number }>` + width: ${({ width }) => `${width}px`}; + position: relative; + & > svg { + position: absolute; + right: 0px; + top: 15px; + cursor: pointer; + } +`; + +const _SearchBar = styled.input` + width: 100%; + height: 50px; + border-bottom: 1px ${theme.color.gray5} solid; + font-size: 14px; + & ::placeholder { + color: ${theme.color.gray2}; + } +`; diff --git a/src/pages/Team/index.tsx b/src/pages/Team/index.tsx index c72f6a8..d988b76 100644 --- a/src/pages/Team/index.tsx +++ b/src/pages/Team/index.tsx @@ -4,6 +4,7 @@ import { XButton } from '@/components/common/XButton'; import { Icon } from '@iconify/react'; import { theme } from '@/style/theme'; import { TeamContainer } from '@/components/Team/TeamContainer'; +import { SearchBar } from '@/components/common/SearchBar'; type TagType = 'club' | 'team' | 'alone' | 'etc'; @@ -45,10 +46,7 @@ export const Team = () => { 프로젝트를 개발하고 관리할 팀을 정의해보세요. -
- - -
+ div:nth-of-type(1) { - & > svg { - position: relative; - right: 24px; - top: 6px; - cursor: pointer; - } - } -`; - -const SearchBar = styled.input` - width: 312px; - height: 50px; - border-bottom: 1px ${theme.color.gray5} solid; - font-size: 14px; - & ::placeholder { - color: ${theme.color.gray2}; - } `; const TipBox = styled.div`