Skip to content

Commit

Permalink
prevent board card click event
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartaithan committed Apr 1, 2024
1 parent 905d92e commit 762798c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions components/PlatformBadge/PlatformBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { platformLabels } from "@/constants/board";
import { type Platform } from "@/models/PlatformModel";
import { Badge, Popover, Text } from "@mantine/core";
import { memo, type FC, useMemo } from "react";
import { memo, type FC, useMemo, useState } from "react";
import classes from "./PlatformBadge.module.css";
import clsx from "clsx";

Expand All @@ -20,14 +20,26 @@ interface MultiPlatformProps {

const MultiPlatformPopover: FC<MultiPlatformProps> = (props) => {
const { labels } = props;
const [opened, setOpened] = useState<boolean>(false);
if (labels == null) return null;
return (
<Popover width={120} position="bottom" withArrow shadow="md">
<Popover
width={120}
position="bottom"
withArrow
shadow="md"
data-no-dnd="true"
opened={opened}
onChange={setOpened}>
<Popover.Target>
<Badge
className={clsx(classes.platform, classes.multi)}
radius="sm"
component="button">
component="button"
onClick={(e) => {
e.stopPropagation();
setOpened((o) => !o);
}}>
Multi
</Badge>
</Popover.Target>
Expand Down Expand Up @@ -62,7 +74,7 @@ const PlatformBadge: FC<PlatformBadgeProps> = (props) => {
}

return (
<Badge className={classes.platform} radius="sm">
<Badge className={classes.platform} radius="sm" data-no-dnd="true">
{label?.single != null
? platformLabels[label.single]?.short
: "Not Found"}
Expand Down

0 comments on commit 762798c

Please sign in to comment.