add support for project inactivity, added new checkbox component.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-01-04 19:38:46 +01:00
parent 7dfa1ec8b4
commit c3e589aa3e
11 changed files with 117 additions and 21 deletions
+20 -1
View File
@@ -1,21 +1,35 @@
<script lang="ts">
import Boi from "../components/Boi.svelte";
import Checkbox from "../components/Checkbox.svelte";
import ProjectEntry from "../components/ProjectEntry.svelte";
import type { ModalData } from "../stores/modal";
import projectStore from "../stores/project";
const mdProjectAdd: ModalData = {name: "project.add"};
let showInactive = ($projectStore.filter.active === null);
$: {
if (showInactive && $projectStore.filter.active === true) {
projectStore.markStale();
}
if (!showInactive && $projectStore.filter.active == null) {
projectStore.markStale();
}
}
$: {
if ($projectStore.stale && !$projectStore.loading) {
projectStore.load({
active: true,
active: showInactive ? null : true,
});
}
}
</script>
<div class="page">
<div class="options">
<Checkbox centered bind:checked={showInactive} label="Show inactive projects." />
</div>
{#each $projectStore.projects as project (project.id)}
<ProjectEntry showAllOptions project={project} />
{/each}
@@ -31,4 +45,9 @@
margin-top: 0;
box-sizing: border-box;
}
div.options {
display: flex;
margin: 1em auto;
}
</style>