Skip to content

Commit cb5fc11

Browse files
committed
docs(GitHubLogin): close drawer when navigating to the dashboard on mobile
1 parent bebce5e commit cb5fc11

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/docs/src/components/app/GitHubLogin.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,18 @@
7373
import { useAuth0 } from '@/plugins/auth'
7474
import { useI18n } from 'vue-i18n'
7575
import { useRoute, useRouter } from 'vue-router'
76+
import { useDisplay } from 'vuetify'
7677
7778
// Utilities
7879
import { computed } from 'vue'
7980
import { rpath } from '@/util/routes'
8081
82+
// Stores
83+
import { useAppStore } from '@/store/app'
84+
85+
const app = useAppStore()
86+
// TODO: update to isMobile when v3.4.0 is released
87+
const { mobile } = useDisplay()
8188
const { t } = useI18n()
8289
const route = useRoute()
8390
const router = useRouter()
@@ -86,6 +93,8 @@
8693
const isDashboard = computed(() => route.meta?.category === 'user')
8794
8895
function onClickDashboard () {
96+
if (mobile.value) app.drawer = false
97+
8998
router.push(rpath('/user/dashboard/'))
9099
}
91100

packages/docs/src/components/app/drawer/Drawer.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
import AppList from '@/components/app/list/List.vue'
2828
2929
// Composables
30-
import { useAppStore } from '@/store/app'
3130
import { useDisplay, useTheme } from 'vuetify'
3231
3332
// Utilities
3433
import { computed, onMounted, ref, watch } from 'vue'
3534
import { wait } from '@/util/helpers'
35+
36+
// Stores
37+
import { useAppStore } from '@/store/app'
3638
import { useUserStore } from '@/store/user'
3739
3840
const app = useAppStore()

0 commit comments

Comments
 (0)