Skip to content

Instantly share code, notes, and snippets.

@divyasonaraa
Created November 26, 2023 15:11
Show Gist options
  • Save divyasonaraa/ae4116a8c81f0c5e5bb0f9f3e49138ee to your computer and use it in GitHub Desktop.
Save divyasonaraa/ae4116a8c81f0c5e5bb0f9f3e49138ee to your computer and use it in GitHub Desktop.
<template>
<q-layout view="lHh Lpr fff" class="bg-grey-1">
<q-header elevated class="bg-white text-grey-8" height-hint="64">
<q-toolbar class="GNL__toolbar">
<q-btn
flat
dense
round
@click="toggleLeftDrawer"
aria-label="Menu"
icon="menu"
class="q-mr-sm"
/>
<q-toolbar-title
v-if="$q.screen.gt.xs"
shrink
class="row items-center no-wrap"
>
<q-icon name="join_left" size="xl" class="q-mr-md"></q-icon>
<span class="q-ml-sm text-grand-hotel">Blogify</span>
</q-toolbar-title>
<q-space />
<q-input
class="GNL__toolbar-input"
outlined
dense
color="bg-grey-7 shadow-1"
placeholder="Search for blogs"
>
<template v-slot:prepend>
<q-btn round flat color="grey-8" icon="search" size="lg"></q-btn>
</template>
</q-input>
<q-space />
<div class="q-gutter-sm row items-center no-wrap">
<q-btn round flat color="grey-8" icon="add_circle" size="lg"></q-btn>
<q-btn round dense flat color="grey-8" icon="notifications">
<q-badge color="red" text-color="white" floating> 2 </q-badge>
<q-tooltip>Notifications</q-tooltip>
</q-btn>
<q-btn round flat>
<q-avatar size="26px">
<img src="https://cdn.quasar.dev/img/boy-avatar.png" />
</q-avatar>
<q-tooltip>Account</q-tooltip>
</q-btn>
</div>
</q-toolbar>
</q-header>
<q-drawer
v-model="leftDrawerOpen"
show-if-above
bordered
class="bg-white"
:width="280"
>
<q-scroll-area class="fit">
<q-list padding class="text-grey-8">
<q-item
class="GNL__drawer-item"
v-ripple
v-for="link in links"
:key="link.text"
clickable
@click="handleDrawerItemClick(link)"
>
<q-item-section avatar>
<q-icon :name="link.icon" />
</q-item-section>
<q-item-section>
<q-item-label>{{ link.text }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-scroll-area>
</q-drawer>
<q-page-container class="GPL__page-container">
<router-view></router-view>
</q-page-container>
</q-layout>
</template>
<script setup>
import { useRouter } from "vue-router";
import { ref } from "vue";
import { useQuasar } from "quasar";
const router = useRouter();
const leftDrawerOpen = ref(false);
const links = [{ icon: "person", text: "For you" }];
const $q = useQuasar();
const toggleLeftDrawer = () => {
leftDrawerOpen.value = !leftDrawerOpen.value;
};
const handleDrawerItemClick = (link) => {
if (link.text === "For you") {
router.push("/");
}
};
</script>
<style lang="sass">
.GPL
&__toolbar
height: 64px
padding: 30px 300px
&__toolbar-input
width: 35%
&__drawer-item
line-height: 24px
border-radius: 0 24px 24px 0
margin-right: 12px
.q-item__section--avatar
padding-left: 12px
.q-icon
color: #5f6368
.q-item__label:not(.q-item__label--caption)
color: #3c4043
letter-spacing: .01785714em
font-size: .875rem
font-weight: 500
line-height: 1.25rem
&--storage
border-radius: 0
margin-right: 0
padding-top: 24px
padding-bottom: 24px
&__side-btn
&__label
font-size: 12px
line-height: 24px
letter-spacing: .01785714em
font-weight: 500
@media (min-width: 1024px)
&__page-container
padding-left: 94px
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment