From b5b94adc83f751b37cfe58361ae5e9e68616ba85 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 8 Jan 2024 17:23:59 +0100 Subject: [PATCH] Format code --- front/Navigation.tsx | 3 - front/components/ScoreModal.tsx | 4 +- front/components/UI/ScaffoldDesktopCC.tsx | 8 +- front/components/UI/ScaffoldMobileCC.tsx | 4 +- front/views/PlayView.tsx | 2 +- front/views/SearchView.tsx | 4 +- front/views/V2/DiscoveryView.tsx | 92 +++++++++++------------ 7 files changed, 55 insertions(+), 62 deletions(-) diff --git a/front/Navigation.tsx b/front/Navigation.tsx index 6a8b48b..c3a06e4 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/ban-types */ import { NativeStackScreenProps, createNativeStackNavigator } from '@react-navigation/native-stack'; -import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { NavigationProp, ParamListBase, @@ -35,8 +34,6 @@ import DiscoveryView from './views/V2/DiscoveryView'; import MusicView from './views/MusicView'; import Leaderboardiew from './views/LeaderboardView'; import { LinearGradient } from 'expo-linear-gradient'; -import ScaffoldMobileCC from './components/UI/ScaffoldMobileCC'; -import ScaffoldDesktopCC from './components/UI/ScaffoldDesktopCC'; import { createCustomNavigator } from './utils/navigator'; import { Cup, Discover, Music, SearchNormal1, Setting2, User } from 'iconsax-react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; diff --git a/front/components/ScoreModal.tsx b/front/components/ScoreModal.tsx index 77aa68b..7c2628c 100644 --- a/front/components/ScoreModal.tsx +++ b/front/components/ScoreModal.tsx @@ -106,9 +106,7 @@ const ScoreModal = (props: ScoreModalProps) => { type="filled" title={translate('menuMusic')} onPress={() => - navigation.canGoBack() - ? navigation.goBack() - : navigation.navigate('Home') + navigation.canGoBack() ? navigation.goBack() : navigation.navigate('Home') } /> diff --git a/front/components/UI/ScaffoldDesktopCC.tsx b/front/components/UI/ScaffoldDesktopCC.tsx index 8b5732d..fae492c 100644 --- a/front/components/UI/ScaffoldDesktopCC.tsx +++ b/front/components/UI/ScaffoldDesktopCC.tsx @@ -7,15 +7,13 @@ import API from '../../API'; import ButtonBase from './ButtonBase'; import { Icon } from 'iconsax-react-native'; import { LoadingView } from '../Loading'; -import { Translate, TranslationKey, translate } from '../../i18n/i18n'; +import { Translate, translate } from '../../i18n/i18n'; import { useNavigation } from '../../Navigation'; import Spacer from './Spacer'; -import User from '../../models/User'; import LogoutButtonCC from './LogoutButtonCC'; -import GlassmorphismCC from './Glassmorphism'; import { BottomTabBarProps } from '@react-navigation/bottom-tabs'; import { ReactElement } from 'react'; -import { NavigationState, ParamListBase } from '@react-navigation/native'; +import { NavigationState } from '@react-navigation/native'; // TODO a tester avec un historique de plus de 3 musics différente mdr !! const SongHistory = (props: { quantity: number }) => { @@ -176,6 +174,7 @@ const ScaffoldDesktopCC = ({ if ((options as any).subMenu) return null; return ( ) => { return ; -} +}; export default Wrapper; diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index 4c8d5f2..c2bec2e 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -283,7 +283,7 @@ const PlayView = ({ songId }: PlayViewProps) => { useEffect(() => { // Song.data is updated on navigation.navigate (do not know why) // Hotfix to prevent midi setup process from reruning on game end - if (navigation.getState().routes.at(-1)?.name != "Play") { + if (navigation.getState().routes.at(-1)?.name != 'Play') { return; } if (playType && song.data && !webSocket.current) { diff --git a/front/views/SearchView.tsx b/front/views/SearchView.tsx index 63b0ced..0a8f052 100644 --- a/front/views/SearchView.tsx +++ b/front/views/SearchView.tsx @@ -80,7 +80,6 @@ const SearchView = (props: SearchViewProps) => { }; return ( - { updateFilter, updateStringQuery, }} - > + > - ); }; diff --git a/front/views/V2/DiscoveryView.tsx b/front/views/V2/DiscoveryView.tsx index 9a6f3e1..2d95be3 100644 --- a/front/views/V2/DiscoveryView.tsx +++ b/front/views/V2/DiscoveryView.tsx @@ -18,69 +18,69 @@ const HomeView = () => { const suggestions = suggestionsQuery.data?.slice(4) ?? []; return ( - + + + + + - - - + {'Suggestions'} + - - {'Suggestions'} - - - {suggestions.map((song) => ( - { - navigation.navigate('Play', { songId: song.id }); - }} - onPlay={() => { - console.log('play'); - }} - /> - ))} - + {suggestions.map((song) => ( + { + navigation.navigate('Play', { songId: song.id }); + }} + onPlay={() => { + console.log('play'); + }} + /> + ))} - + + ); };