use popover over tooltip for badges
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Text, Tooltip, Card } from "@mantine/core";
|
import { Box, Text, Popover, Card } from "@mantine/core";
|
||||||
import { usePlayerBadges, useAllBadges } from "../queries";
|
import { usePlayerBadges, useAllBadges } from "../queries";
|
||||||
import { useAuth } from "@/contexts/auth-context";
|
import { useAuth } from "@/contexts/auth-context";
|
||||||
import { Badge, BadgeProgress } from "../types";
|
import { Badge, BadgeProgress } from "../types";
|
||||||
@@ -115,26 +115,8 @@ const BadgeShowcase = ({ playerId }: BadgeShowcaseProps) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{badgesToDisplay.map((display) => (
|
{badgesToDisplay.map((display) => (
|
||||||
<Tooltip
|
<Popover key={display.badge.id} width={220} position="bottom" withArrow shadow="md">
|
||||||
key={display.badge.id}
|
<Popover.Target>
|
||||||
label={
|
|
||||||
<Box>
|
|
||||||
<Text size="xs" fw={600} mb={4}>
|
|
||||||
{display.badge.name}
|
|
||||||
</Text>
|
|
||||||
<Text size="xs" mb={4}>
|
|
||||||
{display.badge.description}
|
|
||||||
</Text>
|
|
||||||
{isCurrentUser && (
|
|
||||||
<Text size="xs" c="dimmed">
|
|
||||||
Progress: {display.progressText}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
}
|
|
||||||
multiline
|
|
||||||
w={220}
|
|
||||||
>
|
|
||||||
<Card
|
<Card
|
||||||
withBorder
|
withBorder
|
||||||
padding="sm"
|
padding="sm"
|
||||||
@@ -165,7 +147,23 @@ const BadgeShowcase = ({ playerId }: BadgeShowcaseProps) => {
|
|||||||
{display.badge.name}
|
{display.badge.name}
|
||||||
</Text>
|
</Text>
|
||||||
</Card>
|
</Card>
|
||||||
</Tooltip>
|
</Popover.Target>
|
||||||
|
<Popover.Dropdown>
|
||||||
|
<Box>
|
||||||
|
<Text size="xs" fw={600} mb={4}>
|
||||||
|
{display.badge.name}
|
||||||
|
</Text>
|
||||||
|
<Text size="xs" mb={4}>
|
||||||
|
{display.badge.description}
|
||||||
|
</Text>
|
||||||
|
{isCurrentUser && (
|
||||||
|
<Text size="xs" c="dimmed">
|
||||||
|
Progress: {display.progressText}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Popover.Dropdown>
|
||||||
|
</Popover>
|
||||||
))}
|
))}
|
||||||
</Box>
|
</Box>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user