fix: non responsiveness of Add your sign modal

This commit is contained in:
Sachin
2023-10-05 00:09:30 +05:30
committed by Mythie
parent e556db0386
commit bdf31625a2
2 changed files with 6 additions and 3 deletions

View File

@ -377,7 +377,7 @@ export const Widget = ({ className, children, ...props }: WidgetProps) => {
</Card> </Card>
<Dialog open={showSigningDialog} onOpenChange={setShowSigningDialog}> <Dialog open={showSigningDialog} onOpenChange={setShowSigningDialog}>
<DialogContent> <DialogContent position="center">
<DialogHeader> <DialogHeader>
<DialogTitle>Add your signature</DialogTitle> <DialogTitle>Add your signature</DialogTitle>
</DialogHeader> </DialogHeader>

View File

@ -16,12 +16,13 @@ const DialogPortal = ({
children, children,
position = 'start', position = 'start',
...props ...props
}: DialogPrimitive.DialogPortalProps & { position?: 'start' | 'end' }) => ( }: DialogPrimitive.DialogPortalProps & { position?: 'start' | 'end' | 'center' }) => (
<DialogPrimitive.Portal className={cn(className)} {...props}> <DialogPrimitive.Portal className={cn(className)} {...props}>
<div <div
className={cn('fixed inset-0 z-50 flex justify-center sm:items-center', { className={cn('fixed inset-0 z-50 flex justify-center sm:items-center', {
'items-start': position === 'start', 'items-start': position === 'start',
'items-end': position === 'end', 'items-end': position === 'end',
'items-center': position === 'center',
})} })}
> >
{children} {children}
@ -49,7 +50,9 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
const DialogContent = React.forwardRef< const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>, React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { position?: 'start' | 'end' } React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
position?: 'start' | 'end' | 'center';
}
>(({ className, children, position = 'start', ...props }, ref) => ( >(({ className, children, position = 'start', ...props }, ref) => (
<DialogPortal position={position}> <DialogPortal position={position}>
<DialogOverlay /> <DialogOverlay />