Skip to content

Commit

Permalink
feat(Popover): add popover header component
Browse files Browse the repository at this point in the history
  • Loading branch information
avegancafe committed Jan 10, 2025
1 parent a21c451 commit 3584199
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/components/popover/Popover.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
font-weight: var(--j2-font-weight-strong);
line-height: var(--j2-line-height-heading-4);
}

.popoverHeader {
box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
border-radius: var(--j2-border-radius) var(--j2-border-radius) 0 0;

font-weight: bold;
}
12 changes: 11 additions & 1 deletion src/components/popover/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Popover as AntdPopover, PopoverProps } from 'antd'
import cx from 'classnames'
import styles from './Popover.module.css'

export type Props = Expand<PopoverProps>

const Popover = ({ children, placement = 'top', ...props }: Props) => {
Expand All @@ -14,4 +16,12 @@ const Popover = ({ children, placement = 'top', ...props }: Props) => {
)
}

export { Popover }
const PopoverHeader = ({ title }: { title: string }) => {
return (
<div className={cx('py-2 px-3 items-center', styles.popoverHeader)}>
{title}
</div>
)
}

export { Popover, PopoverHeader }
2 changes: 1 addition & 1 deletion src/components/popover/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Popover } from './Popover'
export * from './Popover'

0 comments on commit 3584199

Please sign in to comment.