Skip to content

Commit d00c19f

Browse files
committed
feat: add classes for pop up body, fix styling
1 parent 66bbdcc commit d00c19f

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/Shared/Components/ButtonWithSelector/ButtonWithSelector.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@ import './buttonWithSelector.scss'
1313
*
1414
* @example
1515
* ```tsx
16-
* <ButtonWithSelector buttonContent='Create Job' buttonClickHandler={() => {} className=''}>
16+
* <ButtonWithSelector content='Create Job' onClick={() => {}} className=''>
1717
* {dropdownOptions}
1818
* </ButtonWithSelector>
1919
* ```
2020
*/
21-
const ButtonWithSelector = ({ content, onClick, children, className = '' }: ButtonWithSelectorProps) => {
21+
const ButtonWithSelector = ({
22+
content,
23+
onClick,
24+
children,
25+
className = '',
26+
popUpBodyClassName = '',
27+
}: ButtonWithSelectorProps) => {
2228
const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)
2329

2430
return (
25-
<>
31+
<div className="flexbox">
2632
<button
27-
className={`cta flex h-28 dc__no-right-radius dc__no-border-imp fs-12 fw-6 lh-18 ${className}`}
33+
className={`cta flex h-28 dc__no-right-radius dc__no-border-imp fs-12 fw-6 lh-20-imp ${className}`}
2834
type="button"
2935
onClick={onClick}
3036
>
@@ -37,9 +43,11 @@ const ButtonWithSelector = ({ content, onClick, children, className = '' }: Butt
3743
style={{ ['--rotateBy' as any]: isMenuOpen ? '180deg' : '0deg' }}
3844
/>
3945
</PopupMenu.Button>
40-
<PopupMenu.Body>{children}</PopupMenu.Body>
46+
<PopupMenu.Body rootClassName={`pt-4 pb-4 dc__border dc__overflow-hidden ${popUpBodyClassName}`}>
47+
{children}
48+
</PopupMenu.Body>
4149
</PopupMenu>
42-
</>
50+
</div>
4351
)
4452
}
4553

src/Shared/Components/ButtonWithSelector/types.ts

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

0 commit comments

Comments
 (0)