card improvements and artist page more beautiful

This commit is contained in:
Violet Caulfield
2024-12-29 08:47:04 -06:00
parent 16b25f4e64
commit 2ee9d1ac06
4 changed files with 11 additions and 12 deletions

View File

@@ -23,19 +23,18 @@ export default function Artist({ artistId, artistName }: { artistId: string, art
<FlatList
contentContainerStyle={{
flexGrow: 1,
justifyContent: 'center'
justifyContent: 'center',
alignItems: "center"
}}
data={albums}
numColumns={2} // TODO: Make this adjustable
renderItem={({ item: album }) => {
return (
<Card
caption={
<>
<H5>{`${album.Name}`}</H5>
<Text>{`${album.ProductionYear}`}</Text>
</>
}
caption={album.Name}
subCaption={album.ProductionYear?.toString()}
width={250}
marginHorizontal={20}
cornered
itemId={album.Id!}
/>

View File

@@ -40,7 +40,8 @@ export function Card(props: CardProps) {
hoverStyle={props.onPress ? { scale: 0.925 } : {}}
pressStyle={props.onPress ? { scale: 0.875 } : {}}
borderRadius={props.cornered ? 2 : 25}
{...dimensions}
width={props.width ?? 150}
height={props.width ?? 150 + 50}
{...props}
>
<TamaguiCard.Header padded>

View File

@@ -1,4 +1,4 @@
import { H1 as TamaguiH1, H2 as TamaguiH2, SizeTokens, Label as TamaguiLabel, H5, Paragraph } from "tamagui"
import { H1 as TamaguiH1, H2 as TamaguiH2, SizeTokens, Label as TamaguiLabel, H5, Paragraph, TextProps as TamaguiTextProps } from "tamagui"
interface LabelProps {
htmlFor: string,
@@ -24,11 +24,9 @@ export function H2({ children }: { children: string }): React.JSX.Element {
)
}
interface TextProps {
interface TextProps extends TamaguiTextProps {
bold?: boolean | undefined
children: string;
width?: number;
textAlign?: "left" | "right" | "unset" | "auto" | "center" | "justify" | undefined;
}
export function Text(props: TextProps): React.JSX.Element {

View File

@@ -30,6 +30,7 @@ export default function RecentlyPlayed(): React.JSX.Element {
caption={recentlyPlayedTrack.Name}
subCaption={`${recentlyPlayedTrack.Artists?.join(", ")}`}
cornered
width={150}
itemId={recentlyPlayedTrack.AlbumId!}
marginRight={20}
onPress={async () => {