Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1be6ad5

Browse files
committedJul 20, 2023
TAL - make the search icon in the search by skill input clickable
1 parent dc352a0 commit 1be6ad5

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed
 
Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
11
@import "@libs/ui/styles/includes";
22

33
.searchIcon{
4-
width: $sp-6;
5-
height: $sp-6;
6-
color: $black-40;
7-
stroke: $black-40;
84
margin-right: 10px;
5+
6+
position: relative;
7+
z-index: 1;
8+
9+
cursor: pointer;
10+
color: $black-40;
11+
transition: 0.15s ease-in-out;
12+
13+
&:hover {
14+
color: $black-100;
15+
}
16+
17+
&.disabled {
18+
pointer-events: none;
19+
opacity: 0.4;
20+
}
21+
22+
&:before {
23+
content: "";
24+
display: block;
25+
position: absolute;
26+
top: 50%;
27+
left: 50%;
28+
transform: translate(-50%, -50%);
29+
width: $sp-12;
30+
height: $sp-12;
31+
}
32+
33+
svg {
34+
width: $sp-6;
35+
height: $sp-6;
36+
stroke: currentColor;
37+
color: inherit;
38+
}
939
}

‎src/apps/talent-search/src/components/search-input/SearchInput.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FC, useMemo } from 'react'
2+
import classNames from 'classnames'
23

34
import { IconOutline, InputMultiselectOption } from '~/libs/ui'
45
import { EmsiSkill, EmsiSkillSources, InputSkillSelector, Skill } from '~/libs/shared'
@@ -28,14 +29,23 @@ const SearchInput: FC<SearchInputProps> = props => {
2829
})))
2930
}
3031

32+
const searchIcon = useMemo(() => (
33+
<div
34+
className={classNames(styles.searchIcon, !emsiSkills.length && styles.disabled)}
35+
onClick={props.onSearch}
36+
>
37+
<IconOutline.SearchIcon />
38+
</div>
39+
), [props.onSearch, emsiSkills])
40+
3141
return (
3242
<InputSkillSelector
3343
className={props.className}
3444
autoFocus={props.autoFocus}
3545
placeholder='Enter skills you are searching for...'
3646
useWrapper={false}
3747
theme='clear'
38-
dropdownIcon={<IconOutline.SearchIcon className={styles.searchIcon} />}
48+
dropdownIcon={searchIcon}
3949
value={emsiSkills}
4050
onChange={onChange}
4151
onSubmit={props.onSearch}

0 commit comments

Comments
 (0)
Please sign in to comment.