Browse Source

refactor(gui-v2): remove unnecessary github button component and add shims

pull/3280/head
braks 2 years ago
parent
commit
7eff54beba
  1. 9
      packages/nc-gui-v2/components/dashboard/GithubStarButton.vue
  2. 21
      packages/nc-gui-v2/components/dashboard/TreeView.vue
  3. 4
      packages/nc-gui-v2/github-star.shims.d.ts
  4. 3
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue

9
packages/nc-gui-v2/components/dashboard/GithubStarButton.vue

@ -1,9 +0,0 @@
<script setup lang="ts">
import GithubButton from 'vue-github-button'
</script>
<template>
<GithubButton href="https://github.com/nocodb/nocodb" data-icon="octicon-star" data-show-count="true" data-size="large"
>Star</GithubButton
>
</template>

21
packages/nc-gui-v2/components/dashboard/TreeView.vue

@ -2,6 +2,7 @@
import type { TableType } from 'nocodb-sdk' import type { TableType } from 'nocodb-sdk'
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import { Empty } from 'ant-design-vue' import { Empty } from 'ant-design-vue'
import GithubButton from 'vue-github-button'
import { import {
computed, computed,
inject, inject,
@ -402,11 +403,21 @@ function openTableCreateDialog() {
<a-divider class="!my-0" /> <a-divider class="!my-0" />
<div class="flex items-start flex-col justify-start px-2 py-3 gap-2"> <div class="flex items-start flex-col justify-start px-2 py-3 gap-2">
<GeneralShareBaseButton class="py-1.5 px-2 text-primary font-bold cursor-pointer select-none" /> <GeneralShareBaseButton
class="color-transition py-1.5 px-2 text-primary font-bold cursor-pointer select-none hover:text-accent"
<GeneralHelpAndSupport class="px-2 text-gray-500 cursor-pointer select-none" /> />
<DashboardGithubStarButton class="ml-2 py-1" /> <GeneralHelpAndSupport class="color-transition px-2 text-gray-500 cursor-pointer select-none hover:text-accent" />
<GithubButton
class="ml-2 py-1"
href="https://github.com/nocodb/nocodb"
data-icon="octicon-star"
data-show-count="true"
data-size="large"
>
Star
</GithubButton>
</div> </div>
</div> </div>
</template> </template>

4
packages/nc-gui-v2/github-star.shims.d.ts vendored

@ -0,0 +1,4 @@
declare module 'vue-github-button' {
import type { Component } from '@vue/runtime-core'
export default Component
}

3
packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue

@ -403,9 +403,12 @@ const onMenuClose = (visible: boolean) => {
<DashboardTreeView v-show="isOpen" /> <DashboardTreeView v-show="isOpen" />
</a-layout-sider> </a-layout-sider>
</template> </template>
<div :key="$route.fullPath"> <div :key="$route.fullPath">
<dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" /> <dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" />
<NuxtPage /> <NuxtPage />
<GeneralPreviewAs float /> <GeneralPreviewAs float />
</div> </div>
</NuxtLayout> </NuxtLayout>

Loading…
Cancel
Save