Skip to content

Commit d8ef6ee

Browse files
feat(Simulator/screens/Web3App): migrate to Tailwind
1 parent 57388fd commit d8ef6ee

File tree

1 file changed

+19
-30
lines changed
  • src/components/Simulator/screens/ConnectWeb3

1 file changed

+19
-30
lines changed
Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,46 @@
1-
import React from "react"
1+
import React, { type HTMLAttributes } from "react"
22
import { GrMenu } from "react-icons/gr"
3-
import {
4-
Box,
5-
type BoxProps,
6-
Flex,
7-
Icon,
8-
Text,
9-
useColorModeValue,
10-
} from "@chakra-ui/react"
3+
4+
import { HStack } from "@/components/ui/flex"
115

126
import { FAKE_DEMO_ADDRESS } from "../../constants"
137
import { EthGlyphIcon } from "../../icons"
148
import { NotificationPopover } from "../../NotificationPopover"
159

16-
type Web3AppProps = BoxProps & {
10+
type Web3AppProps = HTMLAttributes<HTMLDivElement> & {
1711
displayUrl: string
1812
appName?: string
1913
}
2014
export const Web3App = ({
2115
displayUrl,
2216
appName,
2317
children,
24-
...boxProps
18+
...rest
2519
}: Web3AppProps) => {
26-
const bg = useColorModeValue("#e8e8e8", "#171717")
27-
2820
return (
29-
<Box h="full" w="full" bg="background.highlight" {...boxProps}>
30-
<Box p={1} bg={bg}>
31-
<Text textAlign="center" fontSize="xs" m={0}>
32-
{displayUrl}
33-
</Text>
34-
</Box>
21+
<div className="size-full bg-background-highlight" {...rest}>
22+
<div className="bg-[#e8e8e8] p-1 dark:bg-[#171717]">
23+
<p className="text-center text-xs">{displayUrl}</p>
24+
</div>
3525
<NotificationPopover
3626
title="Example walkthrough"
3727
content="Try out a real Ethereum application when finished here"
3828
>
39-
<Flex p={6} fontSize="4xl" gap={3} alignItems="center">
40-
<Icon as={EthGlyphIcon} />
41-
<Box flex={1} cursor="default">
29+
<HStack className="gap-3 p-6 text-4xl">
30+
{/* TODO: Remove 'size' class when icon is migrated */}
31+
<EthGlyphIcon className="!size-[1em]" />
32+
<div className="flex-1 cursor-default">
4233
{appName && (
4334
<>
44-
<Text fontSize="md" fontWeight="bold">
45-
{appName}
46-
</Text>
47-
<Text fontSize="sm">{FAKE_DEMO_ADDRESS}</Text>
35+
<p className="text-md font-bold">{appName}</p>
36+
<p className="text-sm">{FAKE_DEMO_ADDRESS}</p>
4837
</>
4938
)}
50-
</Box>
51-
<Icon as={GrMenu} sx={{ path: { stroke: "body.base" } }} />
52-
</Flex>
39+
</div>
40+
<GrMenu className="[&>path]:stroke-body" />
41+
</HStack>
5342
</NotificationPopover>
5443
{children}
55-
</Box>
44+
</div>
5645
)
5746
}

0 commit comments

Comments
 (0)