Skip to content

Commit 52c41f1

Browse files
committed
feat: Allow to pass className in componentsProps.SearchBarDesktop
1 parent 88d04a6 commit 52c41f1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: packages/cozy-search/src/components/AssistantDesktop.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ AssistantDesktop.propTypes = {
2626
SearchBarDesktop: PropTypes.shape({
2727
elevation: PropTypes.number,
2828
size: PropTypes.string,
29-
hasHalfBorderRadius: PropTypes.bool
29+
hasHalfBorderRadius: PropTypes.bool,
30+
className: PropTypes.string
3031
})
3132
})
3233
}

Diff for: packages/cozy-search/src/components/Search/SearchBarDesktop.jsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import cx from 'classnames'
12
import React, { useRef } from 'react'
23
import { useNavigate } from 'react-router-dom'
34

@@ -21,7 +22,8 @@ const SearchBarDesktop = ({
2122
onChange,
2223
elevation,
2324
size,
24-
hasHalfBorderRadius
25+
hasHalfBorderRadius,
26+
className
2527
}) => {
2628
const { t } = useI18n()
2729
const { searchValue, results, selectedIndex, setSelectedIndex } = useSearch()
@@ -87,11 +89,12 @@ const SearchBarDesktop = ({
8789
<span>
8890
<SearchBar
8991
elevation={elevation}
90-
className={
92+
className={cx(
93+
className,
9194
searchValue && hasHalfBorderRadius
9295
? styles['searchBarDesktop--result']
9396
: ''
94-
}
97+
)}
9598
ref={searchRef}
9699
size={size}
97100
icon={

0 commit comments

Comments
 (0)