clean code + search history handler fix

This commit is contained in:
danis
2023-09-05 13:44:30 +02:00
parent 0ba3bec5aa
commit c9d3ef88e7
2 changed files with 1 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ import Model, { ModelValidator } from './Model';
import * as yup from 'yup';
import ResponseHandler from './ResponseHandler';
export const SearchType = ['song', 'artist', 'album'] as const;
export const SearchType = ['song', 'artist', 'album', 'genre'] as const;
export type SearchType = (typeof SearchType)[number];
const SearchHistoryValidator = yup

View File

@@ -10,31 +10,12 @@ import CardGridCustom from '../components/CardGridCustom';
import { translate } from '../i18n/i18n';
const colorRange = ['#364fc7', '#5c940d', '#c92a2a', '#d6336c', '#20c997'];
// {
// code: '#364fc7',
// },
// {
// code: '#5c940d',
// },
// {
// code: '#c92a2a',
// },
// {
// code: '#d6336c',
// },
// {
// code: '#20c997'
// }
// ]
type GenreDetailsViewProps = {
genreId: number;
}
const rockArtists: any[] = [];
const GenreDetailsView = ({ genreId }: RouteProps<GenreDetailsViewProps>) => {
// const { isLoading: isLoadingGenre, data: genreData, error: isErrorGenre } = useQuery(API.getArtist(genreId));
const genreQuery = useQuery(API.getGenre(genreId))
const songsQuery = useQuery(API.getSongsByGenre(genreId))
const screenSize = useBreakpointValue({ base: "small", md: "big" });
@@ -69,7 +50,6 @@ const GenreDetailsView = ({ genreId }: RouteProps<GenreDetailsViewProps>) => {
justifyContent={['flex-start']}
mt={4}
>
<Box>
<CardGridCustom
content={songsQuery.data.slice(0, songsQuery.data.length).map((songData) => ({
image: API.getArtistIllustration(songData.id),
@@ -82,10 +62,6 @@ const GenreDetailsView = ({ genreId }: RouteProps<GenreDetailsViewProps>) => {
}))}
cardComponent={ArtistCard}
/>
</Box>
<Box>
</Box>
</Flex>
</ScrollView>
);