Skip to content

Commit 63ceb28

Browse files
committed
[Dashboard] Remove <Stack/> (3) (#4831)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on replacing instances of the `Stack` component from Chakra UI with `div` elements styled using Tailwind CSS classes. This change aims to improve layout consistency across various components in the application. ### Detailed summary - Replaced `<Stack>` with `<div className="flex ...">` in multiple components for layout consistency. - Adjusted spacing and alignment properties to match previous `Stack` behavior. - Updated components in `airdrop-tab.tsx`, `select-option.tsx`, `airdrop-upload.tsx`, and others. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 509c798 commit 63ceb28

File tree

14 files changed

+44
-52
lines changed

14 files changed

+44
-52
lines changed

apps/dashboard/src/components/contract-tabs/code/CodeSegment.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ButtonGroup, Flex, Icon, Stack } from "@chakra-ui/react";
1+
import { ButtonGroup, Flex, Icon } from "@chakra-ui/react";
22
import { JavaScriptIcon } from "components/icons/brand-icons/JavaScriptIcon";
33
import { ReactIcon } from "components/icons/brand-icons/ReactIcon";
44
import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon";
@@ -88,7 +88,7 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({
8888
);
8989

9090
return (
91-
<Stack spacing={2}>
91+
<div className="flex flex-col gap-2">
9292
{!hideTabs && (
9393
<Flex justify="space-between" align="flex-end">
9494
<Flex direction="column" gap={4}>
@@ -133,7 +133,7 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({
133133
/>
134134
</>
135135
)}
136-
</Stack>
136+
</div>
137137
);
138138
};
139139

apps/dashboard/src/components/engine/contract-subscription/add-contract-subscription-button.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
Radio,
2424
RadioGroup,
2525
Spinner,
26-
Stack,
2726
type UseDisclosureReturn,
2827
useDisclosure,
2928
} from "@chakra-ui/react";
@@ -537,7 +536,7 @@ const FilterSelector = ({
537536
Cannot resolve the contract definition. Filters are unavailable.
538537
</Text>
539538
) : (
540-
<Stack maxH={300} overflowY="auto">
539+
<div className="flex max-h-[300px] flex-col gap-2 overflow-y-auto">
541540
<CheckboxGroup
542541
value={filter}
543542
onChange={(selected: string[]) => setFilter(selected)}
@@ -548,7 +547,7 @@ const FilterSelector = ({
548547
</Checkbox>
549548
))}
550549
</CheckboxGroup>
551-
</Stack>
550+
</div>
552551
)}
553552
</Card>
554553
);

apps/dashboard/src/components/logo/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cn } from "@/lib/utils";
2-
import { Stack, VisuallyHidden } from "@chakra-ui/react";
2+
import { VisuallyHidden } from "@chakra-ui/react";
33

44
export const IconLogo: React.FC<{ extraClass?: string; color?: string }> = ({
55
color,
@@ -95,7 +95,7 @@ export const Logo: React.FC<ILogoProps> = ({
9595
color = "var(--chakra-colors-wordmark)",
9696
}) => {
9797
return (
98-
<Stack as="h2" align="center" direction="row">
98+
<h2 className="flex flex-row items-center gap-2">
9999
{hideIcon ?? <IconLogo extraClass="w-9 md:w-10 flex-shrink-0" />}
100100
{(hideWordmark && !forceShowWordMark) ?? (
101101
<div
@@ -117,6 +117,6 @@ export const Logo: React.FC<ILogoProps> = ({
117117
</div>
118118
)}
119119
<VisuallyHidden>thirdweb</VisuallyHidden>
120-
</Stack>
120+
</h2>
121121
);
122122
};

apps/dashboard/src/components/product-pages/common/nav/NavCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Stack } from "@chakra-ui/react";
1+
import { Box } from "@chakra-ui/react";
22
import { ChakraNextImage } from "components/Image";
33
import { Text, TrackedLink } from "tw-components";
44
import type { SectionItemProps, SectionProps } from "./types";
@@ -21,7 +21,7 @@ export const NavCard: React.FC<SectionItemProps | SectionProps> = ({
2121
pointerEvents={comingSoon ? "none" : "auto"}
2222
>
2323
<Box _hover={{ bg: "whiteAlpha.50" }} p="8px" borderRadius="md">
24-
<Stack direction="row" align="center" spacing={4}>
24+
<div className="flex flex-row items-center gap-4">
2525
{icon && (
2626
<ChakraNextImage boxSize={7} mb="-4px" src={icon} alt="icon" />
2727
)}
@@ -34,7 +34,7 @@ export const NavCard: React.FC<SectionItemProps | SectionProps> = ({
3434
</Text>
3535
<Text color="whiteAlpha.500">{description}</Text>
3636
</div>
37-
</Stack>
37+
</div>
3838
</Box>
3939
</TrackedLink>
4040
);

apps/dashboard/src/components/product-pages/common/nav/ProductNavCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Stack } from "@chakra-ui/react";
1+
import { Box } from "@chakra-ui/react";
22
import type { StaticImageData } from "next/image";
33
import { Text } from "tw-components";
44

@@ -24,7 +24,7 @@ export const ProductNavCard: React.FC<ProductSectionItemProps> = ({
2424
p={6}
2525
cursor="default"
2626
>
27-
<Stack direction="row" align="center" spacing={3}>
27+
<div className="flex flex-row items-center gap-3">
2828
<div className="flex flex-col">
2929
<Text
3030
fontWeight="bold"
@@ -34,7 +34,7 @@ export const ProductNavCard: React.FC<ProductSectionItemProps> = ({
3434
</Text>
3535
<Text color="whiteAlpha.500">{description}</Text>
3636
</div>
37-
</Stack>
37+
</div>
3838
</Box>
3939
);
4040
};

apps/dashboard/src/components/smart-wallets/SponsorshipPolicies/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
IconButton,
1818
Input,
1919
Select,
20-
Stack,
2120
Switch,
2221
Textarea,
2322
} from "@chakra-ui/react";
@@ -577,7 +576,7 @@ export function AccountAbstractionSettingsPage(
577576
</FormControl>
578577
<FormControl>
579578
<FormLabel size="label.sm">Custom Headers</FormLabel>
580-
<Stack gap={3} alignItems="end">
579+
<div className="flex flex-col items-end gap-3">
581580
{customHeaderFields.fields.map((_, customHeaderIdx) => {
582581
return (
583582
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
@@ -621,7 +620,7 @@ export function AccountAbstractionSettingsPage(
621620
>
622621
Add header
623622
</Button>
624-
</Stack>
623+
</div>
625624
</FormControl>
626625
</div>
627626
)}

apps/dashboard/src/contract-ui/tabs/listings/components/listing-stats.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Skeleton, Stack, Stat, StatLabel, StatNumber } from "@chakra-ui/react";
1+
import { Skeleton, Stat, StatLabel, StatNumber } from "@chakra-ui/react";
22
import { useMemo } from "react";
33
import type { ThirdwebContract } from "thirdweb";
44
import { totalAuctions, totalListings } from "thirdweb/extensions/marketplace";
@@ -79,12 +79,12 @@ export const ListingStatsV3: React.FC<ListingStatsV3Props> = ({
7979
hasEnglishAuctions,
8080
}) => {
8181
return (
82-
<Stack spacing={{ base: 3, md: 6 }} direction="row">
82+
<div className="flex flex-row gap-3 md:gap-6">
8383
{hasDirectListings && hasEnglishAuctions && contract && (
8484
<TotalListingsStat contract={contract} />
8585
)}
8686
{hasDirectListings && <DirectListingsStat contract={contract} />}
8787
{hasEnglishAuctions && <EnglishAuctionsStat contract={contract} />}
88-
</Stack>
88+
</div>
8989
);
9090
};

apps/dashboard/src/contract-ui/tabs/nfts/components/airdrop-tab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const AirdropTab: React.FC<AirdropTabProps> = ({ contract, tokenId }) => {
4747
const addresses = watch("addresses");
4848

4949
return (
50-
<Stack w="full">
50+
<div className="flex w-full flex-col gap-2">
5151
<form
5252
onSubmit={handleSubmit(async (_data) => {
5353
trackEvent({
@@ -169,7 +169,7 @@ const AirdropTab: React.FC<AirdropTabProps> = ({ contract, tokenId }) => {
169169
</TransactionButton>
170170
</div>
171171
</form>
172-
</Stack>
172+
</div>
173173
);
174174
};
175175
export default AirdropTab;

apps/dashboard/src/contract-ui/tabs/nfts/components/airdrop-upload.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
ListItem,
1111
Portal,
1212
Select,
13-
Stack,
1413
Table,
1514
TableContainer,
1615
Tbody,
@@ -342,12 +341,12 @@ const AirdropTable: React.FC<AirdropTableProps> = ({ data, portalRef }) => {
342341
: "Address couldn't be resolved"
343342
}
344343
>
345-
<Stack direction="row" align="center">
344+
<div className="flex flex-row items-center gap-2">
346345
<Icon as={IoAlertCircleOutline} color="red.500" boxSize={5} />
347346
<Text fontWeight="bold" color="red.500" cursor="default">
348347
{address}
349348
</Text>
350-
</Stack>
349+
</div>
351350
</Tooltip>
352351
</div>
353352
);

apps/dashboard/src/contract-ui/tabs/nfts/components/burn-tab.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormControl, Input, Stack } from "@chakra-ui/react";
1+
import { FormControl, Input } from "@chakra-ui/react";
22
import { TransactionButton } from "components/buttons/TransactionButton";
33
import { useTrack } from "hooks/analytics/useTrack";
44
import { useTxNotifications } from "hooks/useTxNotifications";
@@ -52,7 +52,7 @@ const BurnTab: React.FC<BurnTabProps> = ({ contract, tokenId }) => {
5252
const { mutate, isPending } = useSendAndConfirmTransaction();
5353

5454
return (
55-
<Stack w="full">
55+
<div className="flex w-full flex-col gap-2">
5656
<form
5757
onSubmit={handleSubmit((data) => {
5858
trackEvent({
@@ -96,13 +96,9 @@ const BurnTab: React.FC<BurnTabProps> = ({ contract, tokenId }) => {
9696
});
9797
})}
9898
>
99-
<Stack gap={3}>
99+
<div className="flex flex-col gap-3">
100100
{isErc1155 && (
101-
<Stack
102-
spacing={6}
103-
w="100%"
104-
direction={{ base: "column", md: "row" }}
105-
>
101+
<div className="flex w-full flex-col gap-6 md:flex-row">
106102
<FormControl isRequired={isErc1155} isInvalid={!!errors.amount}>
107103
<FormLabel>Amount</FormLabel>
108104
<Input placeholder="1" {...register("amount")} />
@@ -111,7 +107,7 @@ const BurnTab: React.FC<BurnTabProps> = ({ contract, tokenId }) => {
111107
</FormHelperText>
112108
<FormErrorMessage>{errors.amount?.message}</FormErrorMessage>
113109
</FormControl>
114-
</Stack>
110+
</div>
115111
)}
116112
{isErc721 && (
117113
<Text>
@@ -140,9 +136,9 @@ const BurnTab: React.FC<BurnTabProps> = ({ contract, tokenId }) => {
140136
>
141137
Burn
142138
</TransactionButton>
143-
</Stack>
139+
</div>
144140
</form>
145-
</Stack>
141+
</div>
146142
);
147143
};
148144

0 commit comments

Comments
 (0)