From dc923e6d651462711b752a852bacfc367d52b462 Mon Sep 17 00:00:00 2001 From: Christian Carlsson Date: Tue, 19 Nov 2024 12:45:38 +0000 Subject: [PATCH] feat: bottom mobile navigation (#38) --- Makefile | 4 ++ apps/web/src/clients/interceptors.ts | 2 + apps/web/src/components/Dashboard.vue | 48 ++++++++++++-------- apps/web/src/components/NavigationMobile.vue | 37 +++++++++++++++ 4 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 apps/web/src/components/NavigationMobile.vue diff --git a/Makefile b/Makefile index 241924d3..c4541a07 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +start_db: + docker start getstronger + run_db: docker rm getstronger -f docker run --name getstronger -d -p 5433:5432 -e POSTGRES_DB=root -e POSTGRES_USER=root -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16.4 @@ -33,6 +36,7 @@ run_web: lint: golangci-lint run + cd apps/web && npm run format sort_packages: npx sort-package-json diff --git a/apps/web/src/clients/interceptors.ts b/apps/web/src/clients/interceptors.ts index ae7a51c3..c4724f07 100644 --- a/apps/web/src/clients/interceptors.ts +++ b/apps/web/src/clients/interceptors.ts @@ -9,11 +9,13 @@ export const logger: Interceptor = (next) => async (req) => { } export const auth: Interceptor = (next) => async (req) => { + console.log('auth interceptor') const authStore = useAuthStore() try { req.header.set('Authorization', `Bearer ${authStore.accessToken}`) return next(req) } catch (error) { + console.error('error in auth interceptor', error) if (!(error instanceof ConnectError)) { throw error } diff --git a/apps/web/src/components/Dashboard.vue b/apps/web/src/components/Dashboard.vue index c9e7720c..5132ee87 100644 --- a/apps/web/src/components/Dashboard.vue +++ b/apps/web/src/components/Dashboard.vue @@ -15,18 +15,19 @@ import { Bars3Icon, BellIcon, BookOpenIcon, + FolderIcon, HomeIcon, XMarkIcon, - FolderIcon, } from '@heroicons/vue/24/outline' -import { ChevronDownIcon, MagnifyingGlassIcon } from '@heroicons/vue/20/solid' -import { RouterView, useLink, useRoute } from 'vue-router' +import { ChevronDownIcon } from '@heroicons/vue/20/solid' +import { RouterView, useRoute } from 'vue-router' const navigation = [ { name: 'Home', href: '/home', icon: HomeIcon }, { name: 'Routines', href: '/routines', icon: ArrowPathRoundedSquareIcon }, { name: 'Exercises', href: '/exercises', icon: BookOpenIcon }, { name: 'Workouts', href: '/workouts', icon: FolderIcon }, + { name: 'Notifications', href: '/notifications', icon: BellIcon }, ] const userNavigation = [ @@ -39,10 +40,12 @@ const sidebarOpen = ref(false) const route = useRoute() const isActive = (basePath: string) => computed(() => route.path.startsWith(basePath)) + +import NavigationMobile from '@/components/NavigationMobile.vue' diff --git a/apps/web/src/components/NavigationMobile.vue b/apps/web/src/components/NavigationMobile.vue new file mode 100644 index 00000000..504c1f5c --- /dev/null +++ b/apps/web/src/components/NavigationMobile.vue @@ -0,0 +1,37 @@ + + + + +