Skip to content

Commit

Permalink
fix(www): unnecessary portal component removed
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-rohid committed Sep 26, 2023
1 parent 1f16cf4 commit 2983dab
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

0 comments on commit 2983dab

Please sign in to comment.