|
|
|
@ -1,6 +1,8 @@ |
|
|
|
|
import React, { Component } from "react"; |
|
|
|
|
|
|
|
|
|
import file from "./images/file.svg"; |
|
|
|
|
|
|
|
|
|
import pause from "./images/pause.svg"; |
|
|
|
|
import axios from "axios"; |
|
|
|
|
|
|
|
|
|
export default class UploadFile extends Component { |
|
|
|
@ -42,28 +44,48 @@ export default class UploadFile extends Component { |
|
|
|
|
const { uploadPercentage } = this.state; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className=" relative bg-white w-full flex flex-col items-center px-4 py-7 rounded-lg border-2 border-dashed border-blue-300 mt-5"> |
|
|
|
|
<div className=" "> |
|
|
|
|
<img src={file} className="" /> |
|
|
|
|
<input |
|
|
|
|
onChange={this.uploadFile} |
|
|
|
|
type="file" |
|
|
|
|
className="opacity-0 absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-20 cursor-pointer" |
|
|
|
|
style={{ top: "39%" }} |
|
|
|
|
name="" |
|
|
|
|
/>{" "} |
|
|
|
|
{uploadPercentage > 0 && ( |
|
|
|
|
<div |
|
|
|
|
className="w-50 bg-red-500 h-2 z-50" |
|
|
|
|
now={uploadPercentage} |
|
|
|
|
label={`${uploadPercentage}%`} |
|
|
|
|
></div> |
|
|
|
|
)} |
|
|
|
|
<div> |
|
|
|
|
{/* ? upload input File */} |
|
|
|
|
<div className="relative bg-white w-full flex flex-col items-center px-4 py-7 rounded-lg border-2 border-dashed border-blue-300 mt-5"> |
|
|
|
|
<div className=" "> |
|
|
|
|
<img src={file} className="" /> |
|
|
|
|
<input |
|
|
|
|
onChange={this.uploadFile} |
|
|
|
|
type="file" |
|
|
|
|
className="opacity-0 absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-20 cursor-pointer" |
|
|
|
|
style={{ top: "39%" }} |
|
|
|
|
name="" |
|
|
|
|
/> |
|
|
|
|
{uploadPercentage > 0 && ( |
|
|
|
|
<div |
|
|
|
|
className="w-50 bg-red-500 h-2 z-50" |
|
|
|
|
now={uploadPercentage} |
|
|
|
|
label={`${uploadPercentage}%`} |
|
|
|
|
></div> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
<p className="text-xs mt-5"> |
|
|
|
|
یک فایل را اینجا بکشید یا از{" "} |
|
|
|
|
<span className="text-blue-300">رایانه خود انتخاب کنید</span> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
{/* upload file progress bar */} |
|
|
|
|
<div className="flex flex-row items-center justify-between border border-blue-500 mt-5 rounded-lg p-2"> |
|
|
|
|
{/* right section */} |
|
|
|
|
<div className="flex flex-col gap-y-2"> |
|
|
|
|
<span className="text-xs text-blue-900">در حال آپلود فایل ...</span> |
|
|
|
|
<span className="text-xs text-blue-900">AdobeXD.zip</span> |
|
|
|
|
</div> |
|
|
|
|
{/* left section */} |
|
|
|
|
<div className="flex flex-row items-center"> |
|
|
|
|
<span className="text-xs">65 درصد</span> |
|
|
|
|
<span className="text-xs">3 دقیقه باقیمانده</span> |
|
|
|
|
{/* pause button */} |
|
|
|
|
<div className="bg-blue-100 bg-opacity-50 p-2 rounded-full cursor-pointer"> |
|
|
|
|
<img src={pause} /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<p className="text-xs mt-5"> |
|
|
|
|
یک فایل را اینجا بکشید یا از{" "} |
|
|
|
|
<span className="text-blue-300">رایانه خود انتخاب کنید</span> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|