Skip to content

Commit 8dda113

Browse files
committed
[Dashboard] Remove default <Stack /> (#4828)
@MananTank here's the source code: https://github.com/chakra-ui/chakra-ui/blob/main/packages/react/src/components/stack/stack.tsx <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on replacing `Stack` components with `div` elements styled with `flex` and `gap` classes across various files for a more consistent layout approach in the UI. ### Detailed summary - Replaced `Stack` with `div className="flex flex-col gap-2"` in multiple components. - Updated layout in `airdrop-tab.tsx`, `mint-form.tsx`, `lazy-mint-form.tsx`, `split/page.tsx`, `shared-metadata-form.tsx`, `update-metadata-form.tsx`, `transaction-timeline.tsx`, `NewsletterSection.tsx`, and more. - Enhanced UI consistency and responsiveness. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent a637cab commit 8dda113

File tree

17 files changed

+46
-157
lines changed

17 files changed

+46
-157
lines changed

apps/dashboard/.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module.exports = {
6060
"AspectRatio",
6161
"useToast",
6262
"useClipboard",
63+
"Badge",
6364
// also the types
6465
"ButtonProps",
6566
"BadgeProps",
@@ -71,6 +72,7 @@ module.exports = {
7172
"MenuGroupProps",
7273
"MenuItemProps",
7374
"AspectRatioProps",
75+
"BadgeProps",
7476
],
7577
message:
7678
'Use the equivalent component from "tw-components" instead.',

apps/dashboard/src/components/contract-components/published-contract/addresses-modal.tsx

Lines changed: 0 additions & 79 deletions
This file was deleted.

apps/dashboard/src/components/contract-components/published-contract/index.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
usePublishedContractFunctions,
3030
} from "../hooks";
3131
import { PublisherHeader } from "../publisher/publisher-header";
32-
import { AddressesModal } from "./addresses-modal";
3332
import { MarkdownRenderer } from "./markdown-renderer";
3433

3534
interface ExtendedPublishedContract extends PublishedContractWithVersion {
@@ -235,23 +234,6 @@ export const PublishedContract: React.FC<PublishedContractProps> = ({
235234
: "Proxy"}{" "}
236235
Enabled
237236
</Heading>
238-
{implementationAddresses &&
239-
hasImplementationAddresses ? (
240-
<AddressesModal
241-
chainAddressRecord={implementationAddresses}
242-
buttonTitle="Implementations"
243-
modalTitle="Implementation Addresses"
244-
/>
245-
) : null}
246-
{factoryAddresses &&
247-
hasFactoryAddresses &&
248-
publishedContract?.isDeployableViaFactory ? (
249-
<AddressesModal
250-
chainAddressRecord={factoryAddresses}
251-
buttonTitle="Factories"
252-
modalTitle="Factory Addresses"
253-
/>
254-
) : null}
255237
</Flex>
256238
</Flex>
257239
</ListItem>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ const ModalBodyInputData = ({
316316
<FormControl>
317317
<FormLabel>Processed Data</FormLabel>
318318

319-
<Stack>
319+
<div className="flex flex-col gap-2">
320320
<Checkbox
321321
{...form.register("processEventLogs")}
322322
checked={form.getValues("processEventLogs")}
@@ -346,7 +346,7 @@ const ModalBodyInputData = ({
346346
}
347347
}}
348348
>
349-
<Stack>
349+
<div className="flex flex-col gap-2">
350350
<Radio value="false">
351351
<Text>All events</Text>
352352
</Radio>
@@ -368,7 +368,7 @@ const ModalBodyInputData = ({
368368
}
369369
/>
370370
</Collapse>
371-
</Stack>
371+
</div>
372372
</RadioGroup>
373373
</Stack>
374374
</Collapse>
@@ -402,7 +402,7 @@ const ModalBodyInputData = ({
402402
}
403403
}}
404404
>
405-
<Stack>
405+
<div className="flex flex-col gap-2">
406406
<Radio value="false">
407407
<Text>All functions</Text>
408408
</Radio>
@@ -424,11 +424,11 @@ const ModalBodyInputData = ({
424424
}
425425
/>
426426
</Collapse>
427-
</Stack>
427+
</div>
428428
</RadioGroup>
429429
</Stack>
430430
</Collapse>
431-
</Stack>
431+
</div>
432432
</FormControl>
433433
</Stack>
434434
</ModalBody>

apps/dashboard/src/components/engine/engine-instances-table.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
useEngineRemoveCloudHosted,
2222
useEngineRemoveFromDashboard,
2323
} from "@3rdweb-sdk/react/hooks/useEngine";
24-
import { FormControl, Radio, RadioGroup, Stack } from "@chakra-ui/react";
24+
import { FormControl, Radio, RadioGroup } from "@chakra-ui/react";
2525
import { DialogDescription } from "@radix-ui/react-dialog";
2626
import { createColumnHelper } from "@tanstack/react-table";
2727
import { TWTable } from "components/shared/TWTable";
@@ -440,7 +440,7 @@ function CancelSubscriptionModalContent(props: {
440440
Please share any feedback to help us improve
441441
</FormLabel>
442442
<RadioGroup>
443-
<Stack>
443+
<div className="flex flex-col gap-2">
444444
<Radio
445445
value="USING_SELF_HOSTED"
446446
{...form.register("reason", { required: true })}
@@ -465,7 +465,7 @@ function CancelSubscriptionModalContent(props: {
465465
>
466466
<span className="text-sm"> Other </span>
467467
</Radio>
468-
</Stack>
468+
</div>
469469
</RadioGroup>
470470
</FormControl>
471471

apps/dashboard/src/components/engine/overview/transaction-timeline.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ export const TransactionTimeline = ({
137137
<StepStatus complete={<FiCheck />} active={<FiCheck />} />
138138
</StepIndicator>
139139
<Flex justify="space-between" w="full" mt={-1}>
140-
<Stack>
140+
<div className="flex flex-col gap-2">
141141
{isFilled ? (
142142
<Text>{step.step}</Text>
143143
) : (
144144
<Text color="gray.600">{step.step}</Text>
145145
)}
146146
{step.cta}
147-
</Stack>
147+
</div>
148148
{step.date && (
149149
<Text fontSize="small">
150150
{prettyPrintTimestamp(step.date, index === 0)}

apps/dashboard/src/components/engine/permissions/add-keypair-button.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
ModalHeader,
1616
ModalOverlay,
1717
Select,
18-
Stack,
1918
Textarea,
2019
useDisclosure,
2120
} from "@chakra-ui/react";
@@ -129,7 +128,7 @@ export const AddKeypairButton: React.FC<AddKeypairButtonProps> = ({
129128
<ModalHeader>Add Public Key</ModalHeader>
130129
<ModalBody as={Flex} flexDir="column" gap={8}>
131130
<FormControl>
132-
<Stack>
131+
<div className="flex flex-col gap-2">
133132
<div className="flex flex-row gap-2">
134133
<Text>Create a private key using:</Text>
135134
<Select
@@ -179,7 +178,7 @@ export const AddKeypairButton: React.FC<AddKeypairButtonProps> = ({
179178
code="cat public.key"
180179
language="solidity"
181180
/>
182-
</Stack>
181+
</div>
183182
</FormControl>
184183

185184
<FormControl isRequired>
@@ -206,14 +205,14 @@ export const AddKeypairButton: React.FC<AddKeypairButtonProps> = ({
206205
</FormControl>
207206

208207
<Alert variant="left-accent">
209-
<Stack>
208+
<div className="flex flex-col gap-2">
210209
<Text>
211210
<strong>Keep your private key secure!</strong>
212211
<br />
213212
Your backend will sign access tokens with this private key
214213
which Engine verifies with this public key.
215214
</Text>
216-
</Stack>
215+
</div>
217216
</Alert>
218217
</ModalBody>
219218

apps/dashboard/src/components/homepage/sections/NewsletterSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ export const NewsletterSection = () => {
4949
>
5050
<Stack direction="row" spacing={5} align="center">
5151
<Icon boxSize={8} color="white" as={MdMarkEmailRead} />
52-
<Stack>
52+
<div className="flex flex-col gap-2">
5353
<Text color="white" size="label.lg">
5454
Sign up for our newsletter
5555
</Text>
5656
<Text>
5757
Join 70,000+ builders and stay up to date with our latest
5858
updates and news.
5959
</Text>
60-
</Stack>
60+
</div>
6161
</Stack>
6262

6363
<form onSubmit={(e) => e.preventDefault()}>

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Fade, SimpleGrid, Stack, useDisclosure } from "@chakra-ui/react";
1+
import { Box, Fade, SimpleGrid, useDisclosure } from "@chakra-ui/react";
22
import { useEffect, useRef, useState } from "react";
33
import { Card, Text } from "tw-components";
44
import { NavCard } from "./NavCard";
@@ -76,14 +76,12 @@ export const HoverMenu: React.FC<HoverMenuProps> = ({
7676
borderRadius="8px"
7777
width={width}
7878
>
79-
<div className="flex flex-row">
80-
<Stack>
81-
<SimpleGrid columns={columns} gap={2}>
82-
{items.map((item) => (
83-
<NavCard key={item.label} {...item} />
84-
))}
85-
</SimpleGrid>
86-
</Stack>
79+
<div className="flex flex-col gap-2">
80+
<SimpleGrid columns={columns} gap={2}>
81+
{items.map((item) => (
82+
<NavCard key={item.label} {...item} />
83+
))}
84+
</SimpleGrid>
8785
</div>
8886
</Card>
8987
</Fade>

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
@@ -109,7 +109,7 @@ const AirdropTab: React.FC<AirdropTabProps> = ({ contract, tokenId }) => {
109109
});
110110
})}
111111
>
112-
<Stack>
112+
<div className="flex flex-col gap-2">
113113
<Stack
114114
spacing={6}
115115
w="100%"
@@ -167,7 +167,7 @@ const AirdropTab: React.FC<AirdropTabProps> = ({ contract, tokenId }) => {
167167
>
168168
Airdrop
169169
</TransactionButton>
170-
</Stack>
170+
</div>
171171
</form>
172172
</Stack>
173173
);

0 commit comments

Comments
 (0)