mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
This commit is contained in:
parent
a66f73ef66
commit
fde030a152
|
@ -1,7 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import { CProps } from '@/components/props';
|
||||||
import MiniButton from '@/components/ui/MiniButton';
|
import MiniButton from '@/components/ui/MiniButton';
|
||||||
import { FolderNode, FolderTree } from '@/models/FolderTree';
|
import { FolderNode, FolderTree } from '@/models/FolderTree';
|
||||||
import { HelpTopic } from '@/models/miscellaneous';
|
import { HelpTopic } from '@/models/miscellaneous';
|
||||||
import { animateSideAppear, animateSideView } from '@/styling/animations';
|
import { animateSideView } from '@/styling/animations';
|
||||||
import { PARAMETER, prefixes } from '@/utils/constants';
|
import { PARAMETER, prefixes } from '@/utils/constants';
|
||||||
import { information, labelFolderNode } from '@/utils/labels';
|
import { information, labelFolderNode } from '@/utils/labels';
|
||||||
|
|
||||||
|
@ -102,10 +102,9 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
||||||
'cc-scroll-y'
|
'cc-scroll-y'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<AnimatePresence>
|
|
||||||
{items.map((item, index) =>
|
{items.map((item, index) =>
|
||||||
!item.parent || !folded.includes(item.parent) ? (
|
!item.parent || !folded.includes(item.parent) ? (
|
||||||
<motion.div
|
<div
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
key={`${prefixes.folders_list}${index}`}
|
key={`${prefixes.folders_list}${index}`}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
@ -118,9 +117,6 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
||||||
)}
|
)}
|
||||||
style={{ paddingLeft: `${(item.rank > 5 ? 5 : item.rank) * 0.5 + 0.5}rem` }}
|
style={{ paddingLeft: `${(item.rank > 5 ? 5 : item.rank) * 0.5 + 0.5}rem` }}
|
||||||
onClick={event => handleClickFolder(event, item)}
|
onClick={event => handleClickFolder(event, item)}
|
||||||
initial={{ ...animateSideAppear.initial }}
|
|
||||||
animate={{ ...animateSideAppear.animate }}
|
|
||||||
exit={{ ...animateSideAppear.exit }}
|
|
||||||
>
|
>
|
||||||
{item.children.size > 0 ? (
|
{item.children.size > 0 ? (
|
||||||
<MiniButton
|
<MiniButton
|
||||||
|
@ -149,10 +145,9 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className='self-center'>{labelFolderNode(item)}</div>
|
<div className='self-center'>{labelFolderNode(item)}</div>
|
||||||
</motion.div>
|
</div>
|
||||||
) : null
|
) : null
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user