Skip to content

Commit

Permalink
fix(EditProfile): use switch instead of checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Sep 27, 2024
1 parent 33ab545 commit 9db1d7d
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client"

import { Button } from "@/components/ui/Button"
import { Checkbox } from "@/components/ui/Checkbox"
import {
Dialog,
DialogBody,
Expand All @@ -21,6 +20,8 @@ import {
FormLabel,
} from "@/components/ui/Form"
import { Input } from "@/components/ui/Input"
import { Separator } from "@/components/ui/Separator"
import { Switch } from "@/components/ui/Switch"
import { Textarea } from "@/components/ui/Textarea"
import { useDisclosure } from "@/hooks/useDisclosure"
import { filterOnDirtyFormFields } from "@/lib/filterOnDirtyFormFields"
Expand Down Expand Up @@ -138,18 +139,20 @@ export const EditProfile = ({ children }: PropsWithChildren<any>) => {
</FormItem>
)}
/>

<Separator className="mt-4 mb-6 bg-border-muted" />

<FormField
control={form.control}
name="showActivityLog"
render={({ field }) => (
render={({ field: { value, onChange, ...field } }) => (
<FormItem>
<div className="flex items-center gap-2">
<FormControl>
<Checkbox
<Switch
{...field}
value={undefined}
onCheckedChange={field.onChange}
checked={!!field.value}
checked={!!value}
onCheckedChange={onChange}
/>
</FormControl>
<FormLabel className="mb-0">Show recent activities</FormLabel>
Expand Down

0 comments on commit 9db1d7d

Please sign in to comment.