Skip to content

Commit

Permalink
feat: upload file hint
Browse files Browse the repository at this point in the history
  • Loading branch information
mrevanzak committed Jun 30, 2024
1 parent 12e3ab3 commit 989986a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/web/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"documents": {
"title": "Documents",
"upload": "Upload New Document",
"uploadHint": "Only .pdf files are allowed",
"search": "Search document...",
"empty": "No documents found",
"hint": "Drag and drop a document to upload",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"documents": {
"title": "Dokumen",
"upload": "Unggah dokumen baru",
"uploadHint": "Hanya menerima file PDF",
"search": "Cari dokumen...",
"empty": "Tidak ada dokumen",
"hint": "Seret dan lepas dokumen di sini untuk mengunggah",
Expand Down
10 changes: 6 additions & 4 deletions apps/web/src/app/(app)/@admin/documents/dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useRef, useState } from "react";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { api } from "@/trpc/react";
import { Dropzone, PDF_MIME_TYPE } from "@mantine/dropzone";
import { Spinner } from "@nextui-org/react";
import { Spinner, Tooltip } from "@nextui-org/react";
import { useTranslations } from "next-intl";
import { FaUpload, FaXmark } from "react-icons/fa6";
import { useDebounceCallback } from "usehooks-ts";
Expand Down Expand Up @@ -50,9 +50,11 @@ export function DropzoneContainer({
isClearable
onClear={() => searchHandler("")}
/>
<Button color="primary" onClick={() => openRef.current?.()}>
{t("upload")}
</Button>
<Tooltip content={t("uploadHint")} placement="top">
<Button color="primary" onClick={() => openRef.current?.()}>
{t("upload")}
</Button>
</Tooltip>
</div>
<div className="mx-auto w-full">
<Dropzone
Expand Down

0 comments on commit 989986a

Please sign in to comment.