refactor: simplify DutyTimelineCard component by removing TooltipProvider and Tooltip
- Removed TooltipProvider and Tooltip components from DutyTimelineCard, streamlining the button interaction for displaying contact information. - Updated the button implementation to directly handle the click event, enhancing code clarity and reducing complexity.
This commit is contained in:
@@ -15,12 +15,6 @@ import {
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ContactLinks } from "@/components/contact/ContactLinks";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
TooltipProvider,
|
||||
} from "@/components/ui/tooltip";
|
||||
import type { DutyWithUser } from "@/types";
|
||||
import { Phone, ArrowLeft } from "lucide-react";
|
||||
|
||||
@@ -120,29 +114,20 @@ export function DutyTimelineCard({ duty, isCurrent }: DutyTimelineCardProps) {
|
||||
{duty.full_name}
|
||||
</span>
|
||||
<span className="text-[0.8rem] text-muted row-start-3">{timeStr}</span>
|
||||
<TooltipProvider delayDuration={300}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
ref={frontBtnRef}
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 size-9 rounded-full bg-surface text-accent hover:bg-accent/20"
|
||||
aria-label={t("contact.show")}
|
||||
onClick={() => {
|
||||
setFlipped(true);
|
||||
setTimeout(() => backBtnRef.current?.focus(), 310);
|
||||
}}
|
||||
>
|
||||
<Phone className="size-[18px]" aria-hidden />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="left" sideOffset={8}>
|
||||
{t("contact.show")}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<Button
|
||||
ref={frontBtnRef}
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 size-9 rounded-full bg-surface text-accent hover:bg-accent/20"
|
||||
aria-label={t("contact.show")}
|
||||
onClick={() => {
|
||||
setFlipped(true);
|
||||
setTimeout(() => backBtnRef.current?.focus(), 310);
|
||||
}}
|
||||
>
|
||||
<Phone className="size-[18px]" aria-hidden />
|
||||
</Button>
|
||||
</div>
|
||||
{/* Back */}
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user