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:13 +03:00
parent a66f73ef66
commit fde030a152

View File

@ -1,7 +1,7 @@
'use client';
import clsx from 'clsx';
import { AnimatePresence, motion } from 'framer-motion';
import { motion } from 'framer-motion';
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
import { toast } from 'react-toastify';
@ -11,7 +11,7 @@ import { CProps } from '@/components/props';
import MiniButton from '@/components/ui/MiniButton';
import { FolderNode, FolderTree } from '@/models/FolderTree';
import { HelpTopic } from '@/models/miscellaneous';
import { animateSideAppear, animateSideView } from '@/styling/animations';
import { animateSideView } from '@/styling/animations';
import { PARAMETER, prefixes } from '@/utils/constants';
import { information, labelFolderNode } from '@/utils/labels';
@ -102,10 +102,9 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
'cc-scroll-y'
)}
>
<AnimatePresence>
{items.map((item, index) =>
!item.parent || !folded.includes(item.parent) ? (
<motion.div
<div
tabIndex={-1}
key={`${prefixes.folders_list}${index}`}
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` }}
onClick={event => handleClickFolder(event, item)}
initial={{ ...animateSideAppear.initial }}
animate={{ ...animateSideAppear.animate }}
exit={{ ...animateSideAppear.exit }}
>
{item.children.size > 0 ? (
<MiniButton
@ -149,10 +145,9 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
</div>
)}
<div className='self-center'>{labelFolderNode(item)}</div>
</motion.div>
</div>
) : null
)}
</AnimatePresence>
</div>
</motion.div>
);