Remove redundant animation
Some checks are pending
Frontend CI / build (18.x) (push) Waiting to run

This commit is contained in:
IRBorisov 2024-06-20 22:17:01 +03:00
parent b24a3a568b
commit 55f54b97f7

View File

@ -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>
); );