Skip to content

Commit d6e534e

Browse files
committed
refactor(CPopover): improve and clean-up syntax
1 parent b210f11 commit d6e534e

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

packages/coreui-react/src/components/popover/CPopover.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,12 @@ export const CPopover: FC<CPopoverProps> = ({
118118
{(state) => (
119119
<div
120120
className={classNames(
121-
`popover bs-popover-${
122-
placement === 'left' ? 'start' : placement === 'right' ? 'end' : placement
123-
}`,
124-
state === 'entering'
125-
? 'fade'
126-
: state === 'entered'
127-
? 'fade show'
128-
: state === 'exiting'
129-
? 'fade'
130-
: 'fade',
121+
'popover',
122+
`bs-popover-${placement.replace('left', 'start').replace('right', 'end')}`,
123+
'fade',
124+
{
125+
show: state === 'entered',
126+
},
131127
className,
132128
)}
133129
ref={setPopperElement}

0 commit comments

Comments
 (0)