@@ -14,18 +14,17 @@ import {CardBase} from './CardBase';
1414import { CardViewContext , useCardViewContext } from './CardViewContext' ;
1515import cardViewStyles from './cardview.css' ;
1616import { classNames , useDOMRef , useStyleProps , useUnwrapDOMRef } from '@react-spectrum/utils' ;
17- import { DOMRef , DOMRefValue , Node } from '@react-types/shared' ;
17+ import { DOMRef , DOMRefValue } from '@react-types/shared' ;
1818import { GridCollection , useGridState } from '@react-stately/grid' ;
1919// @ts -ignore
2020import intlMessages from '../intl/*.json' ;
2121import { ProgressCircle } from '@react-spectrum/progress' ;
2222import React , { ReactElement , useMemo , useRef } from 'react' ;
23- import { ReusableView } from '@react-stately/virtualizer' ;
2423import { SpectrumCardViewProps } from '@react-types/cards' ;
2524import { useCollator , useLocale , useMessageFormatter } from '@react-aria/i18n' ;
2625import { useGrid , useGridCell , useGridRow } from '@react-aria/grid' ;
2726import { useListState } from '@react-stately/list' ;
28- import { Virtualizer , VirtualizerItem } from '@react-aria/virtualizer' ;
27+ import { Virtualizer } from '@react-aria/virtualizer' ;
2928
3029function CardView < T extends object > ( props : SpectrumCardViewProps < T > , ref : DOMRef < HTMLDivElement > ) {
3130 let { styleProps} = useStyleProps ( props ) ;
@@ -80,15 +79,6 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
8079 keyboardDelegate : cardViewLayout
8180 } , state , domRef ) ;
8281
83- type View = ReusableView < Node < T > , unknown > ;
84- let renderWrapper = ( parent : View , reusableView : View ) => (
85- < VirtualizerItem
86- className = { classNames ( cardViewStyles , 'react-spectrum-CardView-CardWrapper' ) }
87- key = { reusableView . key }
88- reusableView = { reusableView }
89- parent = { parent } />
90- ) ;
91-
9282 // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
9383 return (
9484 < CardViewContext . Provider value = { { state, isQuiet, layout : cardViewLayout } } >
@@ -101,8 +91,7 @@ function CardView<T extends object>(props: SpectrumCardViewProps<T>, ref: DOMRef
10191 layout = { cardViewLayout }
10292 collection = { collection }
10393 isLoading = { isLoading }
104- onLoadMore = { onLoadMore }
105- renderWrapper = { renderWrapper } >
94+ onLoadMore = { onLoadMore } >
10695 { ( type , item ) => {
10796 if ( type === 'item' ) {
10897 return (
@@ -171,13 +160,22 @@ function InternalCard(props) {
171160 focusMode : 'cell'
172161 } , state , unwrappedRef ) ;
173162
174-
163+ let rowStyles ;
175164 if ( layoutType === 'grid' || layoutType === 'gallery' ) {
176165 isQuiet = true ;
166+ rowStyles = {
167+ height : 'calc(100% - 12px)' ,
168+ width : 'calc(100% - 12px)' ,
169+ transform : 'translate(6px, 6px)'
170+ }
171+ } else {
172+ rowStyles = {
173+ height : '100%'
174+ }
177175 }
178176
179177 return (
180- < div { ...rowProps } ref = { rowRef } style = { { height : '100%' } } >
178+ < div { ...rowProps } ref = { rowRef } style = { rowStyles } >
181179 < CardBase
182180 ref = { cellRef }
183181 articleProps = { gridCellProps }
0 commit comments