From 6a8fe074e0664fd69c61148687d09666dc612359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 26 Nov 2023 18:37:05 +0100 Subject: [PATCH] Removed Scrollview from ScaffoldMobile and now each view implement its scroll --- front/components/UI/ScaffoldCC.tsx | 4 +- front/components/UI/ScaffoldMobileCC.tsx | 31 +++---- front/components/V2/GoldenRatio.tsx | 2 +- front/views/V2/DiscoveryView.tsx | 111 +++++++++++------------ 4 files changed, 71 insertions(+), 77 deletions(-) diff --git a/front/components/UI/ScaffoldCC.tsx b/front/components/UI/ScaffoldCC.tsx index 69f560f..1b9a103 100644 --- a/front/components/UI/ScaffoldCC.tsx +++ b/front/components/UI/ScaffoldCC.tsx @@ -21,9 +21,10 @@ type ScaffoldCCProps = { children?: React.ReactNode; routeName: string; withPadding?: boolean; + enableScroll?: boolean; }; -const ScaffoldCC = ({ children, routeName, withPadding = true }: ScaffoldCCProps) => { +const ScaffoldCC = ({ children, routeName, withPadding = true, enableScroll = true }: ScaffoldCCProps) => { const userQuery = useQuery(API.getUserInfo); const screenSize = useBreakpointValue({ base: 'small', md: 'big' }); @@ -40,6 +41,7 @@ const ScaffoldCC = ({ children, routeName, withPadding = true }: ScaffoldCCProps {screenSize === 'small' ? ( { return ( - - {props.children} - - + {props.children} + { icon={value.icon} title={ props.routeName === value.link && !isSmallScreen - ? translate( - value.title as - | 'menuDiscovery' - | 'menuProfile' - | 'menuMusic' - | 'menuSearch' - | 'menuLeaderBoard' - | 'menuSettings' - ) + ? translate(value.title) : undefined } isDisabled={props.routeName === value.link} diff --git a/front/components/V2/GoldenRatio.tsx b/front/components/V2/GoldenRatio.tsx index f515307..bedbc41 100644 --- a/front/components/V2/GoldenRatio.tsx +++ b/front/components/V2/GoldenRatio.tsx @@ -60,7 +60,7 @@ const GoldenRatio = () => { direction={isPhone ? 'row-reverse' : 'column-reverse'} header={} > - + diff --git a/front/views/V2/DiscoveryView.tsx b/front/views/V2/DiscoveryView.tsx index 4bde174..bec0985 100644 --- a/front/views/V2/DiscoveryView.tsx +++ b/front/views/V2/DiscoveryView.tsx @@ -38,78 +38,75 @@ const HomeView = (props: RouteProps<{}>) => { // }, [artistsQueries]); return ( - // - - - - - + + - - {'Suggestions'} - - {songsQuery.isLoading && Loading...} + + + - {songsQuery.data?.map((song) => ( - { - navigation.navigate('Play', { songId: song.id }); - }} - onPlay={() => { - console.log('play'); - }} - /> - ))} + + {'Suggestions'} + + {songsQuery.isLoading && Loading...} + + {songsQuery.data?.map((song) => ( + { + navigation.navigate('Play', { songId: song.id }); + }} + onPlay={() => { + console.log('play'); + }} + /> + ))} + - - - // + + ); };