chore: Sidebar improvements in small screens (#5400)

* chore: Sidebar improvements in small screens

* chore: Minor fixes
This commit is contained in:
Sivin Varghese
2022-09-06 14:06:26 +05:30
committed by GitHub
parent 79406c5775
commit 7a5ea89fd9
9 changed files with 87 additions and 28 deletions

View File

@@ -2,7 +2,7 @@
<div class="row app-wrapper">
<sidebar
:route="currentRoute"
:class="sidebarClassName"
:sidebar-class-name="sidebarClassName"
@open-notification-panel="openNotificationPanel"
@toggle-account-modal="toggleAccountModal"
@open-key-shortcut-modal="toggleKeyShortcutModal"
@@ -44,8 +44,8 @@ import { BUS_EVENTS } from 'shared/constants/busEvents';
import WootKeyShortcutModal from 'dashboard/components/widgets/modal/WootKeyShortcutModal';
import AddAccountModal from 'dashboard/components/layout/sidebarComponents/AddAccountModal';
import AccountSelector from 'dashboard/components/layout/sidebarComponents/AccountSelector';
import AddLabelModal from 'dashboard/routes/dashboard/settings/labels/AddLabel.vue';
import NotificationPanel from 'dashboard/routes/dashboard/notifications/components/NotificationPanel.vue';
import AddLabelModal from 'dashboard/routes/dashboard/settings/labels/AddLabel';
import NotificationPanel from 'dashboard/routes/dashboard/notifications/components/NotificationPanel';
export default {
components: {
@@ -77,7 +77,7 @@ export default {
return '';
}
if (this.isSidebarOpen) {
return 'off-canvas position-left is-transition-push is-open';
return 'off-canvas is-open';
}
return 'off-canvas is-transition-push is-closed';
},
@@ -86,7 +86,7 @@ export default {
return '';
}
if (this.isSidebarOpen) {
return 'off-canvas-content is-open-left has-transition-push has-position-left';
return 'off-canvas-content is-open-left has-transition-push';
}
return 'off-canvas-content has-transition-push';
},
@@ -144,6 +144,6 @@ export default {
</script>
<style lang="scss" scoped>
.off-canvas-content.is-open-left {
transform: translateX(25.4rem);
transform: translateX(20rem);
}
</style>

View File

@@ -273,3 +273,8 @@ export default {
},
};
</script>
<style lang="scss" scoped>
.off-canvas-content.is-open-left.has-transition-push {
transform: translateX(var(--space-giga));
}
</style>

View File

@@ -87,6 +87,7 @@ export default {
</script>
<style scoped lang="scss">
@import '~dashboard/assets/scss/woot';
.secondary-menu {
background: var(--white);
border-right: 1px solid var(--s-50);
@@ -96,6 +97,14 @@ export default {
overflow: hidden;
padding: var(--space-small);
@include breakpoint(xlarge down) {
position: absolute;
}
@include breakpoint(xlarge up) {
position: unset;
}
&:hover {
overflow: auto;
}

View File

@@ -11,6 +11,7 @@ export const routes = [
headerTitle: 'NOTIFICATIONS_PAGE.HEADER',
icon: 'alert',
showNewButton: false,
showSidemenuIcon: false,
},
children: [
{

View File

@@ -1,7 +1,7 @@
<template>
<div class="settings-header">
<h1 class="page-title">
<woot-sidemenu-icon />
<woot-sidemenu-icon v-if="showSidemenuIcon" />
<back-button
v-if="showBackButton"
:button-label="backButtonLabel"
@@ -60,6 +60,10 @@ export default {
type: String,
default: '',
},
showSidemenuIcon: {
type: Boolean,
default: true,
},
},
computed: {
...mapGetters({

View File

@@ -8,6 +8,7 @@
:show-back-button="showBackButton"
:back-url="backUrl"
:show-new-button="showNewButton"
:show-sidemenu-icon="showSidemenuIcon"
/>
<keep-alive v-if="keepAlive">
<router-view />
@@ -44,6 +45,10 @@ export default {
type: [String, Object],
default: '',
},
showSidemenuIcon: {
type: Boolean,
default: true,
},
},
data() {
return {};