@@ -36,7 +36,7 @@ type DocumentsCardProps = {
3636 teamInfo : TeamContextType | null ;
3737} ;
3838export default function DataroomDocumentCard ( {
39- document,
39+ document : dataroomDocument ,
4040 teamInfo,
4141} : DocumentsCardProps ) {
4242 const { theme, systemTheme } = useTheme ( ) ;
@@ -49,16 +49,25 @@ export default function DataroomDocumentCard({
4949 const [ moveFolderOpen , setMoveFolderOpen ] = useState < boolean > ( false ) ;
5050 const dropdownRef = useRef < HTMLDivElement | null > ( null ) ;
5151
52+ // https://github.com/radix-ui/primitives/issues/1241#issuecomment-1888232392
53+ useEffect ( ( ) => {
54+ if ( ! moveFolderOpen ) {
55+ setTimeout ( ( ) => {
56+ document . body . style . pointerEvents = "" ;
57+ } ) ;
58+ }
59+ } , [ moveFolderOpen ] ) ;
60+
5261 return (
5362 < >
5463 < li className = "group/row relative flex items-center justify-between rounded-lg border-0 p-3 ring-1 ring-gray-200 transition-all hover:bg-secondary hover:ring-gray-300 dark:bg-secondary dark:ring-gray-700 hover:dark:ring-gray-500 sm:p-4" >
5564 < div className = "flex min-w-0 shrink items-center space-x-2 sm:space-x-4" >
5665 < div className = "mx-0.5 flex w-8 items-center justify-center text-center sm:mx-1" >
57- { document . document . type === "notion" ? (
66+ { dataroomDocument . document . type === "notion" ? (
5867 < NotionIcon className = "h-8 w-8" />
5968 ) : (
6069 < Image
61- src = { `/_icons/${ document . document . type } ${ isLight ? "-light" : "" } .svg` }
70+ src = { `/_icons/${ dataroomDocument . document . type } ${ isLight ? "-light" : "" } .svg` }
6271 alt = "File icon"
6372 width = { 50 }
6473 height = { 50 }
@@ -70,20 +79,20 @@ export default function DataroomDocumentCard({
7079 < div className = "flex items-center" >
7180 < h2 className = "min-w-0 max-w-[150px] truncate text-sm font-semibold leading-6 text-foreground sm:max-w-md" >
7281 < Link
73- href = { `/documents/${ document . document . id } ` }
82+ href = { `/documents/${ dataroomDocument . document . id } ` }
7483 className = "w-full truncate"
7584 >
76- < span > { document . document . name } </ span >
85+ < span > { dataroomDocument . document . name } </ span >
7786 < span className = "absolute inset-0" />
7887 </ Link >
7988 </ h2 >
8089 </ div >
8190 < div className = "mt-1 flex items-center space-x-1 text-xs leading-5 text-muted-foreground" >
82- < p className = "truncate" > { timeAgo ( document . createdAt ) } </ p >
83- { document . document . _count . versions > 1 ? (
91+ < p className = "truncate" > { timeAgo ( dataroomDocument . createdAt ) } </ p >
92+ { dataroomDocument . document . _count . versions > 1 ? (
8493 < >
8594 < p > •</ p >
86- < p className = "truncate" > { `${ document . document . _count . versions } Versions` } </ p >
95+ < p className = "truncate" > { `${ dataroomDocument . document . _count . versions } Versions` } </ p >
8796 </ >
8897 ) : null }
8998 </ div >
@@ -95,12 +104,12 @@ export default function DataroomDocumentCard({
95104 onClick = { ( e ) => {
96105 e . stopPropagation ( ) ;
97106 } }
98- href = { `/documents/${ document . document . id } ` }
107+ href = { `/documents/${ dataroomDocument . document . id } ` }
99108 className = "z-10 flex items-center space-x-1 rounded-md bg-gray-200 px-1.5 py-0.5 transition-all duration-75 hover:scale-105 active:scale-100 dark:bg-gray-700 sm:px-2"
100109 >
101110 < BarChart className = "h-3 w-3 text-muted-foreground sm:h-4 sm:w-4" />
102111 < p className = "whitespace-nowrap text-xs text-muted-foreground sm:text-sm" >
103- { nFormatter ( document . document . _count . views ) }
112+ { nFormatter ( dataroomDocument . document . _count . views ) }
104113 < span className = "ml-1 hidden sm:inline-block" > views</ span >
105114 </ p >
106115 </ Link >
@@ -144,9 +153,9 @@ export default function DataroomDocumentCard({
144153 < MoveToDataroomFolderModal
145154 open = { moveFolderOpen }
146155 setOpen = { setMoveFolderOpen }
147- dataroomId = { document . dataroomId }
148- documentId = { document . id }
149- documentName = { document . document . name }
156+ dataroomId = { dataroomDocument . dataroomId }
157+ documentId = { dataroomDocument . id }
158+ documentName = { dataroomDocument . document . name }
150159 />
151160 ) : null }
152161 </ >
0 commit comments