changed div with styled component
This commit is contained in:
parent
b276c576f8
commit
43ecbee353
2 changed files with 13 additions and 8 deletions
|
@ -38,7 +38,6 @@ export const Wrapper = styled.div`
|
||||||
right: 12px;
|
right: 12px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { useDebouncedCallback } from 'use-debounce';
|
||||||
import Input from 'components/common/Input/Input';
|
import Input from 'components/common/Input/Input';
|
||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
import CloseIcon from 'components/common/Icons/CloseIcon';
|
import CloseIcon from 'components/common/Icons/CloseIcon';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
interface SearchProps {
|
interface SearchProps {
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
|
@ -11,6 +12,16 @@ interface SearchProps {
|
||||||
value?: string;
|
value?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IconButtonWrapper = styled.span.attrs(() => ({
|
||||||
|
role: 'button',
|
||||||
|
tabIndex: '0',
|
||||||
|
}))`
|
||||||
|
height: 16px !important;
|
||||||
|
display: inline-block;
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
`;
|
||||||
const Search: React.FC<SearchProps> = ({
|
const Search: React.FC<SearchProps> = ({
|
||||||
placeholder = 'Search',
|
placeholder = 'Search',
|
||||||
disabled = false,
|
disabled = false,
|
||||||
|
@ -53,14 +64,9 @@ const Search: React.FC<SearchProps> = ({
|
||||||
ref={ref}
|
ref={ref}
|
||||||
search
|
search
|
||||||
>
|
>
|
||||||
<div
|
<IconButtonWrapper onClick={clearSearchValue}>
|
||||||
role="button"
|
|
||||||
tabIndex={0}
|
|
||||||
onClick={clearSearchValue}
|
|
||||||
onKeyDown={() => {}}
|
|
||||||
>
|
|
||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</div>
|
</IconButtonWrapper>
|
||||||
</Input>
|
</Input>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue