|
@@ -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
|
|
|
|
- role="button"
|
|
|
|
- tabIndex={0}
|
|
|
|
- onClick={clearSearchValue}
|
|
|
|
- onKeyDown={() => {}}
|
|
|
|
- >
|
|
|
|
|
|
+ <IconButtonWrapper onClick={clearSearchValue}>
|
|
<CloseIcon />
|
|
<CloseIcon />
|
|
- </div>
|
|
|
|
|
|
+ </IconButtonWrapper>
|
|
</Input>
|
|
</Input>
|
|
);
|
|
);
|
|
};
|
|
};
|