fix show title format

This commit is contained in:
Jorrin
2024-04-06 17:00:51 +02:00
parent c61f18941e
commit 1a142548eb

View File

@@ -92,32 +92,27 @@ export function DownloadItem(props: DownloadItemProps) {
/> />
</View> </View>
<YStack gap="$2"> <YStack gap="$2">
<XStack gap="$5"> <XStack gap="$6" maxWidth="65%">
<Text <Text fontWeight="$bold" ellipse flexGrow={1}>
fontWeight="$bold"
ellipse
maxWidth={props.item.type === "hls" ? "70%" : "40%"}
flexGrow={1}
>
{props.item.media.title} {props.item.media.title}
</Text> </Text>
{props.item.type !== "hls" && ( {props.item.type !== "hls" && (
<Text fontSize={12} color="gray"> <Text fontSize="$2" color="gray">
{props.item.speed.toFixed(2)} MB/s {props.item.speed.toFixed(2)} MB/s
</Text> </Text>
)} )}
</XStack> </XStack>
<MWProgress value={percentage} height={10}> <MWProgress value={percentage} height={10} maxWidth="100%">
<MWProgress.Indicator /> <MWProgress.Indicator />
</MWProgress> </MWProgress>
<XStack alignItems="center" justifyContent="space-between"> <XStack alignItems="center" justifyContent="space-between">
<Text fontSize={12} color="gray"> <Text fontSize="$2" color="gray">
{props.item.type === "hls" {props.item.type === "hls"
? `${percentage.toFixed()}% - ${props.item.downloaded} of ${props.item.fileSize} segments` ? `${percentage.toFixed()}% - ${props.item.downloaded} of ${props.item.fileSize} segments`
: `${percentage.toFixed()}% - ${formattedDownloaded} of ${formattedFileSize}`} : `${percentage.toFixed()}% - ${formattedDownloaded} of ${formattedFileSize}`}
</Text> </Text>
<View style={{ flexDirection: "row", alignItems: "center" }}> <View style={{ flexDirection: "row", alignItems: "center" }}>
<Text fontSize={12} color="gray"> <Text fontSize="$2" color="gray">
{statusToTextMap[props.item.status]} {statusToTextMap[props.item.status]}
</Text> </Text>
</View> </View>