Compare commits

..

2 Commits

Author SHA1 Message Date
victorAnumudu b3c2785a4b video new window popout added 2024-05-28 20:47:42 +01:00
ameye ff129480a5 Merge branch 'login-logo-update' of WrenchBoard/Users-Wrench into master 2024-05-28 11:09:38 +00:00
3 changed files with 43 additions and 1 deletions
@@ -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">
@@ -106,6 +122,7 @@ export default function MyUploadedFiles({ uploadedFiles }) {
<a
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
@@ -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>