Assignment Progress now only renders when the subject has one or more assignments
This commit is contained in:
@@ -324,35 +324,37 @@ export default function ViewDetailsSubject() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className="mt-5">
|
{totalAssignments > 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">
|
||||||
Assignment Progress
|
<Text className="text-sm font-semibold text-text-secondary">
|
||||||
</Text>
|
Assignment Progress
|
||||||
|
</Text>
|
||||||
|
|
||||||
<Text className="text-sm font-bold text-text-main">
|
<Text className="text-sm font-bold text-text-main">
|
||||||
{completedAssignments}/{totalAssignments}
|
{completedAssignments}/{totalAssignments}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="h-3 overflow-hidden rounded-full bg-app-subtle">
|
||||||
|
<View
|
||||||
|
className="h-full rounded-full"
|
||||||
|
style={{
|
||||||
|
width: `${progress}%`,
|
||||||
|
backgroundColor: colorSet.strong,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Text className="mt-2 text-xs font-medium text-text-secondary">
|
||||||
|
{remainingAssignments === 0
|
||||||
|
? 'All assignments complete'
|
||||||
|
: `${remainingAssignments} assignment${
|
||||||
|
remainingAssignments === 1 ? '' : 's'
|
||||||
|
} remaining`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
) : null}
|
||||||
<View className="h-3 overflow-hidden rounded-full bg-app-subtle">
|
|
||||||
<View
|
|
||||||
className="h-full rounded-full"
|
|
||||||
style={{
|
|
||||||
width: `${progress}%`,
|
|
||||||
backgroundColor: colorSet.strong,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<Text className="mt-2 text-xs font-medium text-text-secondary">
|
|
||||||
{remainingAssignments === 0
|
|
||||||
? 'All assignments complete'
|
|
||||||
: `${remainingAssignments} assignment${
|
|
||||||
remainingAssignments === 1 ? '' : 's'
|
|
||||||
} remaining`}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<Text className="mt-4 text-sm text-text-muted">
|
<Text className="mt-4 text-sm text-text-muted">
|
||||||
Last changed: {formatDateTime(subject.lastChanged)}
|
Last changed: {formatDateTime(subject.lastChanged)}
|
||||||
|
|||||||
Reference in New Issue
Block a user