refactor: centralize action/icon button styles across all tools
Extract shared actionBtn and iconBtn constants into lib/utils/styles.ts and replace all 11 local definitions across tool components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { generateFaviconSet } from '@/lib/favicon/faviconService';
|
||||
import { downloadBlobsAsZip } from '@/lib/media/utils/fileUtils';
|
||||
import type { FaviconSet, FaviconOptions } from '@/types/favicon';
|
||||
import { toast } from 'sonner';
|
||||
import { cn } from '@/lib/utils/cn';
|
||||
import { cn, actionBtn } from '@/lib/utils';
|
||||
import { MobileTabs } from '@/components/ui/mobile-tabs';
|
||||
|
||||
type Tab = 'icons' | 'html' | 'manifest';
|
||||
@@ -21,8 +21,6 @@ const TABS: { value: Tab; label: string; icon: React.ReactNode }[] = [
|
||||
{ value: 'manifest', label: 'Manifest', icon: <Globe className="w-3 h-3" /> },
|
||||
];
|
||||
|
||||
const actionBtn =
|
||||
'flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs glass rounded-md border border-border/30 text-muted-foreground hover:text-primary hover:border-primary/30 hover:bg-primary/10 transition-all disabled:opacity-40 disabled:cursor-not-allowed';
|
||||
|
||||
const inputCls =
|
||||
'w-full bg-transparent border border-border/40 rounded-lg px-3 py-2 text-xs font-mono outline-none focus:border-primary/50 transition-colors text-foreground/80 placeholder:text-muted-foreground/30';
|
||||
@@ -160,7 +158,7 @@ export function FaviconGenerator() {
|
||||
<button
|
||||
onClick={handleGenerate}
|
||||
disabled={!sourceFile || isGenerating}
|
||||
className={cn(actionBtn, 'flex-1 py-2.5')}
|
||||
className={cn(actionBtn, 'flex-1 justify-center')}
|
||||
>
|
||||
{isGenerating
|
||||
? <><Loader2 className="w-3 h-3 animate-spin" /> Generating… {progress}%</>
|
||||
|
||||
Reference in New Issue
Block a user