Skip to content

Commit 66bbdcc

Browse files
committed
feat: add prop classname
1 parent 8571a2f commit 66bbdcc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ import './buttonWithSelector.scss'
99
* @param content Content to show in button
1010
* @param onClick Handler Function for button click
1111
* @param children Dropdown Content
12+
* @param className Other Classes to be applied
1213
*
1314
* @example
1415
* ```tsx
15-
* <ButtonWithSelector buttonContent='Create Job' buttonClickHandler={() => {}}>
16+
* <ButtonWithSelector buttonContent='Create Job' buttonClickHandler={() => {} className=''}>
1617
* {dropdownOptions}
1718
* </ButtonWithSelector>
1819
* ```
1920
*/
20-
const ButtonWithSelector = ({ content, onClick, children }: ButtonWithSelectorProps) => {
21+
const ButtonWithSelector = ({ content, onClick, children, className = '' }: ButtonWithSelectorProps) => {
2122
const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)
2223

2324
return (
2425
<>
2526
<button
26-
className="cta flex h-28 dc__no-right-radius dc__no-border-imp fs-12 fw-6 lh-18"
27+
className={`cta flex h-28 dc__no-right-radius dc__no-border-imp fs-12 fw-6 lh-18 ${className}`}
2728
type="button"
2829
onClick={onClick}
2930
>

src/Shared/Components/ButtonWithSelector/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export interface ButtonWithSelectorProps {
44
content: ReactNode
55
onClick: () => void
66
children: ReactNode
7+
className?: string
78
}

0 commit comments

Comments
 (0)