From 4d89116085ad8faa0b6b6df0d34ec5f539bba50b Mon Sep 17 00:00:00 2001 From: MananTank Date: Tue, 17 Dec 2024 16:41:22 +0000 Subject: [PATCH] [DASH-634] Remove framer-motion package usage (#5773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Note: can't remove the package from package.json because chakra has peer dependency on it --- ## PR-Codex overview This PR focuses on refactoring the presentation of components by removing unnecessary animations and simplifying the structure of several components, specifically in the `GuideCard`, `EventsFeed`, and `PermissionsTable`. ### Detailed summary - Changed `guides.map` to use a more concise arrow function syntax. - Removed `index` prop from `GuideCardProps`. - Replaced `AnimatePresence` wrappers with simple `div` elements in `EventsFeed` and `LatestEvents`. - Simplified animation logic in `EventsFeedItem` and `PermissionsItem` by removing motion properties and replacing them with simple list item (`li`) tags. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../[contractAddress]/events/events-feed.tsx | 34 ++----------------- .../overview/components/LatestEvents.tsx | 31 ++--------------- .../overview/components/PermissionsTable.tsx | 31 ++--------------- .../landing-pages/guide-showcase.tsx | 11 +++--- .../product-pages/common/GuideCard.tsx | 7 ---- 5 files changed, 14 insertions(+), 100 deletions(-) diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx index df418685ec5..89b6d93f4bc 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx @@ -24,7 +24,6 @@ import { Switch, Tooltip, } from "@chakra-ui/react"; -import { AnimatePresence, motion } from "framer-motion"; import { useChainSlug } from "hooks/chains/chainSlug"; import { useClipboard } from "hooks/useClipboard"; import { ChevronDownIcon, CircleHelpIcon, CopyIcon } from "lucide-react"; @@ -147,12 +146,7 @@ export const EventsFeed: React.FC = ({ contract }) => { )} - + {filteredEvents?.slice(0, 10).map((e) => ( = ({ = ({ ) : null} - +
{allEvents?.slice(0, 3).map((e) => ( = ({ chainSlug={chainSlug} /> ))} - +
@@ -126,31 +125,7 @@ const EventsFeedItem: React.FC = ({ = ({ )} - +
{members.map((e) => ( ))} - +
)} @@ -124,31 +123,7 @@ const PermissionsItem: React.FC = ({ data }) => { = ({ justifyContent={guides.length <= 2 ? "center" : undefined} > {guides.map( - ( - { title: guideTitle, description: guideDescription, image, link }, - idx, - ) => ( + ({ + title: guideTitle, + description: guideDescription, + image, + link, + }) => ( = ({ @@ -22,7 +20,6 @@ export const GuideCard: React.FC = ({ title, description, link, - index, category, label, trackingProps, @@ -37,10 +34,6 @@ export const GuideCard: React.FC = ({ textDecor="none !important" >