generated from hack4impact-calpoly/nextjs-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from hack4impact-calpoly/24-DocumentUpload-client
feat: Upload component and Client Upload Page #24
- Loading branch information
Showing
6 changed files
with
246 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import DocumentUpload from "@/components/DocumentUpload"; | ||
import { Button } from "@/components/ui/button"; | ||
import { Trash, Download } from "lucide-react"; | ||
|
||
const ClientUploadPage: React.FC = () => { | ||
return ( | ||
<div className="flex flex-col items-center p-8 w-full min-h-[calc(100vh-105px-40px)] bg-white"> | ||
{/* Main Layout */} | ||
<div className="flex w-full min-h-full max-w-5xl gap-5"> | ||
{/* DocumentUpload component + preview (not yet implemented) */} | ||
<div className="w-2/3 min-h-[calc(100vh-105px-40px-120px)] flex justify-center"> | ||
<DocumentUpload /> | ||
</div> | ||
|
||
{/* Checklist Placeholder */} | ||
{/* TODO: Note to review checklist requirements with the nonprofit */} | ||
<div className="w-1/3 border border-gray-300 rounded-lg p-6 bg-gray-50 shadow-md"> | ||
<h2 className="text-lg font-semibold mb-4">Checklist</h2> | ||
<ul className="list-disc pl-5 space-y-2"> | ||
<li className="text-gray-700">Certificate of Insurance</li> | ||
<li className="text-gray-700">Waiver</li> | ||
<li className="text-gray-700">Timeline</li> | ||
<li className="text-gray-700">ID</li> | ||
<li className="text-gray-700">Property Contract</li> | ||
<li className="text-gray-700">Document</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
{/* Buttons */} | ||
{/* TODO: Note to add functionality for the buttons in a later issue */} | ||
<div className="flex justify-center gap-4 mt-6"> | ||
<Button variant="outline" className="bg-[#3A6F8F] text-white hover:bg-[#305a73]" disabled size={"sm"}> | ||
<Trash /> Delete | ||
</Button> | ||
|
||
<Button variant="outline" className="bg-[#3A6F8F] text-white hover:bg-[#305a73]" disabled size={"sm"}> | ||
<Download /> Download | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ClientUploadPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useState } from "react"; | ||
import { FileUploader } from "react-drag-drop-files"; | ||
import { Upload } from "lucide-react"; | ||
|
||
const fileTypes = ["PDF", "JPEG", "PNG", "DOCX", "DOC", "WORD"]; | ||
|
||
const DocumentUpload: React.FC = () => { | ||
const [file, setFile] = useState<File | null>(null); | ||
const [isDragging, setIsDragging] = useState(false); | ||
|
||
const handleChange = (file: File) => { | ||
setFile(file); | ||
}; | ||
|
||
return ( | ||
<FileUploader | ||
handleChange={handleChange} | ||
name="document" | ||
types={fileTypes} | ||
hoverTitle="Drop the file here" | ||
onTypeError={(err: string) => alert(err)} | ||
maxSize={1000} // Limit file size to 1000 MB (can be altered later) | ||
onSizeError={() => alert("File size exceeds the limit!")} | ||
onDraggingStateChange={(dragging: boolean) => setIsDragging(dragging)} | ||
dropMessageStyle={{ | ||
fontSize: "1.5rem", | ||
}} | ||
classes={`relative flex flex-col items-center justify-center w-full h-full border rounded-lg transition-all | ||
${isDragging ? "border-blue-500 bg-blue-100" : "border-gray-300 bg-gray-100 hover:bg-gray-200 shadow-md"}`} | ||
> | ||
<div className="flex flex-col items-center text-black pointer-events-none"> | ||
<Upload size={48} className="mb-2 text-black" /> | ||
<p className="font-medium text-lg">Drag and Drop or Click to Select</p> | ||
<p className="text-base">the desired document to be uploaded</p> | ||
</div> | ||
|
||
{file && ( | ||
<div className="mt-4 text-center"> | ||
<p className="text-lg text-gray-700">Selected File: {file.name}</p> | ||
</div> | ||
)} | ||
</FileUploader> | ||
); | ||
}; | ||
|
||
export default DocumentUpload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function Footer() { | ||
return <div>Footer</div>; | ||
return <div className="h-10">Footer</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters