Skip to content

Commit 8ea9420

Browse files
committed
[Dashboard] Remove <Stack /> (1) (#4829)
## 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 with `div` elements styled with Flexbox classes for layout consistency across various components in the application. ### Detailed summary - Replaced `Stack` components with `div` elements using Flexbox for layout in multiple files. - Updated spacing and alignment properties to maintain visual consistency. - Adjusted modal body structures to use Flexbox for better responsiveness. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 8dda113 commit 8ea9420

File tree

12 files changed

+175
-203
lines changed

12 files changed

+175
-203
lines changed

apps/dashboard/src/components/community/CommunityCard.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex, LinkBox, LinkOverlay, Stack } from "@chakra-ui/react";
1+
import { Flex, LinkBox, LinkOverlay } from "@chakra-ui/react";
22
import { ChakraNextImage } from "components/Image";
33
import { Card, Heading, Text } from "tw-components";
44

@@ -34,14 +34,7 @@ export const CommunityCard: React.FC<CommunityCardProps> = ({
3434
_hover={{ textDecor: "none" }}
3535
as={LinkBox}
3636
>
37-
<Stack
38-
align="center"
39-
justify="center"
40-
w="full"
41-
bg="#181818"
42-
borderTopRadius="xl"
43-
h="11.5rem"
44-
>
37+
<div className="flex h-44 w-full flex-col items-center justify-center gap-2 rounded-t-xl bg-[#181818]">
4538
<ChakraNextImage
4639
pointerEvents="none"
4740
alt={title}
@@ -52,7 +45,7 @@ export const CommunityCard: React.FC<CommunityCardProps> = ({
5245
width={90}
5346
height={90}
5447
/>
55-
</Stack>
48+
</div>
5649

5750
<Flex
5851
w="full"

apps/dashboard/src/components/contract-pages/forms/properties.shared.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const PropertiesFormControl = <
6969
}, [fields, append]);
7070

7171
return (
72-
<Stack spacing={4}>
72+
<div className="flex flex-col gap-4">
7373
<Flex justify="space-between" align="center" direction="row">
7474
<FormLabel m={0}>Attributes</FormLabel>
7575
<Button
@@ -93,7 +93,7 @@ export const PropertiesFormControl = <
9393
const isInvalid = !!(keyError || valueError);
9494

9595
return (
96-
<Stack key={field.id} align="center" direction="row">
96+
<div className="flex flex-row items-center gap-2" key={field.id}>
9797
<FormControl
9898
isInvalid={isInvalid}
9999
as={Stack}
@@ -177,10 +177,10 @@ export const PropertiesFormControl = <
177177
size="xs"
178178
icon={<Icon as={FiX} />}
179179
/>
180-
</Stack>
180+
</div>
181181
);
182182
})}
183-
<Stack direction="row">
183+
<div className="flex flex-row gap-2">
184184
<Button
185185
leftIcon={<Icon as={FiPlus} />}
186186
colorScheme="purple"
@@ -192,7 +192,7 @@ export const PropertiesFormControl = <
192192
>
193193
Add Row
194194
</Button>
195-
</Stack>
196-
</Stack>
195+
</div>
196+
</div>
197197
);
198198
};

apps/dashboard/src/components/engine/configuration/webhooks-table.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ModalFooter,
1313
ModalHeader,
1414
ModalOverlay,
15-
Stack,
1615
Tooltip,
1716
useDisclosure,
1817
} from "@chakra-ui/react";
@@ -171,7 +170,7 @@ export const WebhooksTable: React.FC<WebhooksTableProps> = ({
171170
<ModalCloseButton />
172171
<ModalBody>
173172
{webhookToRevoke && (
174-
<Stack gap={4}>
173+
<div className="flex flex-col gap-4">
175174
<Text>Are you sure you want to delete this webook?</Text>
176175
<FormControl>
177176
<FormLabel>Name</FormLabel>
@@ -190,7 +189,7 @@ export const WebhooksTable: React.FC<WebhooksTableProps> = ({
190189
)}
191190
</Text>
192191
</FormControl>
193-
</Stack>
192+
</div>
194193
)}
195194
</ModalBody>
196195

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const ModalBodyInputContract = ({
185185
return (
186186
<>
187187
<ModalBody>
188-
<Stack spacing={4}>
188+
<div className="flex flex-col gap-4">
189189
<Text>
190190
Add a contract subscription to process real-time onchain data.
191191
</Text>
@@ -252,7 +252,7 @@ const ModalBodyInputContract = ({
252252
{form.getFieldState("webhookUrl", form.formState).error?.message}
253253
</FormErrorMessage>
254254
</FormControl>
255-
</Stack>
255+
</div>
256256
</ModalBody>
257257

258258
<ModalFooter>
@@ -304,7 +304,7 @@ const ModalBodyInputData = ({
304304
return (
305305
<>
306306
<ModalBody>
307-
<Stack spacing={4}>
307+
<div className="flex flex-col gap-4">
308308
<Text>
309309
Select the data type to process.
310310
<br />
@@ -334,7 +334,7 @@ const ModalBodyInputData = ({
334334
</Checkbox>
335335
{/* Shows all/specific events if processing event logs */}
336336
<Collapse in={processEventLogsDisclosure.isOpen}>
337-
<Stack px={4}>
337+
<div className="flex flex-col gap-2 px-4">
338338
<RadioGroup
339339
defaultValue="false"
340340
onChange={(val: "false" | "true") => {
@@ -370,7 +370,7 @@ const ModalBodyInputData = ({
370370
</Collapse>
371371
</div>
372372
</RadioGroup>
373-
</Stack>
373+
</div>
374374
</Collapse>
375375

376376
<Checkbox
@@ -390,7 +390,7 @@ const ModalBodyInputData = ({
390390
</Checkbox>
391391
{/* Shows all/specific functions if processing transaction receipts */}
392392
<Collapse in={processTransactionReceiptsDisclosure.isOpen}>
393-
<Stack px={4}>
393+
<div className="flex flex-col gap-2 px-4">
394394
<RadioGroup
395395
defaultValue="false"
396396
onChange={(val: "false" | "true") => {
@@ -426,11 +426,11 @@ const ModalBodyInputData = ({
426426
</Collapse>
427427
</div>
428428
</RadioGroup>
429-
</Stack>
429+
</div>
430430
</Collapse>
431431
</div>
432432
</FormControl>
433-
</Stack>
433+
</div>
434434
</ModalBody>
435435

436436
<ModalFooter as={Flex} gap={3}>

apps/dashboard/src/components/engine/contract-subscription/contract-subscriptions-table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ const RemoveModal = ({
378378
<ModalHeader>Remove Contract Subscription</ModalHeader>
379379
<ModalCloseButton />
380380
<ModalBody>
381-
<Stack spacing={4}>
381+
<div className="flex flex-col gap-4">
382382
<Text>
383383
This action will delete all stored data for this contract
384384
subscription.
@@ -429,7 +429,7 @@ const RemoveModal = ({
429429
)}
430430
</FormControl>
431431
</Card>
432-
</Stack>
432+
</div>
433433
</ModalBody>
434434
<ModalFooter as={Flex} gap={3}>
435435
<Button type="button" onClick={disclosure.onClose} variant="ghost">

apps/dashboard/src/components/engine/create/tier-card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { Button } from "@/components/ui/button";
44
import type { EngineTier } from "@3rdweb-sdk/react/hooks/useEngine";
5-
import { Flex, Spacer, Stack } from "@chakra-ui/react";
5+
import { Flex, Spacer } from "@chakra-ui/react";
66
import { CheckIcon } from "lucide-react";
77

88
interface EngineTierCardConfig {
@@ -97,7 +97,7 @@ export const EngineTierCard = ({
9797
</Flex>
9898

9999
{/* Features */}
100-
<Stack spacing={3}>
100+
<div className="flex flex-col gap-3">
101101
{previousTier && (
102102
<p>
103103
<span className="font-semibold"> All of {previousTier}</span>, plus:
@@ -109,7 +109,7 @@ export const EngineTierCard = ({
109109
<p className="text-muted-foreground text-sm">{feature}</p>
110110
</Flex>
111111
))}
112-
</Stack>
112+
</div>
113113

114114
<Spacer />
115115

apps/dashboard/src/contract-ui/tabs/proposals/page.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import { voteTokenBalances } from "@3rdweb-sdk/react/hooks/useVote";
2-
import {
3-
Divider,
4-
Flex,
5-
Stack,
6-
Stat,
7-
StatLabel,
8-
StatNumber,
9-
} from "@chakra-ui/react";
2+
import { Divider, Flex, Stat, StatLabel, StatNumber } from "@chakra-ui/react";
103
import { useMemo } from "react";
114
import type { ThirdwebContract } from "thirdweb";
125
import * as VoteExt from "thirdweb/extensions/vote";
@@ -51,7 +44,7 @@ export const ContractProposalsPage: React.FC<ProposalsPageProps> = ({
5144
<ProposalButton contract={contract} />
5245
</Flex>
5346
</Flex>
54-
<Stack spacing={4}>
47+
<div className="flex flex-col gap-4">
5548
{proposals.map((proposal) => (
5649
<Proposal
5750
key={proposal.proposalId.toString()}
@@ -61,7 +54,7 @@ export const ContractProposalsPage: React.FC<ProposalsPageProps> = ({
6154
))}
6255
<Divider />
6356
<Heading size="title.sm">Voting Tokens</Heading>
64-
<Stack direction="row">
57+
<div className="flex flex-row gap-2">
6558
{voteTokenBalancesQuery.data?.map((balance) => (
6659
<Card as={Stat} key={balance.address} maxWidth="240px">
6760
<StatLabel>
@@ -72,8 +65,8 @@ export const ContractProposalsPage: React.FC<ProposalsPageProps> = ({
7265
<StatNumber>{balance.balance}</StatNumber>
7366
</Card>
7467
))}
75-
</Stack>
76-
</Stack>
68+
</div>
69+
</div>
7770
</Flex>
7871
);
7972
};

apps/dashboard/src/contract-ui/tabs/shared-components/cancel-tab.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useEVMContractInfo } from "@3rdweb-sdk/react";
2-
import { Stack } from "@chakra-ui/react";
32
import { TransactionButton } from "components/buttons/TransactionButton";
43
import { useTrack } from "hooks/analytics/useTrack";
54
import { useTxNotifications } from "hooks/useTxNotifications";
@@ -29,7 +28,7 @@ export const CancelTab: React.FC<CancelTabProps> = ({
2928
);
3029
const cancelQuery = useSendAndConfirmTransaction();
3130
return (
32-
<Stack pt={3} gap={3}>
31+
<div className="flex flex-col gap-3 pt-3">
3332
{/* maybe some text? */}
3433
<TransactionButton
3534
transactionCount={1}
@@ -67,6 +66,6 @@ export const CancelTab: React.FC<CancelTabProps> = ({
6766
>
6867
Cancel Listing
6968
</TransactionButton>
70-
</Stack>
69+
</div>
7170
);
7271
};

apps/dashboard/src/contract-ui/tabs/split/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Flex,
44
SimpleGrid,
55
Spinner,
6-
Stack,
76
Stat,
87
StatLabel,
98
StatNumber,
@@ -112,7 +111,7 @@ export const ContractSplitPage: React.FC<SplitPageProps> = ({ contract }) => {
112111
/>
113112
</Flex>
114113
</Flex>
115-
<Stack spacing={8}>
114+
<div className="flex flex-col gap-8">
116115
<Flex gap={4} flexDir="column">
117116
<SimpleGrid spacing={{ base: 3, md: 6 }} columns={{ base: 2, md: 4 }}>
118117
<Card as={Stat}>
@@ -209,7 +208,7 @@ export const ContractSplitPage: React.FC<SplitPageProps> = ({ contract }) => {
209208
</Card>
210209
))}
211210
</div>
212-
</Stack>
211+
</div>
213212
</Flex>
214213
);
215214
};

apps/dashboard/src/contract-ui/tabs/tokens/components/mint-button.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
SheetTrigger,
88
} from "@/components/ui/sheet";
99
import { MinterOnly } from "@3rdweb-sdk/react/components/roles/minter-only";
10-
import { FormControl, Input, Stack } from "@chakra-ui/react";
10+
import { FormControl, Input } from "@chakra-ui/react";
1111
import { TransactionButton } from "components/buttons/TransactionButton";
1212
import { useTrack } from "hooks/analytics/useTrack";
1313
import { Plus } from "lucide-react";
@@ -60,10 +60,8 @@ export const TokenMintButton: React.FC<TokenMintButtonProps> = ({
6060
<SheetHeader>
6161
<SheetTitle>Mint additional tokens</SheetTitle>
6262
</SheetHeader>
63-
<Stack
64-
mt={10}
65-
spacing={6}
66-
as="form"
63+
<form
64+
className="mt-10 flex flex-col gap-6"
6765
id={MINT_FORM_ID}
6866
onSubmit={form.handleSubmit((d) => {
6967
if (!address) {
@@ -120,7 +118,7 @@ export const TokenMintButton: React.FC<TokenMintButtonProps> = ({
120118
{form.formState.errors?.amount?.message}
121119
</FormErrorMessage>
122120
</FormControl>
123-
</Stack>
121+
</form>
124122
<SheetFooter className="mt-10">
125123
<TransactionButton
126124
transactionCount={1}

0 commit comments

Comments
 (0)