changed div with styled component

This commit is contained in:
davitbejanyan 2023-04-07 16:16:28 +04:00
parent b276c576f8
commit 43ecbee353
2 changed files with 13 additions and 8 deletions

View file

@ -38,7 +38,6 @@ export const Wrapper = styled.div`
right: 12px;
height: 16px;
width: 16px;
cursor: pointer;
}
`;

View file

@ -3,6 +3,7 @@ import { useDebouncedCallback } from 'use-debounce';
import Input from 'components/common/Input/Input';
import { useSearchParams } from 'react-router-dom';
import CloseIcon from 'components/common/Icons/CloseIcon';
import styled from 'styled-components';
interface SearchProps {
placeholder?: string;
@ -11,6 +12,16 @@ interface SearchProps {
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> = ({
placeholder = 'Search',
disabled = false,
@ -53,14 +64,9 @@ const Search: React.FC<SearchProps> = ({
ref={ref}
search
>
<div
role="button"
tabIndex={0}
onClick={clearSearchValue}
onKeyDown={() => {}}
>
<IconButtonWrapper onClick={clearSearchValue}>
<CloseIcon />
</div>
</IconButtonWrapper>
</Input>
);
};