Home / Function/ DrawerDialogDemo() — supabase Function Reference

DrawerDialogDemo() — supabase Function Reference

Architecture documentation for the DrawerDialogDemo() function in drawer-dialog.tsx from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  d864818b_3776_8c4d_afbb_fb10ea92df02["DrawerDialogDemo()"]
  d133c3f6_9264_7249_a300_af67c18d2296["useMediaQuery()"]
  d864818b_3776_8c4d_afbb_fb10ea92df02 -->|calls| d133c3f6_9264_7249_a300_af67c18d2296
  style d864818b_3776_8c4d_afbb_fb10ea92df02 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/design-system/registry/default/example/drawer-dialog.tsx lines 27–71

export default function DrawerDialogDemo() {
  const [open, setOpen] = React.useState(false)
  const isDesktop = useMediaQuery('(min-width: 768px)')

  if (isDesktop) {
    return (
      <Dialog open={open} onOpenChange={setOpen}>
        <DialogTrigger asChild>
          <Button type="outline">Edit profile</Button>
        </DialogTrigger>
        <DialogContent className="sm:max-w-[425px]">
          <DialogHeader>
            <DialogTitle>Edit profile</DialogTitle>
            <DialogDescription>
              Make changes to your profile here. Click save when you are done.
            </DialogDescription>
          </DialogHeader>
          <ProfileForm />
        </DialogContent>
      </Dialog>
    )
  }

  return (
    <Drawer open={open} onOpenChange={setOpen}>
      <DrawerTrigger asChild>
        <Button type="outline">Edit profile</Button>
      </DrawerTrigger>
      <DrawerContent>
        <DrawerHeader className="text-left">
          <DrawerTitle>Edit profile</DrawerTitle>
          <DrawerDescription>
            Make changes to your profile here. Click save when you are done.
          </DrawerDescription>
        </DrawerHeader>
        <ProfileForm className="px-4" />
        <DrawerFooter className="pt-2">
          <DrawerClose asChild>
            <Button type="outline">Cancel</Button>
          </DrawerClose>
        </DrawerFooter>
      </DrawerContent>
    </Drawer>
  )
}

Domain

Subdomains

Frequently Asked Questions

What does DrawerDialogDemo() do?
DrawerDialogDemo() is a function in the supabase codebase.
What does DrawerDialogDemo() call?
DrawerDialogDemo() calls 1 function(s): useMediaQuery.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free