From 95da2cc500ec5a65ce449c436c2034ac9a1ded00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Tue, 28 Nov 2023 18:01:54 +0100 Subject: [PATCH] lint fix --- front/Navigation.tsx | 6 ++- front/components/UI/InteractiveBase.tsx | 3 +- front/components/UI/ScaffoldCC.tsx | 7 ++- front/components/V2/GoldenRatio.tsx | 3 +- front/views/PlayView.tsx | 59 ++++++++++++------------- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 0e9ab1b..ebba152 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -55,7 +55,11 @@ const protectedRoutes = () => options: { headerShown: false }, link: '/V2', }, - Play: { component: PlayView, options: { headerShown: false, title: translate("play") }, link: '/play/:songId' }, + Play: { + component: PlayView, + options: { headerShown: false, title: translate('play') }, + link: '/play/:songId', + }, Settings: { component: SettingsTab, options: { headerShown: false }, diff --git a/front/components/UI/InteractiveBase.tsx b/front/components/UI/InteractiveBase.tsx index 5a14ab1..fb2370f 100644 --- a/front/components/UI/InteractiveBase.tsx +++ b/front/components/UI/InteractiveBase.tsx @@ -1,6 +1,6 @@ import { Pressable, useTheme } from 'native-base'; import React, { useRef } from 'react'; -import { Animated, StyleSheet, StyleProp, ViewStyle } from 'react-native'; +import { Animated, StyleProp, ViewStyle } from 'react-native'; interface InteractiveBaseProps { children?: React.ReactNode; @@ -254,5 +254,4 @@ const InteractiveBase: React.FC = ({ ); }; - export default InteractiveBase; diff --git a/front/components/UI/ScaffoldCC.tsx b/front/components/UI/ScaffoldCC.tsx index 1b9a103..c761200 100644 --- a/front/components/UI/ScaffoldCC.tsx +++ b/front/components/UI/ScaffoldCC.tsx @@ -24,7 +24,12 @@ type ScaffoldCCProps = { enableScroll?: boolean; }; -const ScaffoldCC = ({ children, routeName, withPadding = true, enableScroll = true }: ScaffoldCCProps) => { +const ScaffoldCC = ({ + children, + routeName, + withPadding = true, + enableScroll = true, +}: ScaffoldCCProps) => { const userQuery = useQuery(API.getUserInfo); const screenSize = useBreakpointValue({ base: 'small', md: 'big' }); diff --git a/front/components/V2/GoldenRatio.tsx b/front/components/V2/GoldenRatio.tsx index 1502863..dd211b0 100644 --- a/front/components/V2/GoldenRatio.tsx +++ b/front/components/V2/GoldenRatio.tsx @@ -60,8 +60,7 @@ const GoldenRatio = () => { direction={isPhone ? 'row-reverse' : 'column-reverse'} header={} > - - + diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index 53ac144..c773782 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -308,7 +308,6 @@ const PlayView = ({ songId, route }: RouteProps) => { } return ( - ) => { }} > { - if (!isVisible) { - // If we dismiss the popup, Go to previous page - navigation.goBack(); - } - } - : undefined - } - > - - setType('practice')} - /> - setType('normal')} - /> - - + title={translate('selectPlayMode')} + description={translate('selectPlayModeExplaination')} + isVisible={type === undefined} + setIsVisible={ + navigation.canGoBack() + ? (isVisible) => { + if (!isVisible) { + // If we dismiss the popup, Go to previous page + navigation.goBack(); + } + } + : undefined + } + > + + setType('practice')} + /> + setType('normal')} + /> + + {( [ [