Compare commits

...

6 Commits

5 changed files with 48 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import linkedInLogo from "../../../assets/images/Linkedin.png";
import appleLogo from "../../../assets/images/apple-black.svg";
import facebookLogo from "../../../assets/images/facebook.svg";
import googleLogo from "../../../assets/images/google-logo.svg";
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text_new.png";
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import AuthLayout from "../AuthLayout2";
@@ -5,6 +5,7 @@ import debounce from "../../../hooks/debounce";
import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom";
import AuthLayout from "../AuthLayout2";
import LoadingSpinner from '../../../components/Spinners/LoadingSpinner'
export default function VerifyLink() {
const [email, setEmail] = useState("");
@@ -119,7 +120,14 @@ export default function VerifyLink() {
<>
<AuthLayout slogan="Welcome to WrenchBoard">
{pageLoader ? (
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
<div className='flex flex-col justify-center items-center gap-4'>
<img src={WrenchBoard} alt="wrenchboard" className="h-10 mx-auto" />
<div className='flex flex-col justify-center items-center'>
<LoadingSpinner height='h-40' size='8' />
<p>Loading...</p>
<p>please do not refresh</p>
</div>
</div>
) : (
<div className="w-full">
<div className="mb-12">
@@ -16,6 +16,22 @@ export default function MyUploadedFiles({ uploadedFiles }) {
const handlePagination = (e) => {
handlePagingFunc(e, setCurrentPage);
};
//FUNCTION TO OPEN NEW WINDOW
const openNewWindow = (e, url, width=1000, height=600) => {
e.preventDefault()
var leftPosition, topPosition;
//Allow for borders.
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
//Allow for title and status bars.
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
//Open the window.
window.open(url, "",
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
}
return (
<>
<div className="mb-4 w-full flex justify-end item-center">
@@ -44,7 +60,8 @@ export default function MyUploadedFiles({ uploadedFiles }) {
currentFiles.map((value, idx) => {
let addedDate = value?.added?.split(" ")[0];
let formattedSize = formatFileSize(value?.file_size);
let imageLink = `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
let downloadLink = value.file_type == 'video/mp4' ? `${process.env.REACT_APP_MEDIA_LINK}/myfile/${value.file_uid}` : `${uploadedFiles?.image}${localStorage.getItem('session_token')}/myfile/${value.file_uid}`
return (
<tr
key={value?.file_uid}
@@ -103,8 +120,9 @@ export default function MyUploadedFiles({ uploadedFiles }) {
<td className="text-right py-4 px-2">
<div className="flex justify-center items-center">
<a
href={imageLink}
href={downloadLink}
title="download"
onClick={(e)=> openNewWindow(e, downloadLink)}
// className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
>
<img
+1
View File
@@ -443,6 +443,7 @@ export default function UploadProduct({uploadTypes}) {
// to="/"
onClick={uploadItem}
className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center btn-gradient sm:text-18 text-sm rounded-full text-white"
disabled={uploadTypes.loading || requestStatus.loading}
>
Upload
</button>
@@ -60,6 +60,21 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
})
}
//FUNCTION TO OPEN NEW WINDOW
const openNewWindow = (e, url, width=1000, height=600) => {
e.preventDefault()
var leftPosition, topPosition;
//Allow for borders.
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
//Allow for title and status bars.
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
//Open the window.
window.open(url, "",
"status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
+ leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
+ topPosition + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
}
useEffect(()=>{
apiCall.jobManagerFiles({job_uid:data?.job_uid || data?.origin_job_uid}).then(res => {
setUploadedList({loading: false, data:res.data})
@@ -105,6 +120,7 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
alt='download-link'
className=''
href={downloadLink}
onClick={(e)=> openNewWindow(e, downloadLink)}
>
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
</a>
@@ -148,6 +164,7 @@ export default function AttachFile({data='', fontSize='text-sm', showOnData=fals
alt='download-link'
className=''
href={downloadLink}
onClick={(e)=> openNewWindow(e, downloadLink)}
>
{(item.originalname).toString().length > 30 ? (item.originalname).toString().slice(0, 26) + '..._.' + fileNameExt : (item.originalname).toString()}
</a>