Browse Source

show numbers anyway if task is on hold / to do and amount > 1.

main
Gisle Aune 4 years ago
parent
commit
2dddb7a216
  1. 8
      svelte-ui/src/components/TaskIcon.svelte

8
svelte-ui/src/components/TaskIcon.svelte

@ -7,6 +7,8 @@ import type { IconName } from "../external/icons";
export let task: TaskResult;
export let iconName: IconName;
let showNumbersAnyway;
$: {
switch (task.statusTag) {
case "to do": iconName = "lightbulb"; break;
@ -16,10 +18,12 @@ import type { IconName } from "../external/icons";
default: iconName = "check"; break;
}
}
$: showNumbersAnyway = ["to do", "on hold"].includes(task.statusTag) && task.itemAmount > 1;
</script>
<div class="icon sccsi" class:inactive={!task.active}>
{#if !task.active}
<div class="icon sccsi" class:inactive={!task.active && !showNumbersAnyway}>
{#if !task.active && !showNumbersAnyway}
<span class="on"><Icon block name={iconName} /></span>
<span class="off">
{task.completedAmount}&nbsp;/&nbsp;{task.itemAmount}

Loading…
Cancel
Save