finished assignment 3 - 100%

This commit is contained in:
Christopher Sanden
2026-03-16 17:42:22 +01:00
parent a4c2d55aea
commit ca915ec8e8
33 changed files with 2869 additions and 711 deletions

View File

@@ -0,0 +1,36 @@
import { Text, View } from "react-native"
import { uploadProgressBarStyles as styles } from "@/src/styles/app-styles"
type Palette = {
accent: string
border: string
elevated: string
mutedText: string
text: string
}
type UploadProgressBarProps = {
progress: number
label?: string
palette: Palette
}
export default function UploadProgressBar({
progress,
label = "Uploading image...",
palette,
}: UploadProgressBarProps) {
const clampedProgress = Math.max(0, Math.min(100, progress))
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={[styles.label, { color: palette.text }]}>{label}</Text>
<Text style={[styles.percentage, { color: palette.mutedText }]}>{clampedProgress}%</Text>
</View>
<View style={[styles.track, { borderColor: palette.border, backgroundColor: palette.elevated }]}>
<View style={[styles.fill, { width: `${clampedProgress}%`, backgroundColor: palette.accent }]} />
</View>
</View>
)
}