notes page clean up

This commit is contained in:
Gamebrary 2021-05-10 13:19:24 -07:00
parent e8092d9ef7
commit 057f31de6c

View file

@ -2,8 +2,9 @@
<!-- TODO: open notes from game modal on click? -->
<template lang="html">
<b-container>
<portal to="dock">
<div class="d-flex">
<page-title
title="Notes"
>
<b-form-input
v-if="!showEmptyState"
type="search"
@ -12,15 +13,10 @@
v-model="search"
/>
<!-- TODO: create add a note modal -->
<!-- <b-button variant="warning" class="ml-2" style="width: 120px;">
<!-- <b-button>
Add note
</b-button> -->
</div>
</portal>
<page-title
title="Notes"
/>
</page-title>
<empty-state
v-if="showEmptyState"
@ -86,14 +82,10 @@ export default {
};
})
.filter(({ gameName, note }) => {
if (!this.search) {
return true;
}
if (!this.search) return true;
const noteIsMatch = note && note.toLowerCase().includes(this.search.toLowerCase());
const titleIsMatch = gameName
&& gameName.toLowerCase()
.includes(this.search.toLowerCase());
const titleIsMatch = gameName && gameName.toLowerCase().includes(this.search.toLowerCase());
return noteIsMatch || titleIsMatch;
});