diff options
Diffstat (limited to 'front-end/src/bootstrap/components')
-rw-r--r-- | front-end/src/bootstrap/components/ConfirmPrompt.vue | 6 | ||||
-rw-r--r-- | front-end/src/bootstrap/components/Footer.vue | 2 | ||||
-rw-r--r-- | front-end/src/bootstrap/components/Header.vue | 26 |
3 files changed, 14 insertions, 20 deletions
diff --git a/front-end/src/bootstrap/components/ConfirmPrompt.vue b/front-end/src/bootstrap/components/ConfirmPrompt.vue index 78317e0..c67bcfc 100644 --- a/front-end/src/bootstrap/components/ConfirmPrompt.vue +++ b/front-end/src/bootstrap/components/ConfirmPrompt.vue @@ -5,7 +5,7 @@ <div class="modal-content-container"> <DialogPanel> <DialogTitle class="modal-title"> - {{ title }} + {{ message.title ?? 'Confirm' }} </DialogTitle> <DialogDescription class="modal-description"> @@ -55,9 +55,7 @@ const message = ref({}) onClickOutside(dialog, () => isRevealed.value ? cancel() : null) //Set message on reveal -onReveal(m => message.value = m); - -const title = computed(() => defaultTo(message.value.title, 'Confirm')) +onReveal(m => message.value = defaultTo(m, {})); const style = computed(() => { return { diff --git a/front-end/src/bootstrap/components/Footer.vue b/front-end/src/bootstrap/components/Footer.vue index 6af6936..7c306c9 100644 --- a/front-end/src/bootstrap/components/Footer.vue +++ b/front-end/src/bootstrap/components/Footer.vue @@ -17,7 +17,7 @@ <p class="nav-title"> Built with </p> - <a class="footer-link" href="https://www.vaughnnugent.com/resources/software/modules">VNLib HTTP v1.0.1</a> + <a class="footer-link" href="https://www.vaughnnugent.com/resources/software/modules">VNLib HTTP v0.1.0</a> <a class="footer-link" href="https://tailwindcss.com/">Tailwindcss</a> <a class="footer-link" href="https://vuejs.org/">Vuejs v3</a> <a class="footer-link" href="https://fontawesome.com/">Font Awesome</a> diff --git a/front-end/src/bootstrap/components/Header.vue b/front-end/src/bootstrap/components/Header.vue index 8ea2240..43a805b 100644 --- a/front-end/src/bootstrap/components/Header.vue +++ b/front-end/src/bootstrap/components/Header.vue @@ -78,18 +78,21 @@ import { debounce, find } from 'lodash-es' import { useElementSize, onClickOutside, useElementHover } from '@vueuse/core' import { computed, ref, toRefs } from 'vue' -import { useSession, useUser, useEnvSize, apiCall } from '@vnuge/vnlib.browser' +import { useEnvSize } from '@vnuge/vnlib.browser' import { RouteLocation, useRouter } from 'vue-router'; +import { storeToRefs } from 'pinia'; +import { useStore } from '../../store'; +const emit = defineEmits(['logout']) const props = defineProps<{ - siteTitle: string, routes: RouteLocation[] }>() -const { siteTitle, routes } = toRefs(props) +const { routes } = toRefs(props) + +const store = useStore(); +const { loggedIn, siteTitle } = storeToRefs(store); -const { loggedIn } = useSession() -const { userName, logout } = useUser() const { headerHeight } = useEnvSize() //Get the router for navigation @@ -105,7 +108,7 @@ const dropMenuSize = useElementSize(userDrop) const sideMenuSize = useElementSize(sideMenu) const userMenuHovered = useElementHover(userMenu) -const uname = computed(() => userName.value || 'Visitor') +const uname = computed(() => (store as any).userName || 'Visitor') const sideMenuStyle = computed(() => { // Side menu should be the exact height of the page and under the header, // So menu height is the height of the page minus the height of the header @@ -148,15 +151,8 @@ const gotoRoute = (route : string) =>{ } const OnLogout = () =>{ - apiCall(async ({ toaster }) => { - await logout() - toaster.general.success({ - id: 'logout-success', - title: 'Success', - text: 'You have been logged out', - duration: 5000 - }) - }) + //Emit logout event + emit('logout') } </script>
\ No newline at end of file |