-
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 #14 from Freelancer-god/feat/roles
Feat/roles
- Loading branch information
Showing
13 changed files
with
1,134 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
29 changes: 29 additions & 0 deletions
29
src/app/dashboard/chihois/_components/upload-chihoi-form.tsx
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,29 @@ | ||
"use client"; | ||
import ImageUpload from "@/components/form/antd-image-upload"; | ||
import ModalCard from "@/components/form/modal-card"; | ||
import { useDeleteChihoi } from "@/services/chihoi-service"; | ||
|
||
export default function UploadChihoiForm({ id }: { id: string }) { | ||
// const { mutate, isPending, isSuccess, isError: isCreateBookError } = useDeleteChihoi(); | ||
|
||
const handleSubmit = (e) => { | ||
e.preventDefault(); | ||
// mutate(id); | ||
}; | ||
|
||
return ( | ||
<ModalCard | ||
formId="upload-chihoi-form" | ||
metadata={{ | ||
title: "Upload ảnh", | ||
buttonLabel: "Upload ảnh", | ||
}} | ||
// onClose={isSuccess} | ||
// isLoading={isPending} | ||
> | ||
<form id="upload-chihoi-form" onSubmit={handleSubmit}> | ||
<ImageUpload onUpload={() => {}} /> | ||
</form> | ||
</ModalCard> | ||
); | ||
} |
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,40 @@ | ||
import { FC } from "react"; | ||
import { InboxOutlined } from "@ant-design/icons"; | ||
import type { UploadProps } from "antd"; | ||
import { message, Upload } from "antd"; | ||
|
||
const { Dragger } = Upload; | ||
|
||
const props: UploadProps = { | ||
name: "file", | ||
multiple: true, | ||
action: "https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload", | ||
onChange(info) { | ||
const { status } = info.file; | ||
if (status !== "uploading") { | ||
console.log(info.file, info.fileList); | ||
} | ||
if (status === "done") { | ||
message.success(`${info.file.name} file uploaded successfully.`); | ||
} else if (status === "error") { | ||
message.error(`${info.file.name} file upload failed.`); | ||
} | ||
}, | ||
onDrop(e) { | ||
console.log("Dropped files", e.dataTransfer.files); | ||
}, | ||
}; | ||
|
||
export default function ImageUpload({ onUpload }: { onUpload: any }) { | ||
return ( | ||
<Dragger {...props}> | ||
<p className="ant-upload-drag-icon"> | ||
<InboxOutlined /> | ||
</p> | ||
<p className="ant-upload-text">Click or drag file to this area to upload</p> | ||
<p className="ant-upload-hint"> | ||
Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files. | ||
</p> | ||
</Dragger> | ||
); | ||
} |
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
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
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