Skip to content

Commit a7e285a

Browse files
committed
[Dashboard] Remove react-icons (5) (#4904)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on replacing icon imports from `react-icons` with `lucide-react` icons across various components in the dashboard application, enhancing the visual consistency and potentially improving performance. ### Detailed summary - Replaced `FiEye` with `EyeIcon` in `reveal-button.tsx`. - Replaced `FiCopy` with `CopyIcon` in `LatestEvents.tsx`. - Replaced `BsLightningCharge` with `ZapIcon` in `GeneralCta.tsx`. - Replaced `FiCheck` with `CheckIcon` in `address-input.tsx`. - Replaced `FaXTwitter` with `XIcon` and `SiOpensea` with `OpenseaIcon` in `OpCreditsGrantedModal.tsx`. - Replaced `FiX` with `XIcon` and caret icons with `ChevronDownIcon`, `ChevronUpIcon` in `phase.tsx`. - Replaced `FiPlay` with `PlayIcon` and `FaCircleInfo` with `InfoIcon` in `interactive-abi-function.tsx`. - Replaced `FiInfo` with `InfoIcon` in `list-form.tsx`. - Replaced navigation icons in `accounts-table.tsx` with `Chevron` icons from `lucide-react`. - Added `OpenseaIcon` component in `OpenseaIcon.tsx`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 615dd1e commit a7e285a

File tree

10 files changed

+58
-65
lines changed

10 files changed

+58
-65
lines changed

apps/dashboard/src/components/contract-functions/interactive-abi-function.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Divider,
88
Flex,
99
FormControl,
10-
Icon,
1110
Input,
1211
} from "@chakra-ui/react";
1312
import { useMutation } from "@tanstack/react-query";
@@ -16,10 +15,9 @@ import { TransactionButton } from "components/buttons/TransactionButton";
1615
import { SolidityInput } from "contract-ui/components/solidity-inputs";
1716
import { camelToTitle } from "contract-ui/components/solidity-inputs/helpers";
1817
import { replaceIpfsUrl } from "lib/sdk";
18+
import { InfoIcon, PlayIcon } from "lucide-react";
1919
import { useEffect, useId, useMemo, useState } from "react";
2020
import { FormProvider, useFieldArray, useForm } from "react-hook-form";
21-
import { FaCircleInfo } from "react-icons/fa6";
22-
import { FiPlay } from "react-icons/fi";
2321
import { toast } from "sonner";
2422
import {
2523
type ThirdwebContract,
@@ -446,7 +444,7 @@ export const InteractiveAbiFunction: React.FC<InteractiveAbiFunctionProps> = ({
446444
{isView ? (
447445
<Button
448446
isDisabled={!abiFunction}
449-
rightIcon={<Icon as={FiPlay} />}
447+
rightIcon={<PlayIcon className="size-4" />}
450448
colorScheme="primary"
451449
isLoading={readLoading}
452450
onClick={handleContractRead}
@@ -465,7 +463,7 @@ export const InteractiveAbiFunction: React.FC<InteractiveAbiFunctionProps> = ({
465463
>
466464
<ToolTipLabel label="Simulate the transaction to see its potential outcome without actually sending it to the network. This action doesn't cost gas.">
467465
<span className="mr-3">
468-
<FaCircleInfo size={20} />
466+
<InfoIcon className="size-5" />
469467
</span>
470468
</ToolTipLabel>
471469
Simulate
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { SVGProps } from "react";
2+
3+
export const OpenseaIcon = (props: SVGProps<SVGSVGElement>) => {
4+
return (
5+
<svg
6+
role="img"
7+
viewBox="0 0 24 24"
8+
xmlns="http://www.w3.org/2000/svg"
9+
fill="currentColor"
10+
width={24}
11+
height={24}
12+
{...props}
13+
>
14+
<title>OpenSea</title>
15+
<path d="M12 0C5.374 0 0 5.374 0 12s5.374 12 12 12 12-5.374 12-12S18.629 0 12 0ZM5.92 12.403l.051-.081 3.123-4.884a.107.107 0 0 1 .187.014c.52 1.169.972 2.623.76 3.528-.088.372-.335.876-.614 1.342a2.405 2.405 0 0 1-.117.199.106.106 0 0 1-.09.045H6.013a.106.106 0 0 1-.091-.163zm13.914 1.68a.109.109 0 0 1-.065.101c-.243.103-1.07.485-1.414.962-.878 1.222-1.548 2.97-3.048 2.97H9.053a4.019 4.019 0 0 1-4.013-4.028v-.072c0-.058.048-.106.108-.106h3.485c.07 0 .12.063.115.132-.026.226.017.459.125.67.206.42.636.682 1.099.682h1.726v-1.347H9.99a.11.11 0 0 1-.089-.173l.063-.09c.16-.231.391-.586.621-.992.156-.274.308-.566.43-.86.024-.052.043-.107.065-.16.033-.094.067-.182.091-.269a4.57 4.57 0 0 0 .065-.223c.057-.25.081-.514.081-.787 0-.108-.004-.221-.014-.327-.005-.117-.02-.235-.034-.352a3.415 3.415 0 0 0-.048-.312 6.494 6.494 0 0 0-.098-.468l-.014-.06c-.03-.108-.056-.21-.09-.317a11.824 11.824 0 0 0-.328-.972 5.212 5.212 0 0 0-.142-.355c-.072-.178-.146-.339-.213-.49a3.564 3.564 0 0 1-.094-.197 4.658 4.658 0 0 0-.103-.213c-.024-.053-.053-.104-.072-.152l-.211-.388c-.029-.053.019-.118.077-.101l1.32.357h.01l.173.05.192.054.07.019v-.783c0-.379.302-.686.679-.686a.66.66 0 0 1 .477.202.69.69 0 0 1 .2.484V6.65l.141.039c.01.005.022.01.031.017.034.024.084.062.147.11.05.038.103.086.165.137a10.351 10.351 0 0 1 .574.504c.214.199.454.432.684.691.065.074.127.146.192.226.062.079.132.156.19.232.079.104.16.212.235.324.033.053.074.108.105.161.096.142.178.288.257.435.034.067.067.141.096.213.089.197.159.396.202.598a.65.65 0 0 1 .029.132v.01c.014.057.019.12.024.184a2.057 2.057 0 0 1-.106.874c-.031.084-.06.17-.098.254-.075.17-.161.343-.264.502-.034.06-.075.122-.113.182-.043.063-.089.123-.127.18a3.89 3.89 0 0 1-.173.221c-.053.072-.106.144-.166.209-.081.098-.16.19-.245.278-.048.058-.1.118-.156.17-.052.06-.108.113-.156.161-.084.084-.15.147-.208.202l-.137.122a.102.102 0 0 1-.072.03h-1.051v1.346h1.322c.295 0 .576-.104.804-.298.077-.067.415-.36.816-.802a.094.094 0 0 1 .05-.03l3.65-1.057a.108.108 0 0 1 .138.103z" />
16+
</svg>
17+
);
18+
};

apps/dashboard/src/components/onboarding/OpCreditsGrantedModal.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
AccordionPanel,
77
Box,
88
Flex,
9-
Icon,
109
Modal,
1110
ModalBody,
1211
ModalContent,
@@ -16,10 +15,10 @@ import {
1615
SimpleGrid,
1716
} from "@chakra-ui/react";
1817
import { ChakraNextImage } from "components/Image";
18+
import { OpenseaIcon } from "components/icons/brand-icons/OpenseaIcon";
19+
import { XIcon } from "components/icons/brand-icons/XIcon";
1920
import { formatToDollars } from "components/settings/Account/Billing/CreditsButton";
2021
import { useMemo } from "react";
21-
import { FaXTwitter } from "react-icons/fa6";
22-
import { SiOpensea } from "react-icons/si";
2322
import { Card, Heading, Text, TrackedLinkButton } from "tw-components";
2423

2524
interface OpCreditsGrantedModalProps {
@@ -130,7 +129,7 @@ Apply here!`,
130129
category="op-sponsorship"
131130
label="share-on-x"
132131
>
133-
<Icon as={FaXTwitter} boxSize={6} mr={2} />
132+
<XIcon className="mr-2 size-6" />
134133
Post
135134
</TrackedLinkButton>
136135
<TrackedLinkButton
@@ -141,7 +140,7 @@ Apply here!`,
141140
category="op-sponsorship"
142141
label="view-nft"
143142
>
144-
<Icon as={SiOpensea} boxSize={6} mr={2} />
143+
<OpenseaIcon className="mr-2 size-6" />
145144
View NFT
146145
</TrackedLinkButton>
147146
</SimpleGrid>

apps/dashboard/src/components/shared/GeneralCta.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Box, Icon } from "@chakra-ui/react";
21
import { useTrack } from "hooks/analytics/useTrack";
3-
import { BsLightningCharge } from "react-icons/bs";
2+
import { ZapIcon } from "lucide-react";
43
import {
54
type ButtonProps,
65
LinkButton,
@@ -25,13 +24,7 @@ export const GeneralCta: React.FC<GeneralCtaProps> = ({
2524
<LinkButton
2625
role="group"
2726
leftIcon={
28-
<Icon
29-
as={BsLightningCharge}
30-
color="#1D64EF"
31-
transitionDuration="slow"
32-
transitionTimingFunction="easeOut"
33-
_groupHover={{ color: "#E0507A" }}
34-
/>
27+
<ZapIcon className="size-5 text-[#1D64EF] duration-150 ease-out group-hover:text-[#E0507A]" />
3528
}
3629
color="black"
3730
px={size === "lg" ? 20 : 8}
@@ -53,9 +46,7 @@ export const GeneralCta: React.FC<GeneralCtaProps> = ({
5346
href={href}
5447
{...props}
5548
>
56-
<Box as="span" py={0.5}>
57-
{title}
58-
</Box>
49+
<span className="py-0.5">{title}</span>
5950
</LinkButton>
6051
);
6152
};

apps/dashboard/src/contract-ui/components/solidity-inputs/address-input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

3-
import { Box, Flex, Icon, Input, Spinner } from "@chakra-ui/react";
3+
import { Box, Flex, Input, Spinner } from "@chakra-ui/react";
44
import { useEns } from "components/contract-components/hooks";
5+
import { CheckIcon } from "lucide-react";
56
import { useEffect, useMemo, useState } from "react";
6-
import { FiCheck } from "react-icons/fi";
77
import { useActiveAccount } from "thirdweb/react";
88
import { isAddress } from "thirdweb/utils";
99
import { FormHelperText } from "tw-components";
@@ -105,7 +105,7 @@ export const SolidityAddressInput: React.FC<SolidityInputProps> = ({
105105
const helperTextLeft = resolvingEns ? (
106106
<Spinner boxSize={3} mr={1} size="xs" speed="0.6s" />
107107
) : resolvedAddress || ensFound ? (
108-
<Icon boxSize={3} as={FiCheck} color="green.500" />
108+
<CheckIcon className="size-3 text-green-500" />
109109
) : null;
110110

111111
const helperTextRight = resolvingEns ? (

apps/dashboard/src/contract-ui/tabs/accounts/components/accounts-table.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"use client";
22

33
import { useDashboardRouter } from "@/lib/DashboardRouter";
4-
import { Flex, Icon, IconButton, Select, Skeleton } from "@chakra-ui/react";
4+
import { Flex, IconButton, Select, Skeleton } from "@chakra-ui/react";
55
import { createColumnHelper } from "@tanstack/react-table";
66
import { TWTable } from "components/shared/TWTable";
7-
import { useMemo, useState } from "react";
87
import {
9-
MdFirstPage,
10-
MdLastPage,
11-
MdNavigateBefore,
12-
MdNavigateNext,
13-
} from "react-icons/md";
8+
ChevronFirstIcon,
9+
ChevronLastIcon,
10+
ChevronLeftIcon,
11+
ChevronRightIcon,
12+
} from "lucide-react";
13+
import { useMemo, useState } from "react";
1414
import type { ThirdwebContract } from "thirdweb";
1515
import { getAccounts, totalAccounts } from "thirdweb/extensions/erc4337";
1616
import { useReadContract } from "thirdweb/react";
@@ -101,13 +101,13 @@ export const AccountsTable: React.FC<AccountsTableProps> = ({ contract }) => {
101101
<IconButton
102102
isDisabled={totalAccountsQuery.isPending}
103103
aria-label="first page"
104-
icon={<Icon as={MdFirstPage} />}
104+
icon={<ChevronFirstIcon className="size-4" />}
105105
onClick={() => setCurrentPage(0)}
106106
/>
107107
<IconButton
108108
isDisabled={totalAccountsQuery.isPending || !canPreviousPage}
109109
aria-label="previous page"
110-
icon={<Icon as={MdNavigateBefore} />}
110+
icon={<ChevronLeftIcon className="size-4" />}
111111
onClick={() => {
112112
setCurrentPage((curr) => {
113113
if (curr > 0) {
@@ -130,7 +130,7 @@ export const AccountsTable: React.FC<AccountsTableProps> = ({ contract }) => {
130130
<IconButton
131131
isDisabled={totalAccountsQuery.isPending || !canNextPage}
132132
aria-label="next page"
133-
icon={<Icon as={MdNavigateNext} />}
133+
icon={<ChevronRightIcon className="size-4" />}
134134
onClick={() =>
135135
setCurrentPage((curr) => {
136136
if (curr < totalPages - 1) {
@@ -143,7 +143,7 @@ export const AccountsTable: React.FC<AccountsTableProps> = ({ contract }) => {
143143
<IconButton
144144
isDisabled={totalAccountsQuery.isPending || !canNextPage}
145145
aria-label="last page"
146-
icon={<Icon as={MdLastPage} />}
146+
icon={<ChevronLastIcon className="size-4" />}
147147
onClick={() => setCurrentPage(totalPages - 1)}
148148
/>
149149

apps/dashboard/src/contract-ui/tabs/claim-conditions/components/claim-conditions-form/phase.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { AdminOnly } from "@3rdweb-sdk/react/components/roles/admin-only";
2-
import { Flex, Icon, SimpleGrid } from "@chakra-ui/react";
3-
import { FiX } from "react-icons/fi";
4-
import { RxCaretDown, RxCaretUp } from "react-icons/rx";
2+
import { Flex, SimpleGrid } from "@chakra-ui/react";
3+
import { ChevronDownIcon, ChevronUpIcon, XIcon } from "lucide-react";
54
import type { ThirdwebContract } from "thirdweb";
65
import { Badge, Button, Card, Heading, Text } from "tw-components";
76
import { ClaimConditionTypeData, useClaimConditionsFormContext } from ".";
@@ -57,10 +56,11 @@ export const ClaimConditionsPhase: React.FC<ClaimConditionsPhaseProps> = ({
5756
onClick={toggleEditing}
5857
size="sm"
5958
rightIcon={
60-
<Icon
61-
as={field.isEditing ? RxCaretUp : RxCaretDown}
62-
boxSize={5}
63-
/>
59+
field.isEditing ? (
60+
<ChevronUpIcon className="size-4" />
61+
) : (
62+
<ChevronDownIcon className="size-4" />
63+
)
6464
}
6565
>
6666
{field.isEditing ? "Collapse" : isAdmin ? "Edit" : "See Phase"}
@@ -72,7 +72,7 @@ export const ClaimConditionsPhase: React.FC<ClaimConditionsPhaseProps> = ({
7272
isDisabled={isPending}
7373
colorScheme="red"
7474
size="sm"
75-
rightIcon={<Icon as={FiX} />}
75+
rightIcon={<XIcon className="size-4" />}
7676
>
7777
Remove
7878
</Button>

apps/dashboard/src/contract-ui/tabs/listings/components/list-form.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Box,
77
Flex,
88
FormControl,
9-
Icon,
109
Input,
1110
Select,
1211
Spinner,
@@ -21,10 +20,9 @@ import { isAlchemySupported } from "lib/wallet/nfts/alchemy";
2120
import { isMoralisSupported } from "lib/wallet/nfts/moralis";
2221
import { isSimpleHashSupported } from "lib/wallet/nfts/simpleHash";
2322
import type { WalletNFT } from "lib/wallet/nfts/types";
24-
import { CircleAlertIcon } from "lucide-react";
23+
import { CircleAlertIcon, InfoIcon } from "lucide-react";
2524
import { useMemo } from "react";
2625
import { useForm } from "react-hook-form";
27-
import { FiInfo } from "react-icons/fi";
2826
import { toast } from "sonner";
2927
import {
3028
NATIVE_TOKEN_ADDRESS,
@@ -366,12 +364,7 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
366364
{!isSupportedChain ? (
367365
<Flex flexDir="column" gap={4} mb={4}>
368366
<div className="flex flex-row items-center gap-3 rounded-md border border-border border-orange-100 bg-orange-50 p-[10px] dark:border-orange-300 dark:bg-orange-300">
369-
<Icon
370-
as={FiInfo}
371-
color="orange.400"
372-
_dark={{ color: "orange.900" }}
373-
boxSize={6}
374-
/>
367+
<InfoIcon className="size-6 text-orange-400 dark:text-orange-900" />
375368
<Text color="orange.800" _dark={{ color: "orange.900" }}>
376369
This chain is not supported by our NFT API yet, please enter the
377370
contract address of the NFT you want to list.
@@ -462,12 +455,7 @@ export const CreateListingsForm: React.FC<CreateListingsFormProps> = ({
462455
</Flex>
463456
) : nfts && nfts.length === 0 ? (
464457
<div className="flex flex-row items-center gap-3 rounded-md border border-border border-orange-100 bg-orange-50 p-[10px] dark:border-orange-300 dark:bg-orange-300">
465-
<Icon
466-
as={FiInfo}
467-
color="orange.400"
468-
_dark={{ color: "orange.900" }}
469-
boxSize={6}
470-
/>
458+
<InfoIcon className="size-6 text-orange-400 dark:text-orange-900" />
471459
<Text color="orange.800" _dark={{ color: "orange.900" }}>
472460
There are no NFTs owned by this wallet. You need NFTs to create a
473461
listing. You can create NFTs with thirdweb.{" "}

apps/dashboard/src/contract-ui/tabs/nfts/components/reveal-button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client";
22

33
import { MinterOnly } from "@3rdweb-sdk/react/components/roles/minter-only";
4-
import { Icon, useDisclosure } from "@chakra-ui/react";
5-
import { FiEye } from "react-icons/fi";
4+
import { useDisclosure } from "@chakra-ui/react";
5+
import { EyeIcon } from "lucide-react";
66
import type { ThirdwebContract } from "thirdweb";
77
import { getBatchesToReveal } from "thirdweb/extensions/erc721";
88
import { useReadContract } from "thirdweb/react";
@@ -36,7 +36,7 @@ export const NFTRevealButton: React.FC<NFTRevealButtonProps> = ({
3636
</Drawer>
3737
<Button
3838
colorScheme="primary"
39-
leftIcon={<Icon as={FiEye} />}
39+
leftIcon={<EyeIcon className="size-4" />}
4040
onClick={onOpen}
4141
>
4242
Reveal NFTs

apps/dashboard/src/contract-ui/tabs/overview/components/LatestEvents.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ import {
66
Box,
77
ButtonGroup,
88
Flex,
9-
Icon,
109
List,
1110
SimpleGrid,
1211
Spinner,
1312
Tooltip,
1413
} from "@chakra-ui/react";
1514
import { AnimatePresence, motion } from "framer-motion";
1615
import { useClipboard } from "hooks/useClipboard";
16+
import { CopyIcon } from "lucide-react";
1717
import { useState } from "react";
18-
import { FiCopy } from "react-icons/fi";
1918
import { toast } from "sonner";
2019
import type { ThirdwebContract } from "thirdweb";
2120
import {
@@ -179,7 +178,7 @@ const EventsFeedItem: React.FC<EventsFeedItemProps> = ({
179178
toast.info("Transaction hash copied.");
180179
}}
181180
>
182-
<Icon as={FiCopy} boxSize={3} />
181+
<CopyIcon className="size-3" />
183182
</Button>
184183
</Tooltip>
185184
<Text fontFamily="mono" noOfLines={1}>

0 commit comments

Comments
 (0)