Skip to content

Commit

Permalink
[CCUBE-895][RL] Update section headers, rename data test-id prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Quek Ruo Ling committed Feb 2, 2024
1 parent 9dbd15d commit 8fa1d06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/form/form-label-addon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export const PopoverAddon = ({
rootNode,
}: PopoverAddonProps): JSX.Element => {
// =========================================================================
// CONST, STATE, RE
// CONST, STATE, REF
// =========================================================================
const { content, type, icon, id, "data-testid": dataTestid } = addon;
const { content, type, icon, id, "data-testid": testId } = addon;

// =========================================================================
// RENDER FUNCTION
Expand All @@ -38,7 +38,7 @@ export const PopoverAddon = ({
<PopoverTrigger
trigger="click"
id={id}
data-testid={dataTestid}
data-testid={testId}
popoverContent={content}
rootNode={rootNode}
>
Expand Down
7 changes: 5 additions & 2 deletions src/popover-v2/popover-trigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const PopoverTrigger = ({
onPopoverDismiss,
...otherProps
}: PopoverV2TriggerProps) => {
// =========================================================================
// CONST, STATE, REF
// =========================================================================
const [visible, setVisible] = useState<boolean>(false);
const nodeRef = useRef<HTMLDivElement>();
const isMobile = useMediaQuery({
Expand All @@ -34,9 +37,9 @@ export const PopoverTrigger = ({
middleware: [offset(16), flip(), shift()],
});

// =============================================================================
// =========================================================================
// EFFECTS
// =============================================================================
// =========================================================================
useEffect(() => {
// NOTE: Do not add mouse down event if it's mobile
if (isMobile || !visible) {
Expand Down

0 comments on commit 8fa1d06

Please sign in to comment.