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 Sortable from 'sortablejs'
import { Empty } from 'ant-design-vue'
import GithubButton from 'vue-github-button'
import {
computed,
inject,
@ -402,11 +403,21 @@ function openTableCreateDialog() {
<a-divider class="!my-0" />
<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" />
<GeneralHelpAndSupport class="px-2 text-gray-500 cursor-pointer select-none" />
<DashboardGithubStarButton class="ml-2 py-1" />
<GeneralShareBaseButton
class="color-transition py-1.5 px-2 text-primary font-bold cursor-pointer select-none hover:text-accent"
/>
<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>
</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" />
</a-layout-sider>
</template>
<div :key="$route.fullPath">
<dashboard-settings-modal v-model="dialogOpen" :open-key="openDialogKey" />
<NuxtPage />
<GeneralPreviewAs float />
</div>
</NuxtLayout>

Loading…
Cancel
Save