Skip to content

Commit

Permalink
Merge pull request #6 from krazkidd:pinia-refactor
Browse files Browse the repository at this point in the history
Fix SSR mode
  • Loading branch information
krazkidd authored Sep 26, 2023
2 parents 28ce066 + 16fe56f commit 1597aea
Show file tree
Hide file tree
Showing 6 changed files with 2,004 additions and 242 deletions.
11 changes: 5 additions & 6 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script setup lang="ts">
import { navMenuItems, homeMenuItem } from '~~/nav'
import { useAppSettingsStore } from '~~/stores/AppSettings';
const appSettingsStore = useAppSettingsStore();
const colorMode = useColorMode();
const isSidebarVisible = ref(false);
const sidebarPassThroughOptions = {
Expand All @@ -24,22 +23,22 @@ const menuPassThroughOptions = {
<Sidebar v-model:visible="isSidebarVisible" position="right" :pt="sidebarPassThroughOptions">
<template #header>
<Button
@click="appSettingsStore.colorMode = appSettingsStore.colorMode === 'system' ? 'dark' : appSettingsStore.colorMode === 'dark' ? 'light' : 'system'"
@click="colorMode.preference = colorMode.preference === 'system' ? 'dark' : colorMode.preference === 'dark' ? 'light' : 'system'"
class="text-gray-800 border-gray-800 dark:text-gray-300 dark:border-gray-300"
size="small"
outlined
aria-label="Color mode"
title="Color mode"
>
<template v-if="appSettingsStore.colorMode === 'system'">
<template v-if="colorMode.preference === 'system'">
<i class="pi pi-fw pi-desktop pr-2"></i>
System
</template>
<template v-if="appSettingsStore.colorMode === 'dark'">
<template v-if="colorMode.preference === 'dark'">
<i class="pi pi-fw pi-moon pr-2"></i>
Dark
</template>
<template v-if="appSettingsStore.colorMode === 'light'">
<template v-if="colorMode.preference === 'light'">
<i class="pi pi-fw pi-sun pr-2"></i>
Light
</template>
Expand Down
4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default defineNuxtConfig({
"@vueuse/nuxt",
"nuxt-vuefire"
],
// HACK: We have to disable SSR until Pinia has better
// support for our usage. See stores/AppSettings.ts.
// NOTE: This allows us to deploy to some free
// hosting services.
ssr: false,
css: [
'primevue/resources/themes/saga-blue/theme.css',
Expand Down
Loading

0 comments on commit 1597aea

Please sign in to comment.