feat: release Files view (#1236)
This commit is contained in:
@@ -6,7 +6,6 @@ import { usePremiumModal } from '@/Hooks/usePremiumModal'
|
||||
import PreferencesGroup from '../../../PreferencesComponents/PreferencesGroup'
|
||||
import PreferencesSegment from '../../../PreferencesComponents/PreferencesSegment'
|
||||
import LabsFeature from './LabsFeature'
|
||||
import { StorageKey, useLocalStorageItem } from '@/Services/LocalStorage'
|
||||
import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator'
|
||||
|
||||
type ExperimentalFeatureItem = {
|
||||
@@ -25,7 +24,6 @@ type Props = {
|
||||
|
||||
const LabsPane: FunctionComponent<Props> = ({ application }) => {
|
||||
const [experimentalFeatures, setExperimentalFeatures] = useState<ExperimentalFeatureItem[]>([])
|
||||
const [isFilesNavigationEnabled, setFilesNavigation] = useLocalStorageItem(StorageKey.FilesNavigationEnabled)
|
||||
|
||||
const reloadExperimentalFeatures = useCallback(() => {
|
||||
const experimentalFeatures = application.features.getExperimentalFeatures().map((featureIdentifier) => {
|
||||
@@ -47,17 +45,6 @@ const LabsPane: FunctionComponent<Props> = ({ application }) => {
|
||||
|
||||
const premiumModal = usePremiumModal()
|
||||
|
||||
const toggleFilesNavigation = useCallback(() => {
|
||||
const isEntitled = application.features.getFeatureStatus(FeatureIdentifier.Files) === FeatureStatus.Entitled
|
||||
|
||||
if (!isEntitled) {
|
||||
premiumModal.activate('Files navigation')
|
||||
return
|
||||
}
|
||||
|
||||
setFilesNavigation(!isFilesNavigationEnabled)
|
||||
}, [application.features, isFilesNavigationEnabled, premiumModal, setFilesNavigation])
|
||||
|
||||
return (
|
||||
<PreferencesGroup>
|
||||
<PreferencesSegment>
|
||||
@@ -88,13 +75,6 @@ const LabsPane: FunctionComponent<Props> = ({ application }) => {
|
||||
</Fragment>
|
||||
)
|
||||
})}
|
||||
<HorizontalSeparator classes="mt-2.5 mb-3" />
|
||||
<LabsFeature
|
||||
name="Files navigation"
|
||||
description={'Enables a "Files" view which allows for better files navigation. Requires reload.'}
|
||||
toggleFeature={toggleFilesNavigation}
|
||||
isEnabled={!!isFilesNavigationEnabled}
|
||||
/>
|
||||
{experimentalFeatures.length === 0 && (
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user