mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-04 01:50:09 -06:00
image fixes
holy shit that looks so good
This commit is contained in:
@@ -5,15 +5,8 @@ export const queryConfig = {
|
||||
recents: 50
|
||||
},
|
||||
images: {
|
||||
album: {
|
||||
fillHeight: 300,
|
||||
fillWidth: 300,
|
||||
format: ImageFormat.Jpg
|
||||
},
|
||||
artist: {
|
||||
fillWidth: 300,
|
||||
fillHeight: 400,
|
||||
format: ImageFormat.Jpg
|
||||
}
|
||||
fillHeight: 300,
|
||||
fillWidth: 300,
|
||||
format: ImageFormat.Jpg
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { CachedImage } from "@georstat/react-native-image-cache";
|
||||
import invert from "invert-color"
|
||||
import { Blurhash } from "react-native-blurhash"
|
||||
import { queryConfig } from "../../api/queries/query.config";
|
||||
|
||||
interface CardProps extends TamaguiCardProps {
|
||||
artistName?: string;
|
||||
@@ -24,7 +25,7 @@ export function Card(props: CardProps) {
|
||||
const [imageLoaded, setImageLoaded] = useState<boolean>(false);
|
||||
const dimensions = props.artistName ? cardDimensions.artist : cardDimensions.album;
|
||||
|
||||
const cardTextColor = props.blurhash ? invert(Blurhash.getAverageColor(props.blurhash)!, true) : undefined;
|
||||
const cardTextColor = props.blurhash ? invert(Blurhash.getAverageColor(props.blurhash)!) : undefined;
|
||||
|
||||
return (
|
||||
<TamaguiCard
|
||||
@@ -39,7 +40,7 @@ export function Card(props: CardProps) {
|
||||
>
|
||||
<TamaguiCard.Header padded>
|
||||
{ props.children && (
|
||||
<H3 color={cardTextColor ? cardTextColor : 'unset'}>{ props.children }</H3>
|
||||
<H3 color={cardTextColor}>{ props.children }</H3>
|
||||
)}
|
||||
</TamaguiCard.Header>
|
||||
<TamaguiCard.Footer padded>
|
||||
@@ -61,7 +62,7 @@ export function Card(props: CardProps) {
|
||||
.getItemImageUrlById(
|
||||
props.itemId,
|
||||
ImageType.Primary,
|
||||
{ ...dimensions})
|
||||
{ ...queryConfig.images})
|
||||
}
|
||||
imageStyle={{
|
||||
...dimensions,
|
||||
|
||||
Reference in New Issue
Block a user