diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 01:01:22 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 01:01:22 +0000 |
| commit | 4495c02c41b95ce6df0c34dbf6ac62f7addae7a3 (patch) | |
| tree | 39ebbc0e3f850bc602d3e90a1ab7bbbe9a6552c3 /pages/category | |
| parent | 9a11e0f4a38297006b89cc7bb2a60734111582e0 (diff) | |
Move selected state out of store and into route
Diffstat (limited to 'pages/category')
| -rw-r--r-- | pages/category/[id].vue | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/pages/category/[id].vue b/pages/category/[id].vue new file mode 100644 index 0000000..66ad26c --- /dev/null +++ b/pages/category/[id].vue @@ -0,0 +1,105 @@ +<script setup lang="ts"> +import { useSessionStore } from '@/stores/session'; +import { stripColorCodes } from '@/lib/util'; +import CategoryOptionsPanel from '@/components/Editor/Category/CategoryOptionsPanel.vue'; +import CategoryChildrenOptionsPanel from '@/components/Editor/Category/CategoryChildrenOptionsPanel.vue'; +import Button from '@/components/Control/Button.vue'; + +definePageMeta({ + layout: 'editor' +}) + +const sessionStore = useSessionStore(); +const route = useRoute(); + +const categoryId = route.params.id as string; + +const categoryName = sessionStore.getCategoryById(categoryId)?.display.name; +</script> + +<template> + <div id="header"> + <span id="path"> + <font-awesome-icon class="icon" :icon="['fas', 'fa-folder']" /> + <span class="title" v-if="categoryName">{{ stripColorCodes(categoryName) }} </span> + <code>({{ categoryId }})</code> + </span> + <span id="controls" class="control-group"> + <Button type="solid" :disabled="true" :icon="['fas', 'fa-save']" :label="'Save'"></Button> + </span> + </div> + + <div id="options-container"> + <CategoryOptionsPanel :categoryId="categoryId" /> + <CategoryChildrenOptionsPanel :categoryId="categoryId" /> + </div> +</template> + +<style scoped> +#header { + padding: 1rem 1rem 0.5rem 1rem; + background-color: var(--color-background); + border-bottom: 1px solid var(--color-border); + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + width: 100%; + height: 55px; + display: flex; + align-items: left; + justify-content: space-between; + gap: 1rem; + + #path { + font-size: 1.2rem; + display: flex; + gap: 0.5rem; + align-items: center; + + .icon { + font-size: 0.8rem; + } + + .chevron { + font-size: 0.8rem; + color: var(--color-text-mute); + } + + .title { + font-weight: 700; + } + + code { + font-size: 0.8rem; + color: var(--color-text-mute); + } + } +} + +.none-selected { + display: flex; + align-items: center; + justify-content: center; + padding: 1rem; + font-size: 1.2rem; + color: var(--color-text-mute); +} + +#pane-container { + width: 100%; + flex-grow: 1; + height: calc(100vh - 73px); + max-height: calc(100vh - 73px); +} + +#options-container { + width: 100%; + display: flex; + gap: 1rem; + padding: 1rem; + overflow: scroll; + max-height: calc(100% - 55px); +} + +header { + border-bottom: 1px solid var(--color-border); +} +</style>
\ No newline at end of file |
