File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ const SearchBar = ({
47
47
containerClassName,
48
48
shouldDebounce = false ,
49
49
debounceTimeout = 300 ,
50
+ noBackgroundAndBorder = false ,
50
51
} : SearchBarProps ) => {
51
52
const [ showClearButton , setShowClearButton ] = useState ( ! ! initialSearchText )
52
53
const inputRef = useRef < HTMLInputElement > ( )
@@ -97,17 +98,19 @@ const SearchBar = ({
97
98
98
99
return (
99
100
< div className = { containerClassName } >
100
- < div className = "search-bar bc-n50 focus-within-border-b5 dc__hover-border-n300 dc__block w-100 min-w-200 dc__position-rel en-2 bw-1 br-4 h-32" >
101
+ < div
102
+ className = { `search-bar ${ noBackgroundAndBorder ? 'dc__no-border dc__no-background dc__hover-n50' : 'bc-n50 en-2 dc__hover-border-n300' } focus-within-border-b5 dc__block w-100 min-w-200 dc__position-rel br-4 bw-1 h-32` }
103
+ >
101
104
< Search className = "search-bar__icon dc__position-abs icon-color-n6 icon-dim-16" />
102
105
< input
103
106
placeholder = "Search"
104
107
data-testid = "search-bar"
105
108
type = "text"
106
109
{ ...inputProps }
107
110
defaultValue = { initialSearchText }
108
- className = { `search-bar__input bc-n50 dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ${
111
+ className = { `search-bar__input dc__position-abs w-100 h-100 br-4 dc__no-border pt-6 pr-10 pb-6 pl-30 fs-13 lh-20 fw-4 cn-9 placeholder-cn5 ${
109
112
showClearButton ? 'pr-30' : 'pr-10'
110
- } `}
113
+ } ${ noBackgroundAndBorder ? 'dc__no-background' : 'bc-n50' } `}
111
114
onChange = { handleChange }
112
115
onKeyDown = { handleKeyDown }
113
116
ref = { inputRef }
Original file line number Diff line number Diff line change @@ -31,4 +31,8 @@ export interface SearchBarProps {
31
31
* Timeout for the debounce handler to be triggered
32
32
*/
33
33
debounceTimeout ?: number
34
+ /**
35
+ * Hide the background and border of the search
36
+ */
37
+ noBackgroundAndBorder ?: boolean
34
38
}
You can’t perform that action at this time.
0 commit comments