|
@@ -4,6 +4,7 @@ import Link from 'next/link'
|
|
|
import { useBoolean } from 'ahooks'
|
|
|
import { useSelectedLayoutSegment } from 'next/navigation'
|
|
|
import { Bars3Icon } from '@heroicons/react/20/solid'
|
|
|
+import { useContextSelector } from 'use-context-selector'
|
|
|
import HeaderBillingBtn from '../billing/header-billing-btn'
|
|
|
import AccountDropdown from './account-dropdown'
|
|
|
import AppNav from './app-nav'
|
|
@@ -14,11 +15,12 @@ import ToolsNav from './tools-nav'
|
|
|
import GithubStar from './github-star'
|
|
|
import LicenseNav from './license-env'
|
|
|
import { WorkspaceProvider } from '@/context/workspace-context'
|
|
|
-import { useAppContext } from '@/context/app-context'
|
|
|
+import AppContext, { useAppContext } from '@/context/app-context'
|
|
|
import LogoSite from '@/app/components/base/logo/logo-site'
|
|
|
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
|
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
|
import { useModalContext } from '@/context/modal-context'
|
|
|
+import { LicenseStatus } from '@/types/feature'
|
|
|
|
|
|
const navClassName = `
|
|
|
flex items-center relative mr-0 sm:mr-3 px-3 h-8 rounded-xl
|
|
@@ -28,7 +30,7 @@ const navClassName = `
|
|
|
|
|
|
const Header = () => {
|
|
|
const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator } = useAppContext()
|
|
|
-
|
|
|
+ const systemFeatures = useContextSelector(AppContext, v => v.systemFeatures)
|
|
|
const selectedSegment = useSelectedLayoutSegment()
|
|
|
const media = useBreakpoints()
|
|
|
const isMobile = media === MediaType.mobile
|
|
@@ -60,7 +62,7 @@ const Header = () => {
|
|
|
<Link href="/apps" className='flex items-center mr-4'>
|
|
|
<LogoSite className='object-contain' />
|
|
|
</Link>
|
|
|
- <GithubStar />
|
|
|
+ {systemFeatures.license.status === LicenseStatus.NONE && <GithubStar />}
|
|
|
</>}
|
|
|
</div>
|
|
|
{isMobile && (
|
|
@@ -68,7 +70,7 @@ const Header = () => {
|
|
|
<Link href="/apps" className='flex items-center mr-4'>
|
|
|
<LogoSite />
|
|
|
</Link>
|
|
|
- <GithubStar />
|
|
|
+ {systemFeatures.license.status === LicenseStatus.NONE && <GithubStar />}
|
|
|
</div>
|
|
|
)}
|
|
|
{!isMobile && (
|