Skip to content

Commit 56c1aa3

Browse files
committed
[DASH-634] Remove framer-motion package usage
1 parent bdb27e4 commit 56c1aa3

File tree

5 files changed

+14
-100
lines changed

5 files changed

+14
-100
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/events/events-feed.tsx

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
Switch,
2525
Tooltip,
2626
} from "@chakra-ui/react";
27-
import { AnimatePresence, motion } from "framer-motion";
2827
import { useChainSlug } from "hooks/chains/chainSlug";
2928
import { useClipboard } from "hooks/useClipboard";
3029
import { ChevronDownIcon, CircleHelpIcon, CopyIcon } from "lucide-react";
@@ -147,12 +146,7 @@ export const EventsFeed: React.FC<EventsFeedProps> = ({ contract }) => {
147146
</Flex>
148147
</div>
149148
)}
150-
<Accordion
151-
as={AnimatePresence}
152-
initial={false}
153-
allowMultiple
154-
defaultIndex={[]}
155-
>
149+
<Accordion allowMultiple defaultIndex={[]}>
156150
{filteredEvents?.slice(0, 10).map((e) => (
157151
<EventsFeedItem
158152
key={e.transactionHash}
@@ -196,31 +190,7 @@ const EventsFeedItem: React.FC<EventsFeedItemProps> = ({
196190
<SimpleGrid
197191
columns={12}
198192
gap={2}
199-
as={motion.li}
200-
initial={{
201-
y: -30,
202-
opacity: 0,
203-
paddingTop: 0,
204-
paddingBottom: 0,
205-
height: 0,
206-
}}
207-
animate={{
208-
y: 0,
209-
opacity: 1,
210-
height: "auto",
211-
paddingTop: "var(--chakra-space-3)",
212-
paddingBottom: "var(--chakra-space-3)",
213-
transition: { duration: 0.15 },
214-
}}
215-
exit={{
216-
y: 30,
217-
opacity: 0,
218-
paddingTop: 0,
219-
paddingBottom: 0,
220-
height: 0,
221-
transition: { duration: 0.3 },
222-
}}
223-
willChange="opacity, height, paddingTop, paddingBottom"
193+
as="li"
224194
borderBottomWidth="1px"
225195
borderColor="borderColor"
226196
padding={4}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/LatestEvents.tsx

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Spinner,
1414
Tooltip,
1515
} from "@chakra-ui/react";
16-
import { AnimatePresence, motion } from "framer-motion";
1716
import { useClipboard } from "hooks/useClipboard";
1817
import { CopyIcon } from "lucide-react";
1918
import { useState } from "react";
@@ -91,7 +90,7 @@ export const LatestEvents: React.FC<LatestEventsProps> = ({
9190
</Flex>
9291
</div>
9392
) : null}
94-
<AnimatePresence initial={false}>
93+
<div>
9594
{allEvents?.slice(0, 3).map((e) => (
9695
<EventsFeedItem
9796
key={e.transactionHash}
@@ -100,7 +99,7 @@ export const LatestEvents: React.FC<LatestEventsProps> = ({
10099
chainSlug={chainSlug}
101100
/>
102101
))}
103-
</AnimatePresence>
102+
</div>
104103
</List>
105104
</Card>
106105
</Flex>
@@ -126,31 +125,7 @@ const EventsFeedItem: React.FC<EventsFeedItemProps> = ({
126125
<SimpleGrid
127126
columns={9}
128127
gap={2}
129-
as={motion.li}
130-
initial={{
131-
y: -30,
132-
opacity: 0,
133-
paddingTop: 0,
134-
paddingBottom: 0,
135-
height: 0,
136-
}}
137-
animate={{
138-
y: 0,
139-
opacity: 1,
140-
height: "auto",
141-
paddingTop: "var(--chakra-space-3)",
142-
paddingBottom: "var(--chakra-space-3)",
143-
transition: { duration: 0.15 },
144-
}}
145-
exit={{
146-
y: 30,
147-
opacity: 0,
148-
paddingTop: 0,
149-
paddingBottom: 0,
150-
height: 0,
151-
transition: { duration: 0.3 },
152-
}}
153-
willChange="opacity, height, paddingTop, paddingBottom"
128+
as="li"
154129
borderBottomWidth="1px"
155130
borderColor="borderColor"
156131
padding={4}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/PermissionsTable.tsx

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { ToolTipLabel } from "@/components/ui/tooltip";
44
import { Box, Flex, List, SimpleGrid, Tag } from "@chakra-ui/react";
55
import { getAllRoleMembers } from "contract-ui/hooks/permissions";
6-
import { AnimatePresence, motion } from "framer-motion";
76
import { useClipboard } from "hooks/useClipboard";
87
import { CopyIcon } from "lucide-react";
98
import { useMemo } from "react";
@@ -100,11 +99,11 @@ export const PermissionsTable: React.FC<PermissionsTableProps> = ({
10099
</Flex>
101100
</div>
102101
)}
103-
<AnimatePresence initial={false}>
102+
<div>
104103
{members.map((e) => (
105104
<PermissionsItem key={e.member} data={e} />
106105
))}
107-
</AnimatePresence>
106+
</div>
108107
</List>
109108
</Card>
110109
)}
@@ -124,31 +123,7 @@ const PermissionsItem: React.FC<PermissionsItemProps> = ({ data }) => {
124123
<SimpleGrid
125124
columns={9}
126125
gap={2}
127-
as={motion.li}
128-
initial={{
129-
y: -30,
130-
opacity: 0,
131-
paddingTop: 0,
132-
paddingBottom: 0,
133-
height: 0,
134-
}}
135-
animate={{
136-
y: 0,
137-
opacity: 1,
138-
height: "auto",
139-
paddingTop: "var(--chakra-space-3)",
140-
paddingBottom: "var(--chakra-space-3)",
141-
transition: { duration: 0.15 },
142-
}}
143-
exit={{
144-
y: 30,
145-
opacity: 0,
146-
paddingTop: 0,
147-
paddingBottom: 0,
148-
height: 0,
149-
transition: { duration: 0.3 },
150-
}}
151-
willChange="opacity, height, paddingTop, paddingBottom"
126+
as="li"
152127
borderBottomWidth="1px"
153128
borderColor="borderColor"
154129
padding={4}

apps/dashboard/src/components/landing-pages/guide-showcase.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,18 @@ export const LandingGuidesShowcase: React.FC<LandingGuidesShowcaseProps> = ({
5656
justifyContent={guides.length <= 2 ? "center" : undefined}
5757
>
5858
{guides.map(
59-
(
60-
{ title: guideTitle, description: guideDescription, image, link },
61-
idx,
62-
) => (
59+
({
60+
title: guideTitle,
61+
description: guideDescription,
62+
image,
63+
link,
64+
}) => (
6365
<GuideCard
6466
category={category}
6567
label="guide"
6668
trackingProps={{
6769
guide: guideTitle.replaceAll(" ", "_").toLowerCase(),
6870
}}
69-
index={idx}
7071
key={guideTitle}
7172
image={image}
7273
title={guideTitle}

apps/dashboard/src/components/product-pages/common/GuideCard.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Box, Flex } from "@chakra-ui/react";
2-
import { motion } from "framer-motion";
32
import NextImage from "next/image";
43
import {
54
Heading,
@@ -14,15 +13,13 @@ interface GuideCardProps
1413
title: string;
1514
description?: string;
1615
link: string;
17-
index: number;
1816
}
1917

2018
export const GuideCard: React.FC<GuideCardProps> = ({
2119
image,
2220
title,
2321
description,
2422
link,
25-
index,
2623
category,
2724
label,
2825
trackingProps,
@@ -37,10 +34,6 @@ export const GuideCard: React.FC<GuideCardProps> = ({
3734
textDecor="none !important"
3835
>
3936
<Flex
40-
initial={{ opacity: 0, y: -10 }}
41-
animate={{ opacity: 1, y: 0, transition: { delay: index / 20 } }}
42-
exit={{ opacity: 0, y: -10, transition: { delay: index / 20 } }}
43-
as={motion.div}
4437
willChange="opacity"
4538
h="full"
4639
direction="column"

0 commit comments

Comments
 (0)