chore: add banner permission

This commit is contained in:
Joel 2025-10-13 11:27:50 +08:00
parent 84b2913cd9
commit 487eac3b91
2 changed files with 11 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import { useImportDSL } from '@/hooks/use-import-dsl'
import DSLConfirmModal from '@/app/components/app/create-from-dsl-modal/dsl-confirm-modal'
import Banner from '../banner'
import Button from '../../base/button'
import { useGlobalPublicStore } from '@/context/global-public-context'
type AppsProps = {
onSuccess?: () => void
@ -38,6 +39,7 @@ const Apps = ({
onSuccess,
}: AppsProps) => {
const { t } = useTranslation()
const { systemFeatures } = useGlobalPublicStore()
const { hasEditPermission } = useContext(ExploreContext)
const allCategoriesEn = t('explore.apps.allCategories', { lng: 'en' })
@ -151,9 +153,11 @@ const Apps = ({
<div className={cn(
'flex h-full flex-col border-l-[0.5px] border-divider-regular',
)}>
<div className='mt-4 px-12'>
<Banner />
</div>
{systemFeatures.enable_explore_banner && (
<div className='mt-4 px-12'>
<Banner />
</div>
)}
<div className={cn(
'mt-6 flex items-center justify-between px-12',
)}>

View File

@ -59,6 +59,8 @@ export type SystemFeatures = {
allow_email_code_login: boolean
allow_email_password_login: boolean
}
enable_trial_app: boolean
enable_explore_banner: boolean
}
export const defaultSystemFeatures: SystemFeatures = {
@ -98,6 +100,8 @@ export const defaultSystemFeatures: SystemFeatures = {
allow_email_code_login: false,
allow_email_password_login: false,
},
enable_trial_app: false,
enable_explore_banner: false,
}
export enum DatasetAttr {