File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { useEffect , useState } from "react" ;
2
+ import { LuUpload } from "react-icons/lu" ;
2
3
import {
3
4
Box ,
4
5
Button ,
6
+ FileUpload ,
5
7
GridItem ,
6
8
HStack ,
9
+ IconButton ,
7
10
Input ,
8
11
SimpleGrid ,
9
12
type UseFileUploadReturn ,
@@ -104,7 +107,15 @@ export default function Overlay({
104
107
Examples
105
108
</ Button >
106
109
</ Examples >
107
- < ColorModeButton />
110
+ < FileUpload . RootProvider value = { fileUpload } flex = { "0" } >
111
+ < FileUpload . HiddenInput />
112
+ < FileUpload . Trigger asChild >
113
+ < IconButton variant = { "surface" } aria-label = "upload" >
114
+ < LuUpload />
115
+ </ IconButton >
116
+ </ FileUpload . Trigger >
117
+ </ FileUpload . RootProvider >
118
+ < ColorModeButton variant = { "surface" } />
108
119
</ HStack >
109
120
</ GridItem >
110
121
</ SimpleGrid >
@@ -133,7 +144,7 @@ function HrefInput({
133
144
e . preventDefault ( ) ;
134
145
setHref ( value ) ;
135
146
} }
136
- w = { "full" }
147
+ flex = "1"
137
148
>
138
149
< Input
139
150
bg = { "bg.muted/90" }
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ describe("app", () => {
36
36
. toBeVisible ( ) ;
37
37
} ) ;
38
38
39
+ test ( "has an upload button" , async ( ) => {
40
+ const app = renderApp ( ) ;
41
+ await expect
42
+ . element ( app . getByRole ( "button" , { name : "upload" } ) )
43
+ . toBeVisible ( ) ;
44
+ } ) ;
45
+
39
46
test ( "has a color mode button" , async ( ) => {
40
47
const app = renderApp ( ) ;
41
48
await expect
You can’t perform that action at this time.
0 commit comments