refactor: go fully native — remove all remaining shadcn component usage
Replace shadcn Select → native <select>: - ascii/FontPreview.tsx: comment-style picker → glass pill wrapper with MessageSquareCode icon + native select - color/ExportMenu.tsx: format + color-space pickers → native select with shared selectCls - units/MainConverter.tsx: from/to unit pickers → native select Delete dead code: - components/media/FormatSelector.tsx (not imported anywhere, used shadcn Input + Label + Card) - components/ui/select.tsx — now unused - components/ui/input.tsx — now unused - components/ui/label.tsx — now unused - components/ui/card.tsx — now unused Remaining components/ui/: slider.tsx, tooltip.tsx (TooltipProvider in Providers.tsx), slider-row.tsx, color-input.tsx Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,13 +2,6 @@
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { ArrowLeftRight, BarChart3, Grid3X3 } from 'lucide-react';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import SearchUnits from './SearchUnits';
|
||||
import VisualComparison from './VisualComparison';
|
||||
import {
|
||||
@@ -207,18 +200,15 @@ export default function MainConverter() {
|
||||
/>
|
||||
|
||||
{/* From unit */}
|
||||
<Select value={selectedUnit} onValueChange={setSelectedUnit}>
|
||||
<SelectTrigger className="w-28 h-9 shrink-0 text-xs border-border/30 bg-transparent hover:border-primary/30 transition-colors font-mono">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{units.map((unit) => (
|
||||
<SelectItem key={unit} value={unit} className="font-mono text-xs">
|
||||
{unit}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<select
|
||||
value={selectedUnit}
|
||||
onChange={(e) => setSelectedUnit(e.target.value)}
|
||||
className="w-28 shrink-0 bg-transparent border border-border/40 rounded-lg px-2.5 py-2 text-xs font-mono outline-none focus:border-primary/50 transition-colors text-foreground/80 cursor-pointer"
|
||||
>
|
||||
{units.map((unit) => (
|
||||
<option key={unit} value={unit}>{unit}</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
{/* Swap */}
|
||||
<button
|
||||
@@ -230,18 +220,15 @@ export default function MainConverter() {
|
||||
</button>
|
||||
|
||||
{/* To unit */}
|
||||
<Select value={targetUnit} onValueChange={setTargetUnit}>
|
||||
<SelectTrigger className="w-28 h-9 shrink-0 text-xs border-border/30 bg-transparent hover:border-primary/30 transition-colors font-mono">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{units.map((unit) => (
|
||||
<SelectItem key={unit} value={unit} className="font-mono text-xs">
|
||||
{unit}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<select
|
||||
value={targetUnit}
|
||||
onChange={(e) => setTargetUnit(e.target.value)}
|
||||
className="w-28 shrink-0 bg-transparent border border-border/40 rounded-lg px-2.5 py-2 text-xs font-mono outline-none focus:border-primary/50 transition-colors text-foreground/80 cursor-pointer"
|
||||
>
|
||||
{units.map((unit) => (
|
||||
<option key={unit} value={unit}>{unit}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Result display */}
|
||||
|
||||
Reference in New Issue
Block a user