Skip to content

Commit b5c958b

Browse files
committed
refactor(ui): simplify layout structure in ResponsiveDesignTester component
1 parent d5f8b2f commit b5c958b

File tree

1 file changed

+63
-65
lines changed

1 file changed

+63
-65
lines changed

app/page.tsx

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -734,77 +734,75 @@ export default function ResponsiveDesignTester() {
734734

735735
{focusedDevice && focusedDeviceObject && (
736736
<div className="mb-6">
737-
<Card className="border-border bg-card">
738-
<div className="p-2 sm:p-4">
739-
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4">
740-
<div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">
741-
<Badge variant="default">
742-
Focused: {focusedDeviceObject.name}
743-
</Badge>
744-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
745-
<span>
746-
{isLandscape
747-
? focusedDeviceObject.height
748-
: focusedDeviceObject.width}{' '}
749-
×{' '}
750-
{isLandscape
751-
? focusedDeviceObject.width
752-
: focusedDeviceObject.height}
753-
</span>
754-
</div>
737+
<div className="p-2 sm:p-4">
738+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4">
739+
<div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">
740+
<Badge variant="default">
741+
Focused: {focusedDeviceObject.name}
742+
</Badge>
743+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
744+
<span>
745+
{isLandscape
746+
? focusedDeviceObject.height
747+
: focusedDeviceObject.width}{' '}
748+
×{' '}
749+
{isLandscape
750+
? focusedDeviceObject.width
751+
: focusedDeviceObject.height}
752+
</span>
755753
</div>
754+
</div>
756755

757-
<div className="flex items-center gap-2 ">
758-
<div className="flex items-center gap-1 bg-muted rounded-lg w-fit">
759-
<Button
760-
variant="ghost"
761-
size="icon"
762-
onClick={zoomOut}
763-
disabled={focusZoom <= 0.5}
764-
>
765-
<ZoomOut />
766-
</Button>
767-
<Input
768-
type="number"
769-
min="10"
770-
max="500"
771-
value={customZoomInput || Math.round(focusZoom * 100)}
772-
onChange={(e) => handleCustomZoom(e.target.value)}
773-
onFocus={syncZoomInput}
774-
onBlur={() => setCustomZoomInput('')}
775-
className="h-8 w-14 sm:w-16 px-1 sm:px-2 text-xs font-mono text-center border-0 bg-transparent"
776-
placeholder={Math.round(focusZoom * 100).toString()}
777-
/>
778-
<span className="text-xs text-muted-foreground">%</span>
779-
<Button
780-
variant="ghost"
781-
size="sm"
782-
onClick={zoomIn}
783-
disabled={focusZoom >= 3}
784-
>
785-
<ZoomIn />
786-
</Button>
787-
</div>
756+
<div className="flex items-center gap-2 ">
757+
<div className="flex items-center gap-1 bg-muted rounded-lg w-fit">
758+
<Button
759+
variant="ghost"
760+
size="icon"
761+
onClick={zoomOut}
762+
disabled={focusZoom <= 0.5}
763+
>
764+
<ZoomOut />
765+
</Button>
766+
<Input
767+
type="number"
768+
min="10"
769+
max="500"
770+
value={customZoomInput || Math.round(focusZoom * 100)}
771+
onChange={(e) => handleCustomZoom(e.target.value)}
772+
onFocus={syncZoomInput}
773+
onBlur={() => setCustomZoomInput('')}
774+
className="h-8 w-14 sm:w-16 px-1 sm:px-2 text-xs font-mono text-center border-0 bg-transparent"
775+
placeholder={Math.round(focusZoom * 100).toString()}
776+
/>
777+
<span className="text-xs text-muted-foreground">%</span>
778+
<Button
779+
variant="ghost"
780+
size="sm"
781+
onClick={zoomIn}
782+
disabled={focusZoom >= 3}
783+
>
784+
<ZoomIn />
785+
</Button>
786+
</div>
788787

789-
<div className="flex gap-1 ml-auto">
790-
<Button
791-
variant="outline"
792-
size="sm"
793-
onClick={toggleOrientation}
794-
>
795-
<RotateCw />
796-
Rotate
797-
</Button>
798-
799-
<Button variant="outline" size="sm" onClick={exitFocus}>
800-
<X />
801-
Exit
802-
</Button>
803-
</div>
788+
<div className="flex gap-1 ml-auto">
789+
<Button
790+
variant="outline"
791+
size="sm"
792+
onClick={toggleOrientation}
793+
>
794+
<RotateCw />
795+
Rotate
796+
</Button>
797+
798+
<Button variant="outline" size="sm" onClick={exitFocus}>
799+
<X />
800+
Exit
801+
</Button>
804802
</div>
805803
</div>
806804
</div>
807-
</Card>
805+
</div>
808806
</div>
809807
)}
810808

0 commit comments

Comments
 (0)