-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from MartinsOnuoha/FEAT-side-panel
✨ feat(appsidepanel.vue): add side panel to view statements
- Loading branch information
Showing
9 changed files
with
112 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script lang="ts" setup> | ||
import type { PropType } from 'vue' | ||
import type { Statement } from '@/stores/db' | ||
import MdiClose from '@/components/Icons/MdiClose.vue' | ||
import AppCategory from '@/components/AppCategory/AppCategory.vue' | ||
import { useDBStore } from '@/stores/db' | ||
const emit = defineEmits(['panel:close']) | ||
const props = defineProps({ | ||
open: { type: Boolean, default: false }, | ||
statement: { type: Object as PropType<Statement | null> } | ||
}) | ||
const closePanel = () => { | ||
emit('panel:close') | ||
} | ||
const getCategories = useDBStore().categories.filter( | ||
(category) => props.statement?.categories.includes(category.id) | ||
) | ||
</script> | ||
|
||
<template> | ||
<div v-if="statement" v-show="open" class="AppSidePanel"> | ||
<div class="AppSidePanel__overlay" @click="closePanel"></div> | ||
<div class="AppSidePanel__content"> | ||
<div class="AppSidePanel__header"> | ||
<button @click="closePanel"><MdiClose /></button> | ||
</div> | ||
<h2 class="AppSidePanel__title">{{ statement.description }}</h2> | ||
<div class="mt-3 mb-3"> | ||
<AppCategory v-for="(category, index) in getCategories" :key="index" :category="category" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss"> | ||
@import 'AppSidePanel'; | ||
@media (prefers-color-scheme: dark) { | ||
@import 'AppSidePanel.dark'; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.AppSidePanel { | ||
&__content { | ||
@apply bg-[var(--color-dark)] text-gray-300; | ||
} | ||
&__header { | ||
button { | ||
&:hover { | ||
@apply bg-gray-800; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.AppSidePanel { | ||
@apply h-screen w-full absolute flex z-50 transition-all; | ||
&__overlay { | ||
@apply w-full bg-opacity-90 bg-black flex justify-center items-center; | ||
} | ||
&__content { | ||
@apply w-3/6 bg-white shadow-2xl text-gray-800 p-8; | ||
} | ||
&__header { | ||
button { | ||
@apply border rounded-full p-2 mb-14 text-lg transition-all; | ||
&:hover { | ||
@apply bg-[var(--color-ghostwhite)] text-red-500; | ||
} | ||
} | ||
} | ||
&__title { | ||
@apply text-2xl; | ||
} | ||
&__description { | ||
@apply border mt-5 text-xl text-gray-700 p-5 rounded-lg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"> | ||
<path | ||
fill="currentColor" | ||
d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z" | ||
></path> | ||
</svg> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters