From b61968706dfd9f06455e87d30aded29f991be48d Mon Sep 17 00:00:00 2001 From: danis Date: Sat, 9 Sep 2023 14:25:03 +0200 Subject: [PATCH] fix PR I --- front/API.ts | 10 ---------- front/Theme.tsx | 12 ++++++------ front/components/SearchBar.tsx | 2 +- front/components/SearchResult.tsx | 2 +- front/views/ArtistDetailsView.tsx | 7 ++++--- front/views/GenreDetailsView.tsx | 5 +++-- 6 files changed, 15 insertions(+), 23 deletions(-) diff --git a/front/API.ts b/front/API.ts index 4ef5531..54ac0e5 100644 --- a/front/API.ts +++ b/front/API.ts @@ -542,16 +542,6 @@ export default class API { }; } - // public static getFavorites(): Query { - // return { - // key: 'favorites', - // exec: () => - // API.fetch({ - // route: '/search/songs/o', - // }), - // }; - // } - /** * Retrieve the authenticated user's search history * @param skip number of entries skipped before returning diff --git a/front/Theme.tsx b/front/Theme.tsx index 9c19074..b6e61ed 100644 --- a/front/Theme.tsx +++ b/front/Theme.tsx @@ -4,15 +4,15 @@ import { useEffect } from 'react'; const ThemeProvider = ({ children }: { children: JSX.Element }) => { const colorScheme = useColorScheme(); - const config = { - dependencies: { - "linear-gradient": require("expo-linear-gradient").LinearGradient, - }, - }; + const config = { + dependencies: { + "linear-gradient": require("expo-linear-gradient").LinearGradient, + }, + }; return ( { export const SearchResultComponent = () => { const { stringQuery } = React.useContext(SearchContext); const { filter } = React.useContext(SearchContext); - const shouldOutput = !!stringQuery.trim() || filter == "favorite"; + const shouldOutput = !!stringQuery.trim(); return shouldOutput ? ( diff --git a/front/views/ArtistDetailsView.tsx b/front/views/ArtistDetailsView.tsx index 7d2dae9..a3ddfb7 100644 --- a/front/views/ArtistDetailsView.tsx +++ b/front/views/ArtistDetailsView.tsx @@ -1,4 +1,4 @@ -import { Box, Heading, useBreakpointValue, ScrollView } from 'native-base'; +import { Box, Heading, useBreakpointValue, ScrollView, useColorModeValue } from 'native-base'; import { useQuery } from '../Queries'; import { LoadingView } from '../components/Loading'; import API from '../API'; @@ -17,6 +17,7 @@ const ArtistDetailsView = ({ artistId }: RouteProps) => const artistQuery = useQuery(API.getArtist(artistId)); const songsQuery = useQuery(API.getSongsByArtist(artistId)); const screenSize = useBreakpointValue({ base: 'small', md: 'big' }); + const fadeColor = useColorModeValue('#ffffff', '#000000'); const isMobileView = screenSize == 'small'; const navigation = useNavigation(); @@ -32,9 +33,9 @@ const ArtistDetailsView = ({ artistId }: RouteProps) => + source={{uri : API.getArtistIllustration(artistQuery.data.id)}}> diff --git a/front/views/GenreDetailsView.tsx b/front/views/GenreDetailsView.tsx index a0ff410..5dd6e52 100644 --- a/front/views/GenreDetailsView.tsx +++ b/front/views/GenreDetailsView.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Heading, useBreakpointValue, ScrollView } from 'native-base'; +import { Box, Flex, Heading, useBreakpointValue, ScrollView, useColorModeValue } from 'native-base'; import { useQueries, useQuery } from '../Queries'; import { LoadingView } from '../components/Loading'; import { RouteProps, useNavigation } from '../Navigation'; @@ -24,6 +24,7 @@ const GenreDetailsView = ({ genreId }: RouteProps) => { const screenSize = useBreakpointValue({ base: "small", md: "big" }); const isMobileView = screenSize == "small"; + const fadeColor = useColorModeValue('#ffffff', '#000000'); const navigation = useNavigation(); if (genreQuery.isError || songsQuery.isError) { @@ -42,7 +43,7 @@ const GenreDetailsView = ({ genreId }: RouteProps) => { width={'100%'} bg={{ linearGradient: { - colors: [colorRange[Math.floor(Math.random() * 5)] ?? '#364fc7', 'black'], + colors: [colorRange[Math.floor(Math.random() * 5)] ?? '#364fc7', fadeColor], start: [0, 0], end: [0, 1], },}}