Skip to content

Commit

Permalink
fix(alert-dialog): update portal component (#1603)
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-rohid authored Oct 3, 2023
1 parent 1f16cf4 commit 524e4b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 40 deletions.
12 changes: 2 additions & 10 deletions apps/www/registry/default/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const AlertDialog = AlertDialogPrimitive.Root

const AlertDialogTrigger = AlertDialogPrimitive.Trigger

const AlertDialogPortal = ({
className,
...props
}: AlertDialogPrimitive.AlertDialogPortalProps) => (
<AlertDialogPrimitive.Portal className={cn(className)} {...props} />
)
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName

const AlertDialogOverlay = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
Expand All @@ -37,7 +29,7 @@ const AlertDialogContent = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
>(({ className, ...props }, ref) => (
<AlertDialogPortal>
<AlertDialogPrimitive.Portal>
<AlertDialogOverlay />
<AlertDialogPrimitive.Content
ref={ref}
Expand All @@ -47,7 +39,7 @@ const AlertDialogContent = React.forwardRef<
)}
{...props}
/>
</AlertDialogPortal>
</AlertDialogPrimitive.Portal>
))
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName

Expand Down
12 changes: 2 additions & 10 deletions apps/www/registry/default/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const Dialog = DialogPrimitive.Root

const DialogTrigger = DialogPrimitive.Trigger

const DialogPortal = ({
className,
...props
}: DialogPrimitive.DialogPortalProps) => (
<DialogPrimitive.Portal className={cn(className)} {...props} />
)
DialogPortal.displayName = DialogPrimitive.Portal.displayName

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
Expand All @@ -37,7 +29,7 @@ const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DialogPortal>
<DialogPrimitive.Portal>
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
Expand All @@ -53,7 +45,7 @@ const DialogContent = React.forwardRef<
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</DialogPortal>
</DialogPrimitive.Portal>
))
DialogContent.displayName = DialogPrimitive.Content.displayName

Expand Down
12 changes: 2 additions & 10 deletions apps/www/registry/new-york/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const AlertDialog = AlertDialogPrimitive.Root

const AlertDialogTrigger = AlertDialogPrimitive.Trigger

const AlertDialogPortal = ({
className,
...props
}: AlertDialogPrimitive.AlertDialogPortalProps) => (
<AlertDialogPrimitive.Portal className={cn(className)} {...props} />
)
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName

const AlertDialogOverlay = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
Expand All @@ -37,7 +29,7 @@ const AlertDialogContent = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
>(({ className, ...props }, ref) => (
<AlertDialogPortal>
<AlertDialogPrimitive.Portal>
<AlertDialogOverlay />
<AlertDialogPrimitive.Content
ref={ref}
Expand All @@ -47,7 +39,7 @@ const AlertDialogContent = React.forwardRef<
)}
{...props}
/>
</AlertDialogPortal>
</AlertDialogPrimitive.Portal>
))
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName

Expand Down
12 changes: 2 additions & 10 deletions apps/www/registry/new-york/ui/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const Dialog = DialogPrimitive.Root

const DialogTrigger = DialogPrimitive.Trigger

const DialogPortal = ({
className,
...props
}: DialogPrimitive.DialogPortalProps) => (
<DialogPrimitive.Portal className={cn(className)} {...props} />
)
DialogPortal.displayName = DialogPrimitive.Portal.displayName

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
Expand All @@ -37,7 +29,7 @@ const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DialogPortal>
<DialogPrimitive.Portal>
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
Expand All @@ -53,7 +45,7 @@ const DialogContent = React.forwardRef<
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</DialogPortal>
</DialogPrimitive.Portal>
))
DialogContent.displayName = DialogPrimitive.Content.displayName

Expand Down

1 comment on commit 524e4b8

@vercel
Copy link

@vercel vercel bot commented on 524e4b8 Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./apps/www

ui.shadcn.com
ui-shadcn-pro.vercel.app
ui-git-main-shadcn-pro.vercel.app
example-playground.vercel.app

Please sign in to comment.