From f70659901c447d7d46aff6a8ecf1f82ecc85c463 Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Sun, 6 Aug 2023 21:15:18 +0100 Subject: [PATCH 01/11] valid pwd text added --- src/components/AuthPages/VerifyPassword/index.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/AuthPages/VerifyPassword/index.jsx b/src/components/AuthPages/VerifyPassword/index.jsx index 72a209e..f628899 100644 --- a/src/components/AuthPages/VerifyPassword/index.jsx +++ b/src/components/AuthPages/VerifyPassword/index.jsx @@ -156,6 +156,11 @@ const VerifyPassword = () => { We'll send an email to confirm reset + +
+

+ Must include a special, numeric, uppercase and lowercase character +

Date: Sun, 6 Aug 2023 23:46:03 +0100 Subject: [PATCH 02/11] updateprofile payload updated --- .../Settings/Tabs/PersonalInfoTab.jsx | 80 ++++++++++++------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/src/components/Settings/Tabs/PersonalInfoTab.jsx b/src/components/Settings/Tabs/PersonalInfoTab.jsx index 096f277..0ee4009 100644 --- a/src/components/Settings/Tabs/PersonalInfoTab.jsx +++ b/src/components/Settings/Tabs/PersonalInfoTab.jsx @@ -1,13 +1,11 @@ import React, { useEffect, useState } from "react"; import { useSelector } from "react-redux"; -import { Link, useNavigate } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import usersService from "../../../services/UsersService"; import Icons from "../../Helpers/Icons"; import InputCom from "../../Helpers/Inputs/InputCom"; import LoadingSpinner from "../../Spinners/LoadingSpinner"; -import { toast } from "react-toastify"; - import { Form, Formik } from "formik"; import * as Yup from "yup"; @@ -69,6 +67,10 @@ export default function PersonalInfoTab({ city: userDetails?.city, email: userDetails?.email, profile: userDetails?.profile_pic, + pref_email: 0, + pref_phone: 0, + promo: false, + online_name: `${userDetails?.firstname} ${userDetails?.lastname}`, }; let [profile, setProfile] = useState({ @@ -90,8 +92,14 @@ export default function PersonalInfoTab({ // there is no profile accommodation on the payload delete values?.profile; + const reqData = { + ...values, + pref_email: Number(values.pref_email?.toString()), + pref_phone: Number(values.pref_phone?.toString()), + }; + apiCall - .updateProfile(values) + .updateProfile(reqData) .then((res) => { // API CALL TO UPDATE USER DETAILS if (res.data.internal_return < 0) { @@ -102,10 +110,14 @@ export default function PersonalInfoTab({ }); return; } - // setRequestState({message: 'Profile update successfully', loading: false, status: true}) - toast.success("Update Successful"); + setRequestState({ + message: "Profile update successfully", + loading: false, + status: true, + }); + // toast.success("Update Successful"); setTimeout(() => { - // navigate("/", { replace: true }); + navigate("/", { replace: true }); window.location.reload(true); }, 1000); }) @@ -148,10 +160,10 @@ export default function PersonalInfoTab({ fieldClass="px-6" label="User Name" type="text" - name="username" - placeholder="" - value={userDetails.username} - disable={true} + name="online_name" + placeholder="Username" + value={props.values.online_name} + inputHandler={props.handleChange} /> @@ -267,13 +279,17 @@ export default function PersonalInfoTab({ Pref. Communication
-
+
Email @@ -283,8 +299,9 @@ export default function PersonalInfoTab({ Phone @@ -296,22 +313,32 @@ export default function PersonalInfoTab({ {/* Allow Promotions */}
-
{/* inputs ends here */} @@ -388,7 +415,6 @@ export default function PersonalInfoTab({ )}
- {/* Date: Mon, 7 Aug 2023 08:10:51 +0100 Subject: [PATCH 03/11] updated payload --- .../Settings/Tabs/PersonalInfoTab.jsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/Settings/Tabs/PersonalInfoTab.jsx b/src/components/Settings/Tabs/PersonalInfoTab.jsx index 0ee4009..96b2435 100644 --- a/src/components/Settings/Tabs/PersonalInfoTab.jsx +++ b/src/components/Settings/Tabs/PersonalInfoTab.jsx @@ -58,8 +58,6 @@ export default function PersonalInfoTab({ let navigate = useNavigate(); - let [togglePromotion, setTogglePromotion] = useState(false); - const initialValues = { firstname: userDetails?.firstname, lastname: userDetails?.lastname, @@ -69,8 +67,8 @@ export default function PersonalInfoTab({ profile: userDetails?.profile_pic, pref_email: 0, pref_phone: 0, - promo: false, - online_name: `${userDetails?.firstname} ${userDetails?.lastname}`, + accept_promo: false, + online_name: userDetails?.username }; let [profile, setProfile] = useState({ @@ -158,7 +156,7 @@ export default function PersonalInfoTab({
+ {/* Online Name */} +
+ + {props.errors.online_name && + props.touched.online_name && ( +

+ {props.errors.online_name} +

+ )} +
{/* Country */}
From aaa5b9e8ff244e23224d4a567f9a52779efe9068 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Aug 2023 06:38:03 -0400 Subject: [PATCH 05/11] Resource Upload My Files --- src/Routers.jsx | 3 +- src/components/Resources/index.jsx | 2 +- .../UploadProduct/ProductUploadField.jsx | 704 +++++++++--------- src/components/UploadProduct/index.jsx | 16 +- 4 files changed, 367 insertions(+), 358 deletions(-) diff --git a/src/Routers.jsx b/src/Routers.jsx index a19d707..32637e2 100644 --- a/src/Routers.jsx +++ b/src/Routers.jsx @@ -121,7 +121,8 @@ export default function Routers() { } /> } /> } /> - } /> + {/*} />*/} + } /> } /> } /> } /> diff --git a/src/components/Resources/index.jsx b/src/components/Resources/index.jsx index 3c75ec0..a3cc697 100644 --- a/src/components/Resources/index.jsx +++ b/src/components/Resources/index.jsx @@ -138,7 +138,7 @@ export default function Resources(props) {
Add My Item diff --git a/src/components/UploadProduct/ProductUploadField.jsx b/src/components/UploadProduct/ProductUploadField.jsx index 4c3921c..e0f9c3f 100644 --- a/src/components/UploadProduct/ProductUploadField.jsx +++ b/src/components/UploadProduct/ProductUploadField.jsx @@ -22,132 +22,134 @@ export default function ProductUploadField({
e.preventDefault()}> -
-

Put on marketplace

-

- Enter price to allow users instantly purchase your NFT -

+ {/*
*/} + {/*

Put on marketplace

*/} + {/*

*/} + {/* Enter price to allow users instantly purchase your NFT*/} + {/*

*/} + + {/*
*/} + {/* cpt("fixed")}*/} + {/* >*/} + {/* */} + {/*
*/} + {/* */} + {/* */} + {/*
*/} + {/*

*/} + {/* Fixed price*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/* {datas.priceType === "fixed" && (*/} + {/*
*/} + {/* )}*/} + {/*
*/} + {/* cpt("bids")}*/} + {/* >*/} + {/* */} + {/*
*/} + {/* */} + {/* */} + {/*
*/} + {/*

*/} + {/* Open for bids*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/* {datas.priceType === "bids" && (*/} + {/*
*/} + {/* )}*/} + {/*
*/} + {/* cpt("auction")}*/} + {/* >*/} + {/* */} + {/*
*/} + {/* */} + {/* */} + {/*
*/} + {/*

*/} + {/* Timed auction*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/* {datas.priceType === "auction" && (*/} + {/*
*/} + {/* )}*/} + {/*
*/} + {/* */} + {/**/} + -
-
cpt("fixed")} - > -
-
-
- -
-

- Fixed price -

-
-
- {datas.priceType === "fixed" && ( -
- )} -
-
cpt("bids")} - > -
-
-
- -
-

- Open for bids -

-
-
- {datas.priceType === "bids" && ( -
- )} -
-
cpt("auction")} - > -
-
-
- -
-

- Timed auction -

-
-
- {datas.priceType === "auction" && ( -
- )} -
-
-

Item Name

@@ -161,19 +163,22 @@ export default function ProductUploadField({ />
-
-

Exter link

-
- -
-
+ + + {/*
*/} + {/*

Exter link

*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} +

Description

@@ -188,219 +193,222 @@ export default function ProductUploadField({
-
-

Instant sale price

-
-
- priceHndlr(e)} - placeholder="enter the price for which the item will be instantly sold" - className="input-field placeholder:text-base text-bese px-6 text-dark-gray dark:text-white w-10/12 h-full bg-[#FAFAFA] dark:bg-[#11131F] focus:ring-0 focus:outline-none" - type="number" - /> -
-
-
- - ETH - - - - - - -
-
-
-
-
-

- Service fee : 1.5% -

-

- You will Receive : - .29 ETH $120.56 -

-
-
-
-

Royalties

-
-
- -
-

- Suggested: 10%, 20%, 30% -

-
-
-
-

- Properties - - (Optional) - -

-
-
-
-
- -
-
- -
-
-
-
-
-
-

Choose collection

-
-
- {/* create collection */} -
-
- - - - - - - Crteate - -
-
- {/* saved collection list */} -
-
-
-
- -
-
- - Name 1 - -
-
-
-
-
-
- -
-
- - Name 2 - -
-
-
-
-
-
- -
-
- - Name 3 - -
-
-
-
-
+ {/*
*/} + {/*

Instant sale price

*/} + {/*
*/} + {/*
*/} + {/* priceHndlr(e)}*/} + {/* placeholder="enter the price for which the item will be instantly sold"*/} + {/* className="input-field placeholder:text-base text-bese px-6 text-dark-gray dark:text-white w-10/12 h-full bg-[#FAFAFA] dark:bg-[#11131F] focus:ring-0 focus:outline-none"*/} + {/* type="number"*/} + {/* />*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/* ETH*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*

*/} + {/* Service fee : 1.5%*/} + {/*

*/} + {/*

*/} + {/* You will Receive :*/} + {/* .29 ETH $120.56*/} + {/*

*/} + {/*
*/} + {/*
*/} + + {/*
*/} + {/*

Royalties

*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*

*/} + {/* Suggested: 10%, 20%, 30%*/} + {/*

*/} + {/*
*/} + {/*
*/} + + {/*
*/} + {/*

*/} + {/* Properties*/} + {/* */} + {/* (Optional)*/} + {/* */} + {/*

*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + + {/*
*/} + {/*

Choose collection

*/} + {/*
*/} + {/*
*/} + {/* /!* create collection *!/*/} + {/*
*/} + {/*
*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* Crteate*/} + {/* */} + {/*
*/} + {/*
*/} + {/* /!* saved collection list *!/*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/* */} + {/* Name 1*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/* */} + {/* Name 2*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/* */} + {/* Name 3*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} {/* unlock purchase */} -
-
-
- - - - -
-
-

- Unlock once purchased -

-

- Unlockable content, only revealed by the owner of the item. -

-
-
-
- -
-
+ {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/*
*/} + {/*
*/} + {/*

*/} + {/* Unlock once purchased*/} + {/*

*/} + {/*

*/} + {/* Unlockable content, only revealed by the owner of the item.*/} + {/*

*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} diff --git a/src/components/UploadProduct/index.jsx b/src/components/UploadProduct/index.jsx index 0d51e4e..7f212c1 100644 --- a/src/components/UploadProduct/index.jsx +++ b/src/components/UploadProduct/index.jsx @@ -301,18 +301,18 @@ export default function UploadProduct() { Cancel - + {/* previewUploadProduct(data)}*/} + {/* type="button"*/} + {/* className="sm:w-[126px] h-[46px] w-[100px] flex justify-center items-center border-gradient sm:text-18 text-sm rounded-full text-back"*/} + {/*>*/} + {/* Preview*/} + {/**/} - Create Now + Upload From 663e3e8bb78ed265af2b97747ab57cefcfa403de Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Aug 2023 08:15:26 -0400 Subject: [PATCH 06/11] fix text --- src/components/UploadProduct/index.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/UploadProduct/index.jsx b/src/components/UploadProduct/index.jsx index 7f212c1..0a11c36 100644 --- a/src/components/UploadProduct/index.jsx +++ b/src/components/UploadProduct/index.jsx @@ -178,11 +178,11 @@ export default function UploadProduct() { {/* section-heading */}

- Image,Video,Audio or 3D Model + Image,Video,Audio or Documents

- File types suppported: JPG, PNG, GIP, SVG, MP4, MP3, WEBM, - OGG, GLB, GLTF. Max Size : 100 MB + File types supported: JPG, PNG, GIP, SVG, MP4, MP3, WEBM, + OGG, GLB, GLTF

@@ -298,7 +298,7 @@ export default function UploadProduct() { > {" "} - Cancel + Return {/* Date: Tue, 8 Aug 2023 08:16:32 -0400 Subject: [PATCH 07/11] Upload new item --- src/components/UploadProduct/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UploadProduct/index.jsx b/src/components/UploadProduct/index.jsx index 0a11c36..31b3d45 100644 --- a/src/components/UploadProduct/index.jsx +++ b/src/components/UploadProduct/index.jsx @@ -167,7 +167,7 @@ export default function UploadProduct() { {/* heading */}

- Create new item + Upload new item

{/** From 4c6952c4b35c09e4e4edea7d5b2f6e78d204c4ed Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Aug 2023 08:23:48 -0400 Subject: [PATCH 08/11] Page format --- src/components/Resources/tabs/CreatedTab.jsx | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/Resources/tabs/CreatedTab.jsx b/src/components/Resources/tabs/CreatedTab.jsx index 0780290..4394e17 100644 --- a/src/components/Resources/tabs/CreatedTab.jsx +++ b/src/components/Resources/tabs/CreatedTab.jsx @@ -18,36 +18,36 @@ export default function CreatedTab({
{/* filer-dropdown */}
-
- - Recently Received - - - - - - -
+ {/*
*/} + {/* */} + {/* Recently Received*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/*
*/}
-
- -
-
- -
+ {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/* */} + {/*
*/}
From e61b2c8f43e253a882c7e314359db2fc65a931ed Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Aug 2023 08:55:12 -0400 Subject: [PATCH 09/11] my files page --- src/components/Resources/index.jsx | 6 +- .../Resources/tabs/MyUploadedFiles.jsx | 267 ++++++++++++++++++ src/components/Resources/tabs/index.js | 2 + 3 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 src/components/Resources/tabs/MyUploadedFiles.jsx diff --git a/src/components/Resources/index.jsx b/src/components/Resources/index.jsx index a3cc697..8752a34 100644 --- a/src/components/Resources/index.jsx +++ b/src/components/Resources/index.jsx @@ -13,9 +13,11 @@ import { CollectionTab, CreatedTab, HiddenProductsTab, + MyUploadedFiles, OnSaleTab, OwnTab, } from "./tabs"; +//import MyUploadedFiles from "./tabs/MyUploadedFiles"; export default function Resources(props) { // console.log("RESOURCES=>", props); @@ -42,9 +44,7 @@ export default function Resources(props) { blog: , onsale: , owned: , - created: ( - - ), + created: , hidden: ( +
+
+

+ My Uploads +

+ +
+
+
+ + + {/* table heading */} + {/**/} + {/* */} + {/* */} + {/* */} + + {/* */} + {/**/} + + + + + + + + + + + + + + + +
*/} + {/* All Product*/} + {/* .
+
+
+ data +
+
+

+ Mullican Computer Joy +

+ + Owned by Xoeyam + +
+
+
+
+ + + + + + + + + + + + + 7473 ETH + +
+
+
+ + + + + + + + + + 6392.99$ + +
+
+ +
+
+
+ data +
+
+

+ Mullican Computer Joy +

+ + Owned by Xoeyam + +
+
+
+
+ + + + + + + + + + + + + 7473 ETH + +
+
+
+ + + + + + + + + + 6392.99$ + +
+
+ +
+
+ + ); +} diff --git a/src/components/Resources/tabs/index.js b/src/components/Resources/tabs/index.js index 8f6ccf1..0a2baf5 100644 --- a/src/components/Resources/tabs/index.js +++ b/src/components/Resources/tabs/index.js @@ -6,6 +6,7 @@ import OnSaleTab from "./OnSaleTab"; import OwnTab from "./OwnTab"; import BlogTab from "./BlogTab"; import QuestionsTab from "./QuestionsTab"; +import MyUploadedFiles from "./MyUploadedFiles"; export { BlogTab, @@ -16,4 +17,5 @@ export { HiddenProductsTab, OnSaleTab, OwnTab, + MyUploadedFiles, }; \ No newline at end of file From 5b39e751198df40c3fd279489518f70d7c71705b Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Tue, 8 Aug 2023 22:06:44 +0100 Subject: [PATCH 10/11] Add item button moved down --- src/components/Resources/index.jsx | 4 +- .../Resources/tabs/MyUploadedFiles.jsx | 11 ++ src/components/UploadProduct/index.jsx | 101 ++++++++++++++++-- 3 files changed, 106 insertions(+), 10 deletions(-) diff --git a/src/components/Resources/index.jsx b/src/components/Resources/index.jsx index 8752a34..42ec779 100644 --- a/src/components/Resources/index.jsx +++ b/src/components/Resources/index.jsx @@ -136,14 +136,14 @@ export default function Resources(props) {
-
+ {/*
Add My Item -
+
*/}
diff --git a/src/components/Resources/tabs/MyUploadedFiles.jsx b/src/components/Resources/tabs/MyUploadedFiles.jsx index bbedb02..53df8d9 100644 --- a/src/components/Resources/tabs/MyUploadedFiles.jsx +++ b/src/components/Resources/tabs/MyUploadedFiles.jsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import dataImage1 from "../../../assets/images/data-table-user-1.png"; import dataImage2 from "../../../assets/images/data-table-user-2.png"; +import { Link } from "react-router-dom"; // import dataImage3 from "../../../assets/images/data-table-user-3.png"; // import dataImage4 from "../../../assets/images/data-table-user-4.png"; // import SelectBox from "../Helpers/SelectBox"; @@ -9,6 +10,15 @@ export default function MyUploadedFiles({ className }) { const filterCategories = ["All Categories", "Explore", "Featured"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); return ( + <> +
+ + Add My Item + +
+ ); } diff --git a/src/components/UploadProduct/index.jsx b/src/components/UploadProduct/index.jsx index 31b3d45..84a1e03 100644 --- a/src/components/UploadProduct/index.jsx +++ b/src/components/UploadProduct/index.jsx @@ -5,8 +5,11 @@ import ModalCom from "../Helpers/ModalCom"; import Layout from "../Partials/Layout"; // import DropFileWidget from "./DropFileWidget"; import ProductUploadField from "./ProductUploadField"; +import LoadingSpinner from "../Spinners/LoadingSpinner"; +import usersService from "../../services/UsersService"; export default function UploadProduct() { + const apiCall = new usersService() // preview modal const [previewProductModal, setPreviewProductModal] = useState(false); // cancelUploadModal @@ -68,10 +71,14 @@ export default function UploadProduct() { }; const fileSelect = useRef(null); const fileRef = useRef(null); - const [selectedFile, setSelectedFile] = useState(""); + const [selectedFile, setSelectedFile] = useState(''); + // const [selectedFile, setSelectedFile] = useState({name: '', size: ''}); const [img, setImg] = useState(null); + const [imgDetails, setImgDetails] = useState('') const changeFile = (e, file) => { if (e) { + setSelectedFile(e.target.files[0].name); + setImgDetails(e?.target?.files[0]) const imgRead = new FileReader(); imgRead.onload = (event) => { setImg(event.target.result); @@ -81,7 +88,8 @@ export default function UploadProduct() { } if (file) { if (file[0].name) { - setSelectedFile(file[0].name); + setSelectedFile(file?.[0].name); + setImgDetails(file?.[0]) const imgRead = new FileReader(); imgRead.onload = (event) => { setImg(event.target.result); @@ -92,6 +100,77 @@ export default function UploadProduct() { } }; + const [requestStatus, setRequestStatus] = useState({loading: false, status: null, message: ''}) + //FUNCTION TO UPLOAD ITEM + const uploadItem = () => { + let errorArr = [] + let uploadInfo = { // SUBMITTED DETAILS FROM USER + img, + itemName, + description + } + //LOOPS THROUGH ITEM DETAILS FOR EMPTINESS + for(let info in uploadInfo){ + if(!uploadInfo[info]){ + errorArr.push(info) + } + } + + // TEST TO SEE IF FIELDS ARE EMPTY + if(errorArr.length){ + let message = '' + // for(let i = 0; i 1 && errorArr.includes('img')){ + message='Please select file to upload & Item name/description cannot be empty' + }else { + message='Item name/description cannot be empty' + } + setRequestStatus({loading: false, status: null, message}) + return setTimeout(()=>{ + setRequestStatus({loading: false, status: false, message: ''}) + },5000) + } + + if(imgDetails.size > 2097152){ // CHECKS IF IMAGE SIZE IS MORE THAN "MB" + setRequestStatus({loading: false, status: null, message: 'Image must be less than 2MB'}) + return setTimeout(()=>{ + setRequestStatus({loading: false, status: false, message: ''}) + },5000) + } + + let reqData = { // PAYLOAD FOR API CALL + file_name: selectedFile, + file_size: imgDetails.size, + file_type: imgDetails.type, + file_data: img, + item_name: itemName, + item_description: description, + msg_type: 'FILE', + action: 'WRENCHBOARD_RESOURCE_MYFILES' + action: 11307 + } + console.log('TESTING', reqData) + setRequestStatus({loading: true, status: null, message: ''}) + + //API CALL TO UPLOAD COMES HERE + setTimeout(()=>{ + setRequestStatus({loading: false, status: true, message: 'Bad'}) + },3000) + setTimeout(()=>{ + setRequestStatus({loading: false, status: false, message: ''}) + },7000) + } + // drop event function handleDrop(e) { const dt = e.dataTransfer; @@ -167,7 +246,7 @@ export default function UploadProduct() { {/* heading */}

- Upload new item + {requestStatus.status == null ? 'Create new item' : 'Upload new item'}

{/** @@ -289,7 +368,8 @@ export default function UploadProduct() { {/* bottom action */} -
+
+

{requestStatus.message && requestStatus.message}

{/**/} {/* Preview*/} {/**/} - + : + + }
From 4b9289cb8e34743ad1750171ba69f1d2e1d730fd Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Tue, 8 Aug 2023 22:15:09 +0100 Subject: [PATCH 11/11] bug fix --- src/components/UploadProduct/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UploadProduct/index.jsx b/src/components/UploadProduct/index.jsx index 84a1e03..3d9c3d0 100644 --- a/src/components/UploadProduct/index.jsx +++ b/src/components/UploadProduct/index.jsx @@ -156,7 +156,7 @@ export default function UploadProduct() { item_name: itemName, item_description: description, msg_type: 'FILE', - action: 'WRENCHBOARD_RESOURCE_MYFILES' + // action: 'WRENCHBOARD_RESOURCE_MYFILES', action: 11307 } console.log('TESTING', reqData)