Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/components/overlay.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { useEffect, useState } from "react";
import { LuUpload } from "react-icons/lu";
import {
Box,
Button,
FileUpload,
GridItem,
HStack,
IconButton,
Input,
SimpleGrid,
type UseFileUploadReturn,
Expand Down Expand Up @@ -104,7 +107,15 @@ export default function Overlay({
Examples
</Button>
</Examples>
<ColorModeButton />
<FileUpload.RootProvider value={fileUpload} flex={"0"}>
<FileUpload.HiddenInput />
<FileUpload.Trigger asChild>
<IconButton variant={"surface"} aria-label="upload">
<LuUpload />
</IconButton>
</FileUpload.Trigger>
</FileUpload.RootProvider>
<ColorModeButton variant={"surface"} />
</HStack>
</GridItem>
</SimpleGrid>
Expand Down Expand Up @@ -133,7 +144,7 @@ function HrefInput({
e.preventDefault();
setHref(value);
}}
w={"full"}
flex="1"
>
<Input
bg={"bg.muted/90"}
Expand Down
7 changes: 7 additions & 0 deletions tests/app.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ describe("app", () => {
.toBeVisible();
});

test("has an upload button", async () => {
const app = renderApp();
await expect
.element(app.getByRole("button", { name: "upload" }))
.toBeVisible();
});

test("has a color mode button", async () => {
const app = renderApp();
await expect
Expand Down