feat: aspect-ratio instead of width measurer
This commit is contained in:
1 parent
375ebf93d9
commit
279a61ddcd
15 files changed
+168
-313
No files matched your search
@@ -1,7 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
||||
|
||||
const AspectRatio = AspectRatioPrimitive.Root;
|
||||
|
||||
export { AspectRatio };
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CSSProperties, useState } from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
|
||||
import useScrollDelta from '@/hooks/useScrollDelta';
|
||||
@@ -157,9 +157,10 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
||||
const Modal: React.FC<{
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
style?: CSSProperties;
|
||||
onClose: () => void;
|
||||
scrollRef?: React.MutableRefObject<HTMLDivElement>;
|
||||
}> = ({ children, onClose, className, scrollRef }) => {
|
||||
}> = ({ children, onClose, className, style, scrollRef }) => {
|
||||
const [open, setOpen] = useState(true);
|
||||
|
||||
const handleClose = () => {
|
||||
@@ -172,7 +173,7 @@ const Modal: React.FC<{
|
||||
<DialogHeader>
|
||||
<DialogTitle />
|
||||
</DialogHeader>
|
||||
<DialogContent scrollRef={scrollRef} forceMount onClose={handleClose} className={className}>
|
||||
<DialogContent style={style} scrollRef={scrollRef} forceMount onClose={handleClose} className={className}>
|
||||
{children}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
Reference in new issue
Block a user