Skip to content

Commit 36322d9

Browse files
Cosmetic Fixes
Signed-off-by: Kiran Parajuli <[email protected]>
1 parent 4b600c5 commit 36322d9

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

src/App.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
:class="{
66
show: sidebarState,
77
}"
8-
:toggle-sidebar="toggleSidebar"
8+
:toggle-sidebar="closeSidebar"
9+
:is-mobile="screenWidth < 780"
910
/>
1011
<div
1112
v-if="showSidebar && screenWidth < 780 && sidebarState"
@@ -39,6 +40,9 @@ const showFooter = computed(() => router.currentRoute.value.meta.footer);
3940
const toggleSidebar = () => {
4041
sidebarState.value = !sidebarState.value;
4142
};
43+
const closeSidebar = () => {
44+
sidebarState.value = false;
45+
};
4246
4347
const screenWidth = ref(0);
4448
onMounted(() => {

src/components/TheAppbar.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ defineProps<{
1212
</button>
1313
<h1><router-link to="/" class="!no-underline">Vue Formik</router-link></h1>
1414
<div class="grow" />
15+
<router-link to="/about">About</router-link>
1516
<a href="https://github.com/vue-formik/vue-formik" target="_blank"> ⭐ Star us on GitHub </a>
1617
</div>
1718
</nav>
@@ -40,7 +41,7 @@ defineProps<{
4041
a
4142
color: white
4243
text-decoration: none
43-
@apply text-sm
44+
@apply text-sm px-2 mx-2
4445
&:hover
4546
text-decoration: underline
4647
</style>

src/components/TheSidebar.vue

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
<template>
2-
<aside class="the-sidebar">
2+
<aside
3+
class="the-sidebar"
4+
:style="{
5+
paddingLeft: isMobile ? '2rem' : '1rem',
6+
}"
7+
>
8+
<button
9+
v-if="isMobile"
10+
class="absolute top-1 right-1 text-xs"
11+
title="Close Sidebar"
12+
@click="toggleSidebar"
13+
>
14+
<span>Close</span>
15+
</button>
316
<ul class="flex flex-col gap-2">
417
<template v-for="(item, index) in TheSidebarItems" :key="index">
518
<li>
@@ -26,20 +39,22 @@ import TheSidebarItems from "@/constants/theSidebarItems.ts";
2639
2740
defineProps<{
2841
toggleSidebar: () => void;
42+
isMobile: boolean;
2943
}>();
3044
</script>
3145

3246
<style lang="sass">
3347
.the-sidebar
34-
@apply pt-4 pl-2
48+
@apply pt-4 relative
3549
@apply border-r border-surface-b
3650
3751
ul
3852
li
39-
@apply px-2 text-sm
53+
@apply mb-1
4054
& > p
41-
@apply mt-5 mb-1.5 text-xs
55+
@apply mt-5 mb-2 text-xs
4256
a
57+
@apply px-2 py-1 text-sm
4358
@apply text-gray-400 rounded
4459
@apply transition-all duration-200 ease-in-out
4560
&:hover
@@ -48,6 +63,4 @@ defineProps<{
4863
@apply text-white brightness-90
4964
&.router-link-exact-active
5065
@apply text-primary
51-
ul li
52-
@apply mb-1.5
5366
</style>

src/constants/theSidebarItems.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export default [
44
children: [
55
{ name: "Introduction", path: "/getting-started/introduction" },
66
{ name: "Quick Start", path: "/getting-started/quick-start" },
7-
{ name: "Quick Start", path: "/getting-started/why" },
87
],
98
},
109
{

src/views/HomeView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
<section class="mb-12">
99
<div class="flex gap-4 justify-center items-center">
10-
<router-link class="primary-btn md" to="/getting-started/introduction"
11-
>Why Vue-Formik?</router-link
12-
>
10+
<router-link class="primary-btn md" to="/getting-started/introduction">
11+
Introduction
12+
</router-link>
1313
<router-link class="secondary-btn md" to="/getting-started/quick-start">
1414
Get Started
1515
</router-link>

0 commit comments

Comments
 (0)