Task Progress bar now only renders when totalTasks > 0
This commit is contained in:
@@ -293,33 +293,35 @@ export default function ViewDetailsAssignment() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className="mt-5">
|
{totalTasks > 0 ? (
|
||||||
<View className="mb-2 flex-row items-center justify-between">
|
<View className="mt-5">
|
||||||
<Text className="text-sm font-semibold text-text-secondary">
|
<View className="mb-2 flex-row items-center justify-between">
|
||||||
Task Progress
|
<Text className="text-sm font-semibold text-text-secondary">
|
||||||
</Text>
|
Task Progress
|
||||||
|
</Text>
|
||||||
|
|
||||||
<Text className="text-sm font-bold text-text-main">
|
<Text className="text-sm font-bold text-text-main">
|
||||||
{completedTasks}/{totalTasks}
|
{completedTasks}/{totalTasks}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className="h-3 overflow-hidden rounded-full bg-app-subtle">
|
<View className="h-3 overflow-hidden rounded-full bg-app-subtle">
|
||||||
<View
|
<View
|
||||||
className="h-full rounded-full"
|
className="h-full rounded-full"
|
||||||
style={{
|
style={{
|
||||||
width: `${progress}%`,
|
width: `${progress}%`,
|
||||||
backgroundColor: colorSet.strong,
|
backgroundColor: colorSet.strong,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Text className="mt-2 text-xs font-medium text-text-secondary">
|
<Text className="mt-2 text-xs font-medium text-text-secondary">
|
||||||
{remainingTasks === 0
|
{remainingTasks === 0
|
||||||
? 'All tasks complete'
|
? 'All tasks complete'
|
||||||
: `${remainingTasks} task${remainingTasks === 1 ? '' : 's'} remaining`}
|
: `${remainingTasks} task${remainingTasks === 1 ? '' : 's'} remaining`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<Text className="mt-4 text-sm text-text-muted">
|
<Text className="mt-4 text-sm text-text-muted">
|
||||||
Last changed: {formatDateTime(assignment.lastChanged)}
|
Last changed: {formatDateTime(assignment.lastChanged)}
|
||||||
|
|||||||
Reference in New Issue
Block a user