mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-11 16:07:15 +02:00
- Add useIsMobile hook for viewport detection - TabBar: larger height (48px), disable reorder on mobile, hide workspace numbers - Header buttons: larger touch targets for SpellbookDropdown, UserMenu, LayoutControls - Window toolbar: larger buttons (40px) on mobile - Mosaic dividers: wider (12px) on mobile for easier dragging - CommandLauncher: larger items, footer text, hide kbd hints on mobile - Editor suggestions: responsive widths, min-height 44px touch targets - EventFooter: larger kind/relay buttons on mobile - CodeCopyButton: larger padding and icon on mobile - MembersDropdown: larger trigger and list items on mobile All changes use mobile-first Tailwind (base styles for mobile, md: for desktop) to meet Apple HIG 44px minimum touch target recommendation. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
849 B
TypeScript
34 lines
849 B
TypeScript
import { Copy, CopyCheck } from "lucide-react";
|
|
|
|
interface CodeCopyButtonProps {
|
|
onCopy: () => void;
|
|
copied: boolean;
|
|
label?: string;
|
|
className?: string;
|
|
}
|
|
|
|
/**
|
|
* Reusable copy button for code blocks with consistent styling
|
|
* Designed to be absolutely positioned over code containers
|
|
*/
|
|
export function CodeCopyButton({
|
|
onCopy,
|
|
copied,
|
|
label = "Copy code",
|
|
className = "",
|
|
}: CodeCopyButtonProps) {
|
|
return (
|
|
<button
|
|
onClick={onCopy}
|
|
className={`absolute top-2 right-2 p-3 md:p-2 bg-background/90 hover:bg-muted border border-border rounded transition-colors ${className}`.trim()}
|
|
aria-label={label}
|
|
>
|
|
{copied ? (
|
|
<CopyCheck className="size-5 md:size-4 text-muted-foreground" />
|
|
) : (
|
|
<Copy className="size-5 md:size-4 text-muted-foreground" />
|
|
)}
|
|
</button>
|
|
);
|
|
}
|