web/satellite/vuetify-poc: hide nav sidebar by default for screens less than 1280px

On screen sizes where the sidebar overlaps with the content of the page, the sidebar should be collapsed by default.

Issue:
https://github.com/storj/storj/issues/6229

Change-Id: Ia0a91acd95519de27f9ff8f1ee90c6b8e7932266
This commit is contained in:
Vitalii 2023-09-11 14:00:45 +03:00
parent f9ab2f0de7
commit 2cf233ac23
2 changed files with 6 additions and 2 deletions

View File

@ -86,6 +86,10 @@ watch(() => route.params.projectId, async newId => {
* Pre-fetches user`s and project information.
*/
onBeforeMount(async () => {
if (document.body.clientWidth < 1280) {
appStore.toggleNavigationDrawer(false);
}
isLoading.value = true;
try {

View File

@ -12,8 +12,8 @@ class AppState {
export const useAppStore = defineStore('vuetifyApp', () => {
const state = reactive<AppState>(new AppState());
function toggleNavigationDrawer(): void {
state.isNavigationDrawerShown = !state.isNavigationDrawerShown;
function toggleNavigationDrawer(isShown?: boolean): void {
state.isNavigationDrawerShown = isShown ?? !state.isNavigationDrawerShown;
}
function setPathBeforeAccountPage(path: string) {