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 { useState } from 'react'
2- import { DesktopBreakpoint } from 'src/providers/DesktopBreakpoint'
3- import { MobileBreakpoint } from 'src/providers/MobileBreakpoint'
41import { useUserPreferences } from 'src/stores/preferences'
52import { lazyImport } from 'src/utils/lazyImport'
6- import { BottomNavigation } from '../Elements'
7- import { DesktopCards } from './DesktopCards'
8- import { MobileCards } from './MobileCards'
9- import { ScrollCardsNavigator } from './ScrollCardsNavigator'
103const { Feed } = lazyImport ( ( ) => import ( 'src/features/feed' ) , 'Feed' )
4+ const { CardsLayout } = lazyImport ( ( ) => import ( './CardsLayout' ) , 'CardsLayout' )
115
126export const AppContentLayout = ( ) => {
13- const { cards, userCustomCards, layout } = useUserPreferences ( )
14- const [ selectedCard , setSelectedCard ] = useState ( cards [ 0 ] )
15-
7+ const { layout } = useUserPreferences ( )
168 return (
179 < >
18- < main className = "AppContent" >
19- { layout === 'grid' ? (
20- < Feed />
21- ) : (
22- < >
23- < ScrollCardsNavigator />
24- < DesktopBreakpoint >
25- < DesktopCards cards = { cards } userCustomCards = { userCustomCards } />
26- </ DesktopBreakpoint >
27- < MobileBreakpoint >
28- < div className = "Cards HorizontalScroll" >
29- < MobileCards selectedCard = { selectedCard } />
30- </ div >
31- </ MobileBreakpoint >
32- < BottomNavigation selectedCard = { selectedCard } setSelectedCard = { setSelectedCard } />
33- </ >
34- ) }
35- </ main >
10+ < main className = "AppContent" > { layout === 'grid' ? < Feed /> : < CardsLayout /> } </ main >
3611 </ >
3712 )
3813}
Original file line number Diff line number Diff line change 1+ import { useState } from 'react'
2+ import { DesktopBreakpoint } from 'src/providers/DesktopBreakpoint'
3+ import { MobileBreakpoint } from 'src/providers/MobileBreakpoint'
4+ import { useUserPreferences } from 'src/stores/preferences'
5+ import { BottomNavigation } from '../Elements'
6+ import { DesktopCards } from './DesktopCards'
7+ import { MobileCards } from './MobileCards'
8+ import { ScrollCardsNavigator } from './ScrollCardsNavigator'
9+
10+ export const CardsLayout = ( ) => {
11+ const { cards, userCustomCards } = useUserPreferences ( )
12+ const [ selectedCard , setSelectedCard ] = useState ( cards [ 0 ] )
13+ return (
14+ < >
15+ < ScrollCardsNavigator />
16+ < DesktopBreakpoint >
17+ < DesktopCards cards = { cards } userCustomCards = { userCustomCards } />
18+ </ DesktopBreakpoint >
19+ < MobileBreakpoint >
20+ < div className = "Cards HorizontalScroll" >
21+ < MobileCards selectedCard = { selectedCard } />
22+ </ div >
23+ </ MobileBreakpoint >
24+ < BottomNavigation selectedCard = { selectedCard } setSelectedCard = { setSelectedCard } />
25+ </ >
26+ )
27+ }
You can’t perform that action at this time.
0 commit comments