fix: only show similar albums if there are any
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect } from 'react';
|
||||||
import { useRoute, RouteProp, useNavigation } from '@react-navigation/native';
|
import { useRoute, RouteProp, useNavigation } from '@react-navigation/native';
|
||||||
import { useAppDispatch, useTypedSelector } from 'store';
|
import { useAppDispatch, useTypedSelector } from 'store';
|
||||||
import TrackListView from './components/TrackListView';
|
import TrackListView from './components/TrackListView';
|
||||||
@@ -11,9 +11,7 @@ import { SubHeader, Text } from 'components/Typography';
|
|||||||
import { ScrollView } from 'react-native-gesture-handler';
|
import { ScrollView } from 'react-native-gesture-handler';
|
||||||
import { useGetImage } from 'utility/JellyfinApi';
|
import { useGetImage } from 'utility/JellyfinApi';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import FastImage from 'react-native-fast-image';
|
import { Dimensions, Pressable } from 'react-native';
|
||||||
import { Dimensions, Pressable, useColorScheme } from 'react-native';
|
|
||||||
import { Container } from '@shopify/react-native-skia/lib/typescript/src/renderer/Container';
|
|
||||||
import AlbumImage from './components/AlbumImage';
|
import AlbumImage from './components/AlbumImage';
|
||||||
|
|
||||||
type Route = RouteProp<StackParams, 'Album'>;
|
type Route = RouteProp<StackParams, 'Album'>;
|
||||||
@@ -84,10 +82,10 @@ const Album: React.FC = () => {
|
|||||||
downloadButtonText={t('download-album')}
|
downloadButtonText={t('download-album')}
|
||||||
deleteButtonText={t('delete-album')}
|
deleteButtonText={t('delete-album')}
|
||||||
>
|
>
|
||||||
{album?.Overview && (
|
{album?.Overview ? (
|
||||||
<Text style={{ opacity: 0.5, lineHeight: 20, fontSize: 12, paddingBottom: 24 }}>{album?.Overview}</Text>
|
<Text style={{ opacity: 0.5, lineHeight: 20, fontSize: 12, paddingBottom: 24 }}>{album?.Overview}</Text>
|
||||||
)}
|
) : null}
|
||||||
{album?.Similar && (
|
{album?.Similar?.length ? (
|
||||||
<>
|
<>
|
||||||
<SubHeader>Similar albums</SubHeader>
|
<SubHeader>Similar albums</SubHeader>
|
||||||
<ScrollView horizontal style={{ marginLeft: -24, marginTop: 8, marginBottom: 36 }} contentContainerStyle={{ paddingLeft: 24 }} showsHorizontalScrollIndicator={false}>
|
<ScrollView horizontal style={{ marginLeft: -24, marginTop: 8, marginBottom: 36 }} contentContainerStyle={{ paddingLeft: 24 }} showsHorizontalScrollIndicator={false}>
|
||||||
@@ -96,7 +94,7 @@ const Album: React.FC = () => {
|
|||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</>
|
</>
|
||||||
)}
|
) : null}
|
||||||
</TrackListView>
|
</TrackListView>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user