fix: show files option in linking menu even if not entitled

This commit is contained in:
Mo
2022-11-13 15:10:57 -06:00
parent 2b76d48392
commit f42657fa9e
10 changed files with 216 additions and 183 deletions

View File

@@ -28,6 +28,7 @@ import { useFileDragNDrop } from '../FileDragNDropProvider/FileDragNDropProvider
import { LinkingController } from '@/Controllers/LinkingController'
import DailyContentList from './Daily/DailyContentList'
import { ListableContentItem } from './Types/ListableContentItem'
import { FeatureName } from '@/Controllers/FeatureName'
type Props = {
accountMenuController: AccountMenuController
@@ -123,6 +124,11 @@ const ContentListView: FunctionComponent<Props> = ({
const addNewItem = useCallback(async () => {
if (isFilesSmartView) {
if (!application.entitledToFiles) {
application.showPremiumModal(FeatureName.Files)
return
}
if (StreamingFileReader.available()) {
void filesController.uploadNewFile()
return
@@ -133,7 +139,7 @@ const ContentListView: FunctionComponent<Props> = ({
await createNewNote()
toggleAppPane(AppPaneId.Editor)
}
}, [isFilesSmartView, filesController, createNewNote, toggleAppPane])
}, [isFilesSmartView, filesController, createNewNote, toggleAppPane, application])
useEffect(() => {
/**

View File

@@ -153,7 +153,7 @@ const ContentListHeader = ({
}, [OptionsMenu, AddButton, FolderName])
return (
<div className="section-title-bar-header items-start gap-1 overflow-hidden">
<div className="section-title-bar-header items-start gap-1">
{!isTablet && PhoneAndDesktopLayout}
{isTablet && TabletLayout}
</div>