feat: display folders even without the premium (#826)
This commit is contained in:
@@ -18,7 +18,6 @@ export const RootTagDropZone: React.FC<Props> = observer(
|
||||
({ tagsState, featuresState }) => {
|
||||
const premiumModal = usePremiumModal();
|
||||
const isNativeFoldersEnabled = featuresState.enableNativeFoldersFeature;
|
||||
const hasFolders = featuresState.hasFolders;
|
||||
|
||||
const [{ isOver, canDrop }, dropRef] = useDrop<DropItem, void, DropProps>(
|
||||
() => ({
|
||||
@@ -27,11 +26,6 @@ export const RootTagDropZone: React.FC<Props> = observer(
|
||||
return true;
|
||||
},
|
||||
drop: (item) => {
|
||||
if (!hasFolders) {
|
||||
premiumModal.activate(TAG_FOLDERS_FEATURE_NAME);
|
||||
return;
|
||||
}
|
||||
|
||||
tagsState.assignParent(item.uuid, undefined);
|
||||
},
|
||||
collect: (monitor) => ({
|
||||
@@ -39,10 +33,10 @@ export const RootTagDropZone: React.FC<Props> = observer(
|
||||
canDrop: !!monitor.canDrop(),
|
||||
}),
|
||||
}),
|
||||
[tagsState, hasFolders, premiumModal]
|
||||
[tagsState, premiumModal]
|
||||
);
|
||||
|
||||
if (!isNativeFoldersEnabled || !hasFolders) {
|
||||
if (!isNativeFoldersEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export const TagsListItem: FunctionComponent<Props> = observer(
|
||||
isDragging: !!monitor.isDragging(),
|
||||
}),
|
||||
}),
|
||||
[tag, hasFolders]
|
||||
[tag, isNativeFoldersEnabled]
|
||||
);
|
||||
|
||||
const [{ isOver, canDrop }, dropRef] = useDrop<DropItem, void, DropProps>(
|
||||
@@ -160,7 +160,7 @@ export const TagsListItem: FunctionComponent<Props> = observer(
|
||||
>
|
||||
{!tag.errorDecrypting ? (
|
||||
<div className="tag-info" title={title} ref={dropRef}>
|
||||
{hasFolders && isNativeFoldersEnabled && hasAtLeastOneFolder && (
|
||||
{isNativeFoldersEnabled && hasAtLeastOneFolder && (
|
||||
<div
|
||||
className={`tag-fold ${showChildren ? 'opened' : 'closed'}`}
|
||||
onClick={hasChildren ? toggleChildren : undefined}
|
||||
|
||||
@@ -172,7 +172,7 @@ export class TagsState {
|
||||
}
|
||||
|
||||
getChildren(tag: SNTag): SNTag[] {
|
||||
if (!this.features.hasFolders) {
|
||||
if (!this.features.enableNativeFoldersFeature) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ export class TagsState {
|
||||
}
|
||||
|
||||
get rootTags(): SNTag[] {
|
||||
if (!this.features.hasFolders) {
|
||||
if (!this.features.enableNativeFoldersFeature) {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user