|
1 |
| -import React from "react" |
| 1 | +import React, { type HTMLAttributes } from "react" |
2 | 2 | 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" |
11 | 5 |
|
12 | 6 | import { FAKE_DEMO_ADDRESS } from "../../constants"
|
13 | 7 | import { EthGlyphIcon } from "../../icons"
|
14 | 8 | import { NotificationPopover } from "../../NotificationPopover"
|
15 | 9 |
|
16 |
| -type Web3AppProps = BoxProps & { |
| 10 | +type Web3AppProps = HTMLAttributes<HTMLDivElement> & { |
17 | 11 | displayUrl: string
|
18 | 12 | appName?: string
|
19 | 13 | }
|
20 | 14 | export const Web3App = ({
|
21 | 15 | displayUrl,
|
22 | 16 | appName,
|
23 | 17 | children,
|
24 |
| - ...boxProps |
| 18 | + ...rest |
25 | 19 | }: Web3AppProps) => {
|
26 |
| - const bg = useColorModeValue("#e8e8e8", "#171717") |
27 |
| - |
28 | 20 | 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> |
35 | 25 | <NotificationPopover
|
36 | 26 | title="Example walkthrough"
|
37 | 27 | content="Try out a real Ethereum application when finished here"
|
38 | 28 | >
|
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"> |
42 | 33 | {appName && (
|
43 | 34 | <>
|
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> |
48 | 37 | </>
|
49 | 38 | )}
|
50 |
| - </Box> |
51 |
| - <Icon as={GrMenu} sx={{ path: { stroke: "body.base" } }} /> |
52 |
| - </Flex> |
| 39 | + </div> |
| 40 | + <GrMenu className="[&>path]:stroke-body" /> |
| 41 | + </HStack> |
53 | 42 | </NotificationPopover>
|
54 | 43 | {children}
|
55 |
| - </Box> |
| 44 | + </div> |
56 | 45 | )
|
57 | 46 | }
|
0 commit comments