Skip to content

Commit

Permalink
Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 2, 2023
1 parent 3385c03 commit 9bf916b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Breadcrumbs } from "@/components/breadcrumbs";
import { Table } from "@/components/tables/vault";
import { Button } from "@midday/ui/button";
import { Icons } from "@midday/ui/icons";
import { CreateFolderButton } from "@/components/tables/vault/create-folder-button";
import { UploadButton } from "@/components/tables/vault/upload-button";
import { Metadata } from "next";

export const metadata: Metadata = {
Expand All @@ -19,17 +19,8 @@ export default function Vault({ params }) {
<Breadcrumbs folders={params?.folders} />

<div className="flex space-x-2">
<Button variant="outline" disabled={disableActions}>
Upload
</Button>
<Button
variant="outline"
className="w-[32px] h-[32px]"
size="icon"
disabled={disableActions}
>
<Icons.CreateNewFolder />
</Button>
<CreateFolderButton />
<UploadButton disableActions={disableActions} />
</div>
</div>
<Table path={params?.folders?.join("/")} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Button } from "@midday/ui/button";
import { Icons } from "@midday/ui/icons";

export function CreateFolderButton({ disableActions }) {
return (
<Button
variant="outline"
className="w-[32px] h-[32px]"
size="icon"
disabled={disableActions}
>
<Icons.CreateNewFolder />
</Button>
);
}
15 changes: 15 additions & 0 deletions apps/dashboard/src/components/tables/vault/upload-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use client";

import { Button } from "@midday/ui/button";

export function UploadButton({ disableActions }) {
return (
<Button
variant="outline"
disabled={disableActions}
onClick={() => document.getElementById("upload-files")?.click()}
>
Upload
</Button>
);
}
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/tables/vault/upload-zone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function UploadZone({ children }) {
isDragActive && "visible"
)}
>
<input {...getInputProps()} />
<input {...getInputProps()} id="upload-files" />

<p className="text-xs">
Drop your files here, to
Expand Down

0 comments on commit 9bf916b

Please sign in to comment.