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 11import { useEffect , useState } from "react" ;
2+ import { LuUpload } from "react-icons/lu" ;
23import {
34 Box ,
45 Button ,
6+ FileUpload ,
57 GridItem ,
68 HStack ,
9+ IconButton ,
710 Input ,
811 SimpleGrid ,
912 type UseFileUploadReturn ,
@@ -104,7 +107,15 @@ export default function Overlay({
104107 Examples
105108 </ Button >
106109 </ 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" } />
108119 </ HStack >
109120 </ GridItem >
110121 </ SimpleGrid >
@@ -133,7 +144,7 @@ function HrefInput({
133144 e . preventDefault ( ) ;
134145 setHref ( value ) ;
135146 } }
136- w = { "full" }
147+ flex = "1"
137148 >
138149 < Input
139150 bg = { "bg.muted/90" }
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ describe("app", () => {
3636 . toBeVisible ( ) ;
3737 } ) ;
3838
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+
3946 test ( "has a color mode button" , async ( ) => {
4047 const app = renderApp ( ) ;
4148 await expect
You can’t perform that action at this time.
0 commit comments