Skip to content

Commit

Permalink
Remove <Box/> easy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kien-ngo committed Sep 25, 2024
1 parent ae14290 commit 1bb0f00
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const CustomFactory: React.FC<CustomFactoryProps> = ({
</FormControl>
</div>
))}
<Box>
<div>
<Button
type="button"
size="sm"
Expand All @@ -117,7 +117,7 @@ export const CustomFactory: React.FC<CustomFactoryProps> = ({
>
Add Network
</Button>
</Box>
</div>
</Flex>
<Flex flexDir="column" gap={4}>
<Flex flexDir="column" gap={2}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, Icon } from "@chakra-ui/react";
import { Flex, Icon } from "@chakra-ui/react";
import { useEffect } from "react";
import { useFieldArray, useFormContext } from "react-hook-form";
import { FiPlus } from "react-icons/fi";
Expand Down Expand Up @@ -37,7 +37,7 @@ export const ExternalLinksFieldset = () => {
{fields.map((item, index) => (
<ExternalLinksInput key={item.id} remove={remove} index={index} />
))}
<Box>
<div>
<Button
type="button"
size="sm"
Expand All @@ -53,7 +53,7 @@ export const ExternalLinksFieldset = () => {
>
Add Resource
</Button>
</Box>
</div>
</Flex>
</Flex>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export function ContractPublishForm(props: {
gap={6}
>
{fieldsetToShow !== "landing" && (
<Box>
<div>
<IconButton
w="inherit"
variant="ghost"
Expand All @@ -314,7 +314,7 @@ export function ContractPublishForm(props: {
>
Back
</IconButton>
</Box>
</div>
)}
{fieldsetToShow === "landing" && (
<LandingFieldset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const LandingFieldset: React.FC<LandingFieldsetProps> = ({
</Flex>
</Flex>

<Box>
<div>
<Heading size="title.md" mb={2}>
README
</Heading>
Expand Down Expand Up @@ -186,9 +186,9 @@ export const LandingFieldset: React.FC<LandingFieldsetProps> = ({
</TabPanels>
</Tabs>
</FormControl>
</Box>
</div>
<ExternalLinksFieldset />
<Box>
<div>
<Heading size="title.md" mb={2}>
Version information
</Heading>
Expand Down Expand Up @@ -267,8 +267,8 @@ export const LandingFieldset: React.FC<LandingFieldsetProps> = ({
</FormHelperText>
</FormControl>
</Flex>
</Box>
<Box>
</div>
<div>
<Heading size="title.md" mb={2}>
Deployment options
</Heading>
Expand All @@ -294,7 +294,7 @@ export const LandingFieldset: React.FC<LandingFieldsetProps> = ({
width="full"
/>
</Flex>
</Box>
</div>
</Flex>
);
};
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/devRelEvents/DevRelEvent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, Icon, Image } from "@chakra-ui/react";
import { Flex, Icon, Image } from "@chakra-ui/react";
import { useTrack } from "hooks/analytics/useTrack";
import { FiCalendar, FiClock } from "react-icons/fi";
import { Card, Heading, LinkButton, Text } from "tw-components";
Expand Down Expand Up @@ -75,7 +75,7 @@ export const DevRelEvent: React.FC<EventProps> = ({
</Flex>
</Flex>
</Flex>
<Box>
<div>
<LinkButton
href={link}
onClick={() =>
Expand All @@ -92,7 +92,7 @@ export const DevRelEvent: React.FC<EventProps> = ({
>
Register
</LinkButton>
</Box>
</div>
</Flex>
</Card>
);
Expand Down
36 changes: 17 additions & 19 deletions apps/dashboard/src/components/homepage/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,26 +209,24 @@ export const HomePageCodeBlock: React.FC<CodeBlockProps> = ({
as={Code}
h="full"
>
<Box>
<Box>
<Box as="span" display="block" my={1} color="heading">
{tokens.map((line, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
<Box key={i} {...getLineProps({ line })}>
<LineNumbers
lineNumber={i + 1}
lineHeight={chakraTheme.sizes["5"]}
totalLines={tokens.length}
/>
{line.map((token, key) => (
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
<span key={key} {...getTokenProps({ token })} />
))}
</Box>
))}
</Box>
<div>
<Box as="span" display="block" my={1} color="heading">
{tokens.map((line, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
<Box key={i} {...getLineProps({ line })}>
<LineNumbers
lineNumber={i + 1}
lineHeight={chakraTheme.sizes["5"]}
totalLines={tokens.length}
/>
{line.map((token, key) => (
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
<span key={key} {...getTokenProps({ token })} />
))}
</Box>
))}
</Box>
</Box>
</div>
</Box>
)}
</Highlight>
Expand Down
5 changes: 2 additions & 3 deletions apps/dashboard/src/components/homepage/sections/Solutions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Box,
Flex,
Image,
LinkBox,
Expand Down Expand Up @@ -85,7 +84,7 @@ const SolutionCard: React.FC<SolutionCardProps> = ({
py={{ base: 10 }}
flexGrow={1}
>
<Box>
<div>
<Heading
as="h3"
fontSize="24px"
Expand All @@ -106,7 +105,7 @@ const SolutionCard: React.FC<SolutionCardProps> = ({
<Text size="body.lg" lineHeight={1.7} color="whiteAlpha.700">
{description}
</Text>
</Box>
</div>
</Flex>
</Flex>
);
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/onboarding/PlanCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, ListItem, UnorderedList } from "@chakra-ui/react";
import { Flex, ListItem, UnorderedList } from "@chakra-ui/react";
import { Badge, Card, Heading, LinkButton, Text } from "tw-components";
import type { CreditsRecord } from "./ApplyForOpCreditsModal";

Expand All @@ -10,7 +10,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ creditsRecord }) => {
return (
<Card as={Flex} justifyContent="space-between" flexDir="column" gap={2}>
<Flex flexDir="column" gap={2}>
<Box>
<div>
<Badge
borderRadius="full"
size="label.sm"
Expand All @@ -22,7 +22,7 @@ export const PlanCard: React.FC<PlanCardProps> = ({ creditsRecord }) => {
>
{creditsRecord.title}
</Badge>
</Box>
</div>
<Flex flexDir="column" gap={1}>
<Text color="faded">{creditsRecord.upTo ? "Up to" : "\u00A0"}</Text>
<Heading color="bgBlack" size="title.md" fontWeight="extrabold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@ export function AccountAbstractionSettingsPage(
<FormControl>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">Global spend limits</FormLabel>
<Text>
Maximum gas cost (in USD) that you want to sponsor. This
applies for the duration of the billing period (monthly). Once
this limit is reached, your users will have to fund their own
gas costs.
</Text>
</Box>
</div>

<Switch
colorScheme="primary"
Expand Down Expand Up @@ -345,7 +345,7 @@ export function AccountAbstractionSettingsPage(
>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">
Restrict to specific chains
</FormLabel>
Expand All @@ -361,7 +361,7 @@ export function AccountAbstractionSettingsPage(
supported chains.
</TrackedLink>
</Text>
</Box>
</div>

<Switch
colorScheme="primary"
Expand Down Expand Up @@ -401,14 +401,14 @@ export function AccountAbstractionSettingsPage(
>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">
Restrict to specific contract addresses
</FormLabel>
<Text>
Only sponsor transactions for the specified contracts.
</Text>
</Box>
</div>

<Switch
colorScheme="primary"
Expand Down Expand Up @@ -444,15 +444,15 @@ export function AccountAbstractionSettingsPage(
<FormControl>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">
Allowlisted/Blocklisted accounts
</FormLabel>
<Text>
Select either allowlisted or blockedlisted accounts. Disabling
this option will allow all accounts.
</Text>
</Box>
</div>

<Switch
colorScheme="primary"
Expand Down Expand Up @@ -521,7 +521,7 @@ export function AccountAbstractionSettingsPage(
<FormControl>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">Server verifier</FormLabel>
<Text>
Specify your own endpoint that will verify each transaction
Expand All @@ -536,7 +536,7 @@ export function AccountAbstractionSettingsPage(
</TrackedLink>
.
</Text>
</Box>
</div>

<GatedSwitch
upgradeRequired={!dashboardAccountQuery.data.advancedEnabled}
Expand Down Expand Up @@ -636,13 +636,13 @@ export function AccountAbstractionSettingsPage(
>
<Flex flexDir="column" gap={4}>
<div className="flex flex-row items-center justify-between">
<Box>
<div>
<FormLabel pointerEvents="none">Admin accounts</FormLabel>
<Text>
These accounts won&apos;t be subject to any sponsorship rules.
All transactions will be sponsored.
</Text>
</Box>
</div>

<Switch
colorScheme="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export const MiniPlayground: React.FC<{
)}

{/* Web3 Wallets */}
<Box>
<div>
<FormItem label="Web3 Wallets">
<Flex flexWrap="wrap" gap={3}>
{(Object.keys(enabledWallets) as WalletIdSubset[]).map(
Expand Down Expand Up @@ -293,7 +293,7 @@ export const MiniPlayground: React.FC<{
</TrackedLink>
<Icon as={FiChevronRight} w={4} h={4} color="blue.500" />
</Flex>
</Box>
</div>

{/* Social Logins */}
<FormItem label="Email & Social Logins">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, FormControl, Tooltip } from "@chakra-ui/react";
import { Flex, FormControl, Tooltip } from "@chakra-ui/react";
import { AiOutlineInfoCircle } from "react-icons/ai";
import { FormLabel } from "tw-components";

Expand All @@ -23,7 +23,7 @@ export const FormItem: React.FC<{
borderRadius="md"
px={3}
py={2}
label={<Box>{props.description}</Box>}
label={<div>{props.description}</div>}
>
<div>
<AiOutlineInfoCircle className="text-muted-foreground" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const EventsFeed: React.FC<EventsFeedProps> = ({ contract }) => {
))}
</Select>
</Flex>
<Box>
<div>
<FormControl display="flex" alignItems="center">
<FormLabel htmlFor="auto-update" mb="0">
Auto-Update
Expand All @@ -122,7 +122,7 @@ export const EventsFeed: React.FC<EventsFeedProps> = ({ contract }) => {
/>
</LightMode>
</FormControl>
</Box>
</div>
</Flex>
<Card p={0} overflow="hidden">
<SimpleGrid
Expand Down Expand Up @@ -314,9 +314,9 @@ const EventsFeedItem: React.FC<EventsFeedItemProps> = ({
<Text fontFamily="mono" noOfLines={1}>
{transaction.blockNumber}
</Text>
<Box>
<div>
<Icon as={FiChevronDown} />
</Box>
</div>
</Stack>
</Box>
</SimpleGrid>
Expand Down
Loading

0 comments on commit 1bb0f00

Please sign in to comment.