Skip to content

Commit

Permalink
wip: sstaars
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Oct 22, 2023
1 parent a69318e commit 359b041
Show file tree
Hide file tree
Showing 9 changed files with 1,944 additions and 1,737 deletions.
10 changes: 8 additions & 2 deletions components/app/services/event/page.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<script setup lang="ts">
import { f7Page } from 'framework7-vue'
import { f7Link, f7NavRight, f7Navbar, f7Page } from 'framework7-vue'
</script>

<template>
<f7Page>
Event page
<f7Navbar title="SSTAARS">
<f7NavRight>
<f7Link popup-close>
Close
</f7Link>
</f7NavRight>
</f7Navbar>
</f7Page>
</template>
17 changes: 12 additions & 5 deletions components/app/services/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ async function click() {
const data = await $api(`/api/event/${state.eventId}`)
sstaarsStore.value.previousEvents[data.id] = data.name
state.sheetOpened = false
await nextTick(() => {
f7.views.current.router.navigate(`/app/services/event/${data.id}`, { openIn: 'sheet' })
})
await openEvent(state.eventId)
}
catch (err) {
if (err instanceof FetchError) {
Expand All @@ -35,6 +34,13 @@ async function click() {
state.pending = false
}
}
async function openEvent(id: string) {
state.sheetOpened = false
await nextTick(() => {
f7.view.current.router.navigate(`/app/services/event/${id}`, { openIn: 'popup' })
})
}
</script>

<template>
Expand Down Expand Up @@ -63,7 +69,7 @@ async function click() {
</f7ListButton>
</f7List>

<f7Sheet v-model:opened="state.sheetOpened" style="height: auto" swipe-to-close backdrop push>
<f7Sheet v-model:opened="state.sheetOpened" style="height: auto" swipe-to-close>
<f7PageContent>
<f7BlockTitle large>
SSTAARS
Expand Down Expand Up @@ -96,7 +102,8 @@ async function click() {
<span v-if="Object.keys(sstaarsStore.previousEvents).length === 0" class="opacity-80">
No previous events.
</span>
<f7ListItem v-for="name, id in sstaarsStore.previousEvents" :key="id" :title="name" :link="`/app/services/event/${id}`" />

<f7ListItem v-for="name, id in sstaarsStore.previousEvents" :key="id" :title="name" @click="openEvent(id)" />
</f7List>
</f7PageContent>
</f7Sheet>
Expand Down
5 changes: 5 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export default defineNuxtConfig({
devtools: { enabled: true },
spaLoadingTemplate: './app/spa-loading-template.html',

experimental: {
// https://github.com/unjs/nitro/issues/1844
appManifest: false,
},

typescript: {
strict: true,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"jose": "^4.14.6",
"lint-staged": "^14.0.1",
"material-icons": "^1.13.11",
"nuxt": "^3.7.3",
"nuxt": "^3.8.0",
"nuxt-vuefire": "^0.3.0",
"qrcode": "^1.5.3",
"simple-git": "^3.20.0",
Expand Down
3 changes: 2 additions & 1 deletion plugins/growthbook.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { GrowthBook } from '@growthbook/growthbook'
import { isDevelopment } from 'std-env'

export default defineNuxtPlugin(async () => {
const config = useRuntimeConfig()

const growthbook = new GrowthBook({
apiHost: 'https://cdn.growthbook.io',
clientKey: config.public.growthbook.clientKey,
enableDevMode: true,
enableDevMode: isDevelopment,
subscribeToChanges: true,
})

Expand Down
Loading

0 comments on commit 359b041

Please sign in to comment.