fix PR I
This commit is contained in:
10
front/API.ts
10
front/API.ts
@@ -542,16 +542,6 @@ export default class API {
|
||||
};
|
||||
}
|
||||
|
||||
// public static getFavorites(): Query<Song[]> {
|
||||
// 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
|
||||
|
||||
@@ -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 (
|
||||
<NativeBaseProvider
|
||||
config={config}
|
||||
config={config}
|
||||
theme={extendTheme({
|
||||
config: {
|
||||
useSystemColorMode: false,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { translate } from '../i18n/i18n';
|
||||
import { SearchContext } from '../views/SearchView';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
export type Filter = 'artist' | 'song' | 'genre' | 'all' | 'favorite';
|
||||
export type Filter = 'artist' | 'song' | 'genre' | 'all';
|
||||
|
||||
type FilterButton = {
|
||||
name: string;
|
||||
|
||||
@@ -259,7 +259,7 @@ const FilterSwitch = () => {
|
||||
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 ? (
|
||||
<Box p={5}>
|
||||
|
||||
@@ -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<ArtistDetailsViewProps>) =>
|
||||
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<ArtistDetailsViewProps>) =>
|
||||
<ScrollView>
|
||||
<ImageBackground
|
||||
style={{width : '100%', height: isMobileView ? 200 : 300}}
|
||||
source={{uri : "https://picsum.photos/720"}}>
|
||||
source={{uri : API.getArtistIllustration(artistQuery.data.id)}}>
|
||||
<LinearGradient
|
||||
colors={['#00000000', '#000000']}
|
||||
colors={['#00000000', fadeColor]}
|
||||
style={{height : '100%', width : '100%'}}/>
|
||||
</ImageBackground>
|
||||
<Box>
|
||||
|
||||
@@ -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<GenreDetailsViewProps>) => {
|
||||
|
||||
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<GenreDetailsViewProps>) => {
|
||||
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],
|
||||
},}}
|
||||
|
||||
Reference in New Issue
Block a user