Skip to content

Commit

Permalink
fix: Build error
Browse files Browse the repository at this point in the history
  • Loading branch information
munshkr committed Nov 29, 2024
1 parent 6a10b2e commit bcc4edb
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions packages/web/src/components/display-settings-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { DialogProps } from "@radix-ui/react-dialog";
import { useState, FormEvent } from "react";
import {
DisplaySettings,
sanitizeDisplaySettings,
} from "@/lib/display-settings";
import { DialogProps } from "@radix-ui/react-dialog";
import { FormEvent, useState } from "react";

interface DisplaySettingsDialogProps extends DialogProps {
settings: DisplaySettings,
settings: DisplaySettings;
onAccept: (settings: DisplaySettings) => void;
}

Expand All @@ -26,8 +25,7 @@ export default function DisplaySettingsDialog({
onAccept,
...props
}: DisplaySettingsDialogProps) {

const [unsavedSettings, setUnsavedSettings] = useState({...settings});
const [unsavedSettings, setUnsavedSettings] = useState({ ...settings });
const sanitizeAndSetUnsavedSettings = (settings: DisplaySettings) =>
setUnsavedSettings(sanitizeDisplaySettings(settings));

Expand All @@ -54,10 +52,12 @@ export default function DisplaySettingsDialog({
type="number"
value={unsavedSettings.canvasPixelSize}
className="col-span-3"
onChange={(e) => sanitizeAndSetUnsavedSettings({
...unsavedSettings,
canvasPixelSize: parseInt(e.target.value, 10),
})}
onChange={(e) =>
sanitizeAndSetUnsavedSettings({
...unsavedSettings,
canvasPixelSize: parseInt(e.target.value, 10),
})
}
/>
</div>
<div className="grid grid-cols-4 items-center gap-4">
Expand All @@ -69,10 +69,12 @@ export default function DisplaySettingsDialog({
type="checkbox"
checked={unsavedSettings.showCanvas}
className="w-5"
onChange={(e) => sanitizeAndSetUnsavedSettings({
...unsavedSettings,
showCanvas: e.target.checked,
})}
onChange={(e) =>
sanitizeAndSetUnsavedSettings({
...unsavedSettings,
showCanvas: e.target.checked,
})
}
/>
</div>
</div>
Expand Down

0 comments on commit bcc4edb

Please sign in to comment.