File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { useLayoutEffect , useRef } from 'react'
1+ import { useEffect , useRef } from 'react'
22import SortableList , { SortableItem } from 'react-easy-sort'
33import { SUPPORTED_CARDS } from 'src/config/supportedCards'
44import { CustomRssCard } from 'src/features/cards'
@@ -27,7 +27,7 @@ export const DesktopCards = ({
2727 }
2828 }
2929
30- useLayoutEffect ( ( ) => {
30+ useEffect ( ( ) => {
3131 scrollHolderRef . current = document . querySelector ( '.Cards' )
3232 } , [ ] )
3333
@@ -36,10 +36,9 @@ export const DesktopCards = ({
3636 as = "div"
3737 onSortEnd = { onSortEnd }
3838 lockAxis = "x"
39- customHolderRef = { scrollHolderRef }
4039 className = "Cards HorizontalScroll"
4140 draggedItemClassName = "draggedBlock" >
42- { cards
41+ { [ ... cards ]
4342 . sort ( ( a , b ) => a . id - b . id )
4443 . map ( ( card , index ) => {
4544 const constantCard = AVAILABLE_CARDS . find ( ( c ) => c . value === card . name )
@@ -52,11 +51,7 @@ export const DesktopCards = ({
5251 return (
5352 < SortableItem key = { card . name } >
5453 < div >
55- < Component
56- key = { card . name }
57- meta = { constantCard }
58- withAds = { index === adsConfig . columnPosition }
59- />
54+ < Component meta = { constantCard } withAds = { index === adsConfig . columnPosition } />
6055 </ div >
6156 </ SortableItem >
6257 )
You can’t perform that action at this time.
0 commit comments