1
- import React , { useEffect , useState } from "react"
1
+ import React , { type HTMLAttributes , useEffect , useState } from "react"
2
2
import { motion } from "framer-motion"
3
3
import { BsTriangle } from "react-icons/bs"
4
4
import { IoEllipsisHorizontalSharp } from "react-icons/io5"
5
5
import { PiMagnifyingGlass } from "react-icons/pi"
6
6
import { TbWorldWww } from "react-icons/tb"
7
- import { Box , Flex , type FlexProps , Icon , Text } from "@chakra-ui/react"
7
+
8
+ import { Flex , HStack } from "@/components/ui/flex"
8
9
9
10
import { BASE_ANIMATION_DELAY_SEC } from "../../constants"
10
11
import { NotificationPopover } from "../../NotificationPopover"
11
12
12
13
import { EXAMPLE_APP_URL } from "./constants"
13
14
14
- type BrowserProps = FlexProps
15
+ type BrowserProps = HTMLAttributes < HTMLDivElement >
15
16
16
17
export const Browser = ( { ...props } : BrowserProps ) => {
17
18
const [ typing , setTyping ] = useState ( false )
@@ -35,67 +36,45 @@ export const Browser = ({ ...props }: BrowserProps) => {
35
36
}
36
37
37
38
return (
38
- < Flex direction = "column" h = " full" bg = " body. light" { ...props } >
39
- < Box bg = "background.highlight" w = " full" px = { 3 } pt = { 9 } pb = { 3 } >
39
+ < Flex className = "h- full flex-col bg- body- light" { ...props } >
40
+ < div className = "w- full bg-background-highlight px-3 pb-3 pt-9" >
40
41
< NotificationPopover
41
42
title = "Example walkthrough"
42
43
content = "Try logging into a real app with your wallet when finished here"
43
44
>
44
- < Flex
45
- bg = "background.base"
46
- borderRadius = "base"
47
- px = { 3 }
48
- py = { 2 }
49
- align = "center"
50
- color = "disabled"
51
- cursor = "default"
52
- >
53
- < Box
54
- borderInlineEnd = "1px"
55
- borderColor = "background.highlight"
56
- flex = { 1 }
57
- >
45
+ < HStack className = "cursor-default gap-0 rounded bg-background px-3 py-2 text-disabled" >
46
+ < div className = "flex-1 border-e border-background-highlight" >
58
47
{ typing ? (
59
- < Text
60
- as = { motion . p }
48
+ < motion . p
49
+ className = "text-body-medium"
61
50
variants = { sentence }
62
51
initial = "hidden"
63
52
animate = "visible"
64
- color = "body.medium"
65
53
>
66
54
{ EXAMPLE_APP_URL . split ( "" ) . map ( ( char , index ) => (
67
55
< motion . span key = { char + "-" + index } variants = { letter } >
68
56
{ char }
69
57
</ motion . span >
70
58
) ) }
71
- </ Text >
59
+ </ motion . p >
72
60
) : (
73
- < Text > Search or enter website</ Text >
61
+ < p > Search or enter website</ p >
74
62
) }
75
- </ Box >
76
- < Icon as = { TbWorldWww } ms = { 3 } />
77
- </ Flex >
63
+ </ div >
64
+ < TbWorldWww className = "ms-3" />
65
+ </ HStack >
78
66
</ NotificationPopover >
79
- </ Box >
67
+ </ div >
80
68
81
- < Flex flex = { 1 } justify = " center" pt = { { base : 20 , md : 24 } } >
82
- < Icon as = { TbWorldWww } fontSize = "8xl" strokeWidth = "1" color = " disabled" />
69
+ < Flex className = "flex-1 justify- center pt-20 md:pt-24" >
70
+ < TbWorldWww className = "stroke-1 text-8xl text- disabled" />
83
71
</ Flex >
84
72
85
- < Flex
86
- bg = "background.highlight"
87
- w = "full"
88
- px = { 3 }
89
- pb = { 9 }
90
- pt = { 4 }
91
- justify = "space-around"
92
- fontSize = "xl"
93
- color = "disabled"
94
- >
95
- < Icon as = { BsTriangle } transform = "rotate(-90deg)" />
96
- < Icon as = { BsTriangle } transform = "rotate(90deg)" />
97
- < Icon as = { PiMagnifyingGlass } />
98
- < Icon as = { IoEllipsisHorizontalSharp } />
73
+ < Flex className = "w-full justify-around bg-background-highlight px-3 pb-9 pt-4 text-xl text-disabled" >
74
+ < BsTriangle className = "-rotate-90" />
75
+ < BsTriangle className = "rotate-90" />
76
+ < PiMagnifyingGlass />
77
+ < IoEllipsisHorizontalSharp />
99
78
</ Flex >
100
79
</ Flex >
101
80
)
0 commit comments