Browse Source

refactor(gui-v2): replace project type list with antd menu

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2723/head
Pranav C 2 years ago
parent
commit
51c5e4dc81
  1. 1
      packages/nc-gui-v2/components.d.ts
  2. 41
      packages/nc-gui-v2/pages/projects/index.vue

1
packages/nc-gui-v2/components.d.ts vendored

@ -7,7 +7,6 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
'(refactor(gui-v2)': replace project create vuetify menu with antd)
ADropdown: typeof import('ant-design-vue/es')['Dropdown'] ADropdown: typeof import('ant-design-vue/es')['Dropdown']
ALayout: typeof import('ant-design-vue/es')['Layout'] ALayout: typeof import('ant-design-vue/es')['Layout']
ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent'] ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent']

41
packages/nc-gui-v2/pages/projects/index.vue

@ -14,18 +14,19 @@ const navDrawerOptions = [
title: 'My NocoDB', title: 'My NocoDB',
icon: MdiFolderOutline, icon: MdiFolderOutline,
}, },
/* todo: implement the api and bring back the options below
{ {
title: 'Shared With Me', title: "Shared With Me",
icon: MdiAccountGroup, icon: MdiAccountGroup
}, },
{ {
title: 'Recent', title: "Recent",
icon: MdiClockOutline, icon: MdiClockOutline
}, },
{ {
title: 'Starred', title: "Starred",
icon: MdiStar, icon: MdiStar
}, } */
] ]
const route = useRoute() const route = useRoute()
@ -73,25 +74,17 @@ const activePage = $ref(navDrawerOptions[0].title)
</div> </div>
<div class="advance-menu flex-1"> <div class="advance-menu flex-1">
<div class="flex flex-col gap-1" :color="$state.darkMode.value ? 'default' : 'primary'"> <div :color="$state.darkMode.value ? 'default' : 'primary'">
<!-- todo: v-list-item-group doesn't seem to work with vuetify 3 yet ... --> <a-menu class="flex flex-col gap-1" mode="inline" :open-keys="[activePage]">
<v-list-item <a-menu-item v-for="item in navDrawerOptions" :key="item.title" class="flex items-center gap-4 !rounded-r-lg">
v-for="item in navDrawerOptions" <template #icon>
:key="item.title"
class="flex items-center gap-4 !rounded-r-lg"
:value="item.title"
>
<component :is="item.icon" /> <component :is="item.icon" />
</template>
<span <span class="font-semibold">
class="font-semibold"
:class="{
'textColor--text text--lighten-2': item.title !== activePage,
}"
>
{{ item.title }} {{ item.title }}
</span> </span>
</v-list-item> </a-menu-item>
</a-menu>
</div> </div>
</div> </div>
@ -124,7 +117,7 @@ const activePage = $ref(navDrawerOptions[0].title)
</div> </div>
</div> </div>
<v-divider class="!mb-4 lg:(!mb-8)" /> <a-divider class="!mb-4 lg:(!mb-8)" />
<NuxtPage :projects="projects" /> <NuxtPage :projects="projects" />
</v-container> </v-container>

Loading…
Cancel
Save