feat: empty list message
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
- [x] list option: move completed below
|
- [x] list option: move completed below
|
||||||
- [x] list option: hide completed
|
- [x] list option: hide completed
|
||||||
- [x] options in cookies
|
- [x] options in cookies
|
||||||
- [ ] Empty list message
|
- [x] Empty list message
|
||||||
- [x] change lang
|
- [x] change lang
|
||||||
- [ ] toasts
|
- [ ] toasts
|
||||||
- [ ] handle errors
|
- [ ] handle errors
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
"resets": "Resets",
|
"resets": "Resets",
|
||||||
"completed": "Completed",
|
"completed": "Completed",
|
||||||
"new_task_hint": "New task",
|
"new_task_hint": "New task",
|
||||||
|
"empty_hint": "Looks like there's nothing here, start by adding a new task.",
|
||||||
|
"all_completed_hint": "Looks like everything's been done!",
|
||||||
"options": {
|
"options": {
|
||||||
"title": "Options",
|
"title": "Options",
|
||||||
"sort_by": "Sort by",
|
"sort_by": "Sort by",
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
"resets": "Reviens",
|
"resets": "Reviens",
|
||||||
"completed": "Complété",
|
"completed": "Complété",
|
||||||
"new_task_hint": "Nouvelle tâche",
|
"new_task_hint": "Nouvelle tâche",
|
||||||
|
"empty_hint": "On dirait qu'il n'y a rien ici, commence par ajouter une tâche.",
|
||||||
|
"all_completed_hint": "On dirait bien que tout a été fait !",
|
||||||
"options": {
|
"options": {
|
||||||
"title": "Options",
|
"title": "Options",
|
||||||
"sort_by": "Trier par",
|
"sort_by": "Trier par",
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ const showNextReset = booleanCookieRef("toutDouxShowNextReset", false);
|
|||||||
const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false);
|
const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false);
|
||||||
|
|
||||||
const hasCompleted = computed<boolean>(() => tasks.value.some(taskCompleted));
|
const hasCompleted = computed<boolean>(() => tasks.value.some(taskCompleted));
|
||||||
|
const empty = computed<boolean>(() => tasks.value.length === 0);
|
||||||
|
const allCompleted = computed<boolean>(() => tasks.value.every(taskCompleted));
|
||||||
|
|
||||||
function fetchTasks() {
|
function fetchTasks() {
|
||||||
void getTasks(list.value)
|
void getTasks(list.value)
|
||||||
@@ -88,6 +90,12 @@ onBeforeMount(fetchTasks);
|
|||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
<li v-if="empty" class="list-row italic text-xl font-extralight">
|
||||||
|
{{ $t('empty_hint') }}
|
||||||
|
</li>
|
||||||
|
<li v-if="allCompleted && separateCompleted" class="list-row italic text-xl font-extralight">
|
||||||
|
{{ $t('all_completed_hint') }}
|
||||||
|
</li>
|
||||||
<li class="list-row">
|
<li class="list-row">
|
||||||
<div class="list-col-grow">
|
<div class="list-col-grow">
|
||||||
<input
|
<input
|
||||||
|
|||||||
Reference in New Issue
Block a user