Skip to content

Commit

Permalink
feat: add admin scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Sep 23, 2023
1 parent d17fe37 commit d841a9b
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 1 deletion.
42 changes: 42 additions & 0 deletions components/admin/home/page.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script setup lang="ts">
import { f7, f7BlockTitle, f7Link, f7List, f7ListItem, f7NavLeft, f7NavRight, f7NavTitle, f7NavTitleLarge, f7Navbar, f7Page, f7Searchbar, f7SkeletonBlock, f7SkeletonText } from 'framework7-vue'
import type { Router } from 'framework7/types'
import { useIsCurrentUserLoaded } from 'vuefire'
defineProps<{
f7router: Router.Router
}>()
const auth = useCurrentUser()
const authLoaded = useIsCurrentUserLoaded()
const state = reactive({
showLoginScreen: false,
})
watch([authLoaded, auth], (values) => {
setTimeout(() => { // This shows too fast, so it's better to lag for 1 second to prevent jarring layout changes
state.showLoginScreen = values[0] && !values[1]
}, 1000)
})
</script>

<template>
<f7Page>
<CommonLoginScreen v-model:opened="state.showLoginScreen" />
<f7Navbar large transparent :sliding="false">
<f7NavTitle sliding>
SSTAA Admin
</f7NavTitle>
<f7NavTitleLarge>
SSTAA Admin
</f7NavTitleLarge>
</f7Navbar>

<f7List inset class="space-y-8">
<div class="space-y-3">
<f7SkeletonBlock v-for="n in 3" :key="n" class="rounded-md" effect="fade" height="10rem" />
</div>
</f7List>
</f7Page>
</template>
2 changes: 1 addition & 1 deletion components/app/home/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ watch([authLoaded, auth], (values) => {

<template>
<f7Page>
<AppLoginScreen v-model:opened="state.showLoginScreen" />
<CommonLoginScreen v-model:opened="state.showLoginScreen" />
<f7Navbar large transparent :sliding="false">
<f7NavTitle sliding>
SSTAA
Expand Down
File renamed without changes.
66 changes: 66 additions & 0 deletions pages/admin/[...slug].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<script setup lang="ts">
import 'framework7/css/bundle'
import 'framework7-icons/css/framework7-icons.css'
import 'material-icons/iconfont/material-icons.css'
// @ts-expect-error Missing types
import Framework7 from 'framework7/lite-bundle'
// @ts-expect-error Missing types
import Framework7Vue from 'framework7-vue/bundle'
import { f7App, f7View } from 'framework7-vue'
import { AdminHomePage } from '#components'
Framework7.use(Framework7Vue)
const appRoutes = [
{
name: 'home',
path: '/admin',
component: AdminHomePage,
},
]
useSeoMeta({
description: 'SST Alumni App Admin',
})
useHeadSafe({
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} - SSTAA Admin` : 'SSTAA Admin'
},
link: [
{
rel: 'icon',
href: '/favicon.ico',
},
{
rel: 'apple-touch-icon',
href: '/apple-touch-icon-180x180.png',
sizes: '180x180',
},
{
rel: 'mask-icon',
href: '/maskable-icon-512x512.png',
color: '#ffffff',
},
],
})
const route = useRoute()
</script>

<template>
<VitePwaManifest />
<f7App name="SSTAA" theme="md" dark-mode :routes="appRoutes">
<f7View
main
class="safe-areas"
:url="route.path"
:master-detail-breakpoint="768"
ios-swipe-back
preload-previous-page
/>
</f7App>
</template>

0 comments on commit d841a9b

Please # to comment.