Skip to content

Commit 6510652

Browse files
authored
fix: re-add upload button (#158)
Closes #157
1 parent 7a458d4 commit 6510652

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/components/overlay.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { useEffect, useState } from "react";
2+
import { LuUpload } from "react-icons/lu";
23
import {
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"}

tests/app.spec.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)