Skip to content

Commit

Permalink
showing/hiding cards on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Nov 7, 2024
1 parent 6fb5cb9 commit fac9c60
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@
<!-- Cards -->

<!-- Favourites -->
<favourites-card class="q-mb-md" @click="onFavClick" />
<favourites-card class="q-mb-md" @click="onFavClick"
v-if="visibleCards.length != 0 && visibleCards.indexOf(CardNames.FavouritesCard) != -1" />

<!-- Device Journal -->
<journal-card class="my-card" @click="onJournalClick" />

<!-- dummy -->
<!-- <q-card class="my-card bg-primary">
<q-card-section>{{ lorem }}</q-card-section>
<q-separator />
<q-card-section>{{ lorem }}</q-card-section>
</q-card> -->
<journal-card class="my-card" @click="onJournalClick"
v-if="visibleCards.length != 0 && visibleCards.indexOf(CardNames.JournalCard) != -1" />

<!-- Scheduled Transactions -->
<scheduled-card class="my-card" @click="onScheduledClick" />
<scheduled-card class="my-card" @click="onScheduledClick"
v-if="visibleCards.length != 0 && visibleCards.indexOf(CardNames.ScheduledXactCard) != -1" />

<!-- CashierSync -->
<sync-card />
<sync-card v-if="visibleCards.length != 0 && visibleCards.indexOf(CardNames.SyncCard) != -1" />

<!-- floating action button -->
<q-page-sticky position="bottom-right" :offset="[18, 18]">
Expand Down Expand Up @@ -94,8 +90,8 @@ import SyncCard from '../components/SyncCard.vue'
import FavouritesCard from '../components/FavouritesCard.vue'
import JournalCard from '../components/JournalCard.vue'
import ScheduledCard from '../components/ScheduledTxCard.vue'
import { onMounted, ref } from 'vue'
import { SettingKeys, settings } from '../lib/settings'
import { onMounted, Ref, ref } from 'vue'
import { CardNames, SettingKeys, settings } from '../lib/settings'
import useNotifications from 'src/lib/CashierNotification'
import { Menu as IconMenu, MoreVertical, Plus as PlusIcon, Settings as IconSettings, X as IconX } from 'lucide-vue-next'
Expand All @@ -104,13 +100,16 @@ const mainStore = useMainStore()
const Notification = useNotifications()
const dataCreationDialogVisible = ref(false)
var visibleCards: Ref<Array<string>> = ref([])
onMounted(async () => {
// Check if the db is empty and offer to create demo data.
const isDbInitialized = await settings.get(SettingKeys.dbInitialized)
if (isDbInitialized == null) {
dataCreationDialogVisible.value = true
}
visibleCards.value = await settings.get(SettingKeys.visibleCards)
})
function menuClicked() {
Expand Down

0 comments on commit fac9c60

Please sign in to comment.