diff --git a/src/app/(vendor onboarding)/(Agreement)/Agreement.tsx b/src/app/(vendor onboarding)/(Agreement)/Agreement.tsx index bc95c61..9f17ded 100644 --- a/src/app/(vendor onboarding)/(Agreement)/Agreement.tsx +++ b/src/app/(vendor onboarding)/(Agreement)/Agreement.tsx @@ -4,6 +4,7 @@ import Link from "next/link"; import jwt from "jsonwebtoken"; import { getvendor } from "@/services/auth"; import { useToast } from "@/components/hooks/use-toast"; +import Loadingeanimation from "@/components/Loader"; type PageProps = { setCurrentPage: React.Dispatch>; }; @@ -11,6 +12,7 @@ type PageProps = { const Agreement = ({ setCurrentPage }: PageProps) => { const [checked, setIschecked] = useState(false); const { toast } = useToast(); + const [loading, setLoading] = useState(true); const [signature, setsignature] = useState(""); const [formData, setFormData] = useState({ fullName: "", @@ -31,6 +33,7 @@ const Agreement = ({ setCurrentPage }: PageProps) => { useEffect(() => { const fetchData = async () => { + setLoading(true); const token = localStorage.getItem("token"); if (token) { @@ -56,10 +59,25 @@ const Agreement = ({ setCurrentPage }: PageProps) => { })); console.log(user); } else { + toast({ + variant: "destructive", + title: "Error Something went wrong.", + description: + "There was a problem with your request. Pls Login Again", + }); console.error("Token does not contain expected data."); } } catch (error) { + toast({ + variant: "destructive", + title: error ? "Error" : "Something went wrong.", + description: + String(error) || + "There was a problem with your request. Check internet", + }); console.error("Failed to decode token:", error); + } finally { + setLoading(false); } } else { console.log("No token found in localStorage."); @@ -70,378 +88,385 @@ const Agreement = ({ setCurrentPage }: PageProps) => { }, []); return ( -
-
-
-

- Vendor Agreement -

-

- Your Agreement -

-
-
-
-

+ <> +
+
+
+

Vendor Agreement -

- -

- This Vendor Agreement ("Agreement") is - entered into as of{" "} - {new Date().toLocaleDateString()} between: -

+

+

+ Your Agreement +

+
+
+
+

+ Vendor Agreement +

-

- Eventory ("Platform" - or " - Company"), having its principal place of - business at: -
- - 13-D, Atmaram House, 1-Tolstoy Marg, Connaught Place, New Delhi - -11001 - -
- And
- {formData?.fullName || "Vendor Name"} having its - principal place of business at:
- {formData?.address || "Vendor Address"}. -

+

+ This Vendor Agreement ("Agreement") + is entered into as of{" "} + {new Date().toLocaleDateString()} between: +

-

- Collectively referred to as the "Parties - " and individually as a "Party." -

+

+ Eventory ("Platform" + or " + Company"), having its principal place of + business at: +
+ + 13-D, Atmaram House, 1-Tolstoy Marg, Connaught Place, New + Delhi -11001 + +
+ And
+ {formData?.fullName || "Vendor Name"} having + its principal place of business at:
+ {formData?.address || "Vendor Address"}. +

- 1. Definitions -
    -
  • - 1.1 Platform: Eventory's online and - offline event booking platform where services are offered to - users. -
  • -
  • - 1.2 Vendor: The entity providing goods or - services for events listed on the Platform. -
  • -
  • - 1.3 Users/Clients: Individuals or businesses - that hire the Vendor via the Platform. -
  • -
  • - 1.4 Services: The services provided by the - Vendor listed on the Platform (e.g., catering, photography, - event planning, etc.). -
  • -
  • - 1.5 Booking Amount: The base price of the goods - or services offered by the Vendor. -
  • -
+

+ Collectively referred to as the "Parties + " and individually as a "Party." +

- 2. Scope of Services -
    -
  • - 2.1 Description of Services: The Vendor agrees - to provide the following services:{" "} - {formData?.typeofservice || "Service Type"}. -
  • -
  • - 2.2 Service Standards: The Vendor agrees to - deliver services in a professional manner, adhering to industry - standards, and will comply with all legal and regulatory - requirements. -
  • -
+ 1. Definitions +
    +
  • + 1.1 Platform: Eventory's online and + offline event booking platform where services are offered to + users. +
  • +
  • + 1.2 Vendor: The entity providing goods or + services for events listed on the Platform. +
  • +
  • + 1.3 Users/Clients: Individuals or businesses + that hire the Vendor via the Platform. +
  • +
  • + 1.4 Services: The services provided by the + Vendor listed on the Platform (e.g., catering, photography, + event planning, etc.). +
  • +
  • + 1.5 Booking Amount: The base price of the + goods or services offered by the Vendor. +
  • +
- 3. Term and Termination -
    -
  • - 3.1 Agreement Term: This Agreement is effective - as of {new Date().toLocaleDateString()} and - shall remain in effect until terminated by either Party as - provided in this section. -
  • -
  • - 3.2 Termination by Vendor: The Vendor may - terminate this Agreement by providing{" "} - - {new Date( - new Date().setDate(new Date().getDate() + 7), - ).toLocaleDateString()} - {" "} - written notice to the Platform. -
  • -
  • - 3.3 Termination by Platform: The Platform may - terminate this Agreement immediately if the Vendor breaches any - terms of this Agreement or fails to provide services up to - required standards. -
  • -
  • - 3.4 Effect of Termination: Upon termination, - all pending transactions or bookings will be completed unless - mutually agreed otherwise. The Vendor shall be responsible for - all commitments made prior to the date of termination. -
  • -
+ 2. Scope of Services +
    +
  • + 2.1 Description of Services: The Vendor + agrees to provide the following services:{" "} + {formData?.typeofservice || "Service Type"}. +
  • +
  • + 2.2 Service Standards: The Vendor agrees to + deliver services in a professional manner, adhering to + industry standards, and will comply with all legal and + regulatory requirements. +
  • +
- 4. Payment and Commission -
    -
  • - 4.1 Commission Structure: The Platform will - retain commission based on the total transaction amount as - follows: -
      -
    • 0k - 5k: 20%
    • -
    • 5k - 15k: 18%
    • -
    • 15k - 30k: 15%
    • -
    • 30k - 50k: 12%
    • -
    • 50k - 1L: 10%
    • -
    • 1L - 3L: 8%
    • -
    • 3L - 5L: 5%
    • -
    • 5L - 10L: 3%
    • -
    • 10L+: 2%
    • -
    -
  • -
  • - 4.2 Payment Schedule: Payments to the Vendor - will be made within 7 days after the successful completion of - services, minus the applicable commission. -
  • -
+ 3. Term and Termination +
    +
  • + 3.1 Agreement Term: This Agreement is + effective as of{" "} + {new Date().toLocaleDateString()} and shall + remain in effect until terminated by either Party as provided + in this section. +
  • +
  • + 3.2 Termination by Vendor: The Vendor may + terminate this Agreement by providing{" "} + + {new Date( + new Date().setDate(new Date().getDate() + 7), + ).toLocaleDateString()} + {" "} + written notice to the Platform. +
  • +
  • + 3.3 Termination by Platform: The Platform may + terminate this Agreement immediately if the Vendor breaches + any terms of this Agreement or fails to provide services up to + required standards. +
  • +
  • + 3.4 Effect of Termination: Upon termination, + all pending transactions or bookings will be completed unless + mutually agreed otherwise. The Vendor shall be responsible for + all commitments made prior to the date of termination. +
  • +
- 5. Vendor Obligations -
    -
  • - 5.1 Compliance with Laws: The Vendor agrees to - comply with all applicable local, state, and national laws and - regulations. -
  • -
  • - 5.2 Licenses and Permits: The Vendor is solely - responsible for obtaining and maintaining any licenses, permits, - and certifications required to perform the agreed-upon services. -
  • -
  • - 5.3 Insurance: The Vendor shall maintain - sufficient liability insurance to cover risks associated with - the provision of services under this Agreement. Proof of - insurance must be provided upon request. -
  • -
  • - 5.4 Service Delivery: The Vendor guarantees - timely delivery of services as per agreed-upon schedules, and - any failure to deliver shall be considered a breach of this - Agreement. -
  • -
+ 4. Payment and Commission +
    +
  • + 4.1 Commission Structure: The Platform will + retain commission based on the total transaction amount as + follows: +
      +
    • 0k - 5k: 20%
    • +
    • 5k - 15k: 18%
    • +
    • 15k - 30k: 15%
    • +
    • 30k - 50k: 12%
    • +
    • 50k - 1L: 10%
    • +
    • 1L - 3L: 8%
    • +
    • 3L - 5L: 5%
    • +
    • 5L - 10L: 3%
    • +
    • 10L+: 2%
    • +
    +
  • +
  • + 4.2 Payment Schedule: Payments to the Vendor + will be made within 7 days after the successful completion of + services, minus the applicable commission. +
  • +
- - 6. Cancellation, Refund, and Booking Guarantee Policy - -
    -
  • - 6.1 Vendor Cancellation: If a Vendor cancels a - booking at the last moment, the Platform will provide customers - with alternative recommendations. Any price differences due to - dynamic pricing will be covered by the Vendor. -
  • -
  • - 6.2 Customer Cancellation: If a customer - cancels a booking, they will be charged a percentage of the - BOOKING AMOUNT, and the remaining amount will be refunded - depending on how many days in advance the cancellation is made. -
  • -
+ 5. Vendor Obligations +
    +
  • + 5.1 Compliance with Laws: The Vendor agrees + to comply with all applicable local, state, and national laws + and regulations. +
  • +
  • + 5.2 Licenses and Permits: The Vendor is + solely responsible for obtaining and maintaining any licenses, + permits, and certifications required to perform the + agreed-upon services. +
  • +
  • + 5.3 Insurance: The Vendor shall maintain + sufficient liability insurance to cover risks associated with + the provision of services under this Agreement. Proof of + insurance must be provided upon request. +
  • +
  • + 5.4 Service Delivery: The Vendor guarantees + timely delivery of services as per agreed-upon schedules, and + any failure to deliver shall be considered a breach of this + Agreement. +
  • +
- 7. Vendor’s Representation and Warranties -
    -
  • - 7.1 Performance: The Vendor warrants that it - has the necessary skills, experience, and resources to perform - the services professionally and efficiently. -
  • -
  • - 7.2 Non-Infringement: The Vendor warrants that - all services provided do not infringe on any third-party - intellectual property rights. -
  • -
  • - 7.3 Compliance: The Vendor represents that it - complies with all laws and regulations related to the - performance of its services. -
  • -
+ + 6. Cancellation, Refund, and Booking Guarantee Policy + +
    +
  • + 6.1 Vendor Cancellation: If a Vendor cancels + a booking at the last moment, the Platform will provide + customers with alternative recommendations. Any price + differences due to dynamic pricing will be covered by the + Vendor. +
  • +
  • + 6.2 Customer Cancellation: If a customer + cancels a booking, they will be charged a percentage of the + BOOKING AMOUNT, and the remaining amount will be refunded + depending on how many days in advance the cancellation is + made. +
  • +
- 8. Vendor Visibility, Booking Numbers, and ROI -
    -
  • - 8.1 Visibility and Marketing: The Vendor’s - visibility on the Platform depends on factors such as quality of - service, pricing competitiveness, and profile updates. -
  • -
  • - 8.2 No Guarantee of Bookings: The Platform does - not guarantee a fixed number of bookings or orders to any - Vendor. Success depends on several factors such as customer - preferences and service quality. -
  • -
+ 7. Vendor’s Representation and Warranties +
    +
  • + 7.1 Performance: The Vendor warrants that it + has the necessary skills, experience, and resources to perform + the services professionally and efficiently. +
  • +
  • + 7.2 Non-Infringement: The Vendor warrants + that all services provided do not infringe on any third-party + intellectual property rights. +
  • +
  • + 7.3 Compliance: The Vendor represents that it + complies with all laws and regulations related to the + performance of its services. +
  • +
- 9. Dispute Resolution -
    -
  • - 9.1 Disputes with Users: The Platform will act - as an intermediary in any disputes between the Vendor and the - user. -
  • -
  • - 9.2 Arbitration: Any disputes between the - Vendor and Platform shall be settled by arbitration in - accordance with the rules of [Arbitration Body]. -
  • -
+ 8. Vendor Visibility, Booking Numbers, and ROI +
    +
  • + 8.1 Visibility and Marketing: The Vendor’s + visibility on the Platform depends on factors such as quality + of service, pricing competitiveness, and profile updates. +
  • +
  • + 8.2 No Guarantee of Bookings: The Platform + does not guarantee a fixed number of bookings or orders to any + Vendor. Success depends on several factors such as customer + preferences and service quality. +
  • +
- 10. Governing Law -

- This Agreement shall be governed by and construed in accordance - with the laws of India. -

+ 9. Dispute Resolution +
    +
  • + 9.1 Disputes with Users: The Platform will + act as an intermediary in any disputes between the Vendor and + the user. +
  • +
  • + 9.2 Arbitration: Any disputes between the + Vendor and Platform shall be settled by arbitration in + accordance with the rules of [Arbitration Body]. +
  • +
- 11. Miscellaneous -
    -
  • - 11.1 Amendments: This Agreement may only be - amended in writing signed by both Parties. -
  • -
  • - 11.2 Entire Agreement: This Agreement - constitutes the entire agreement between the Parties regarding - its subject matter and supersedes any prior agreements. -
  • -
  • - 11.3 Entire Agreement: This Agreement - constitutes the entire agreement between the Parties and - supersedes all prior agreements and understandings. -
  • -
- - IN WITNESS WHEREOF - -

- - The Parties have executed this Agreement as of the date written - below: - -

-
-
-

- For Eventory: -

+ 10. Governing Law

- Signature: Eventory -

-

- Name: Eventory Tech -

-

- Date: {new Date().toLocaleDateString()} -

-
-
-

- For Vendor: -

-

- Signature:{" "} - setsignature(e.target.value)} - className={`border-b-2 ${ - signature === formData?.fullName - ? "border-b-blue-600" - : "border-b-red-600" - }`} - type="text" - value={signature} - placeholder="Enter your signature" - /> -

-

- Name: {formData?.fullName || "Vendor Name"} + This Agreement shall be governed by and construed in accordance + with the laws of India.

+ + 11. Miscellaneous +
    +
  • + 11.1 Amendments: This Agreement may only be + amended in writing signed by both Parties. +
  • +
  • + 11.2 Entire Agreement: This Agreement + constitutes the entire agreement between the Parties regarding + its subject matter and supersedes any prior agreements. +
  • +
  • + 11.3 Entire Agreement: This Agreement + constitutes the entire agreement between the Parties and + supersedes all prior agreements and understandings. +
  • +
+ + IN WITNESS WHEREOF +

- Date: {new Date().toLocaleDateString()} + + The Parties have executed this Agreement as of the date + written below: +

+
+
+

+ For Eventory: +

+

+ Signature: Eventory +

+

+ Name: Eventory Tech +

+

+ Date: {new Date().toLocaleDateString()} +

+
+
+

+ For Vendor: +

+

+ Signature:{" "} + setsignature(e.target.value)} + className={`border-b-2 ${ + signature === formData?.fullName + ? "border-b-blue-600" + : "border-b-red-600" + }`} + type="text" + value={signature} + placeholder="Enter your signature" + /> +

+

+ Name: {formData?.fullName || "Vendor Name"} +

+

+ Date: {new Date().toLocaleDateString()} +

+
-
-
-
- setIschecked((prevCheck) => !prevCheck)} - checked={checked} - className="peer hidden" - /> -
-

- i agree with{" "} - +

-
-
- - +

Cancel

+ + +
-
+ {loading && } + ); }; diff --git a/src/app/(vendor onboarding)/(Plans)/Plans.tsx b/src/app/(vendor onboarding)/(Plans)/Plans.tsx index c2e1c91..3a183ce 100644 --- a/src/app/(vendor onboarding)/(Plans)/Plans.tsx +++ b/src/app/(vendor onboarding)/(Plans)/Plans.tsx @@ -6,8 +6,10 @@ import { handlePayment } from "@/services/payment"; import { getvendor } from "@/services/auth"; import { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; // Import from 'next/navigation' +import { useToast } from "@/components/hooks/use-toast"; import Link from "next/link"; import vendorpricecalculations from "@/services/vendorpricecalculation"; +import Loadingeanimation from "@/components/Loader"; interface PlanDetails { title: string; price: number; @@ -25,6 +27,7 @@ interface BusinessDetails { } const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { + const { toast } = useToast(); const plan: PlanDetails = { title: "Basic", price: 0, @@ -35,6 +38,7 @@ const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { "Up to 3 team members", ], }; + const [loader, setloader] = useState(true); const [disabled, setdisabled] = useState(true); const [price, setPrice] = useState(0); const [error, setError] = useState(false); @@ -136,7 +140,7 @@ const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { useEffect(() => { const fetchData = async () => { const token = localStorage.getItem("token"); - + setloader(true); if (token) { try { const { id, email, name, mobile } = jwt.decode(token) as { @@ -152,8 +156,8 @@ const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { setVendorId(user.id); setFormData((prevFormData) => ({ ...prevFormData, - email: user?.email, - phoneNumber: user?.mobile, + email: user?.email || "", + phoneNumber: user?.mobile || "", fullName: user?.name, gstinNumber: user?.businessDetails.gstin, address: user?.businessDetails.businessAddress, @@ -174,14 +178,34 @@ const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { ); setPrice(price); } else { + toast({ + variant: "destructive", + title: "Error Something went wrong.", + description: + "There was a problem with your request. Pls Login Again", + }); console.error("Token does not contain expected data."); } } catch (error) { + toast({ + variant: "destructive", + title: "Error Something went wrong.", + description: + "There was a problem with your request. Pls Login Again", + }); console.error("Failed to decode token:", error); + } finally { + setloader(false); } } else { + toast({ + variant: "destructive", + title: "Error Something went wrong.", + description: "There was a problem with your request. Pls Login Again", + }); console.log("No token found in localStorage."); } + setloader(false); }; fetchData(); @@ -403,6 +427,7 @@ const Plans = ({ setCurrentPage, handleformSubmit }: Pagechangetype) => { + {loader && } ); }; diff --git a/src/app/(vendor onboarding)/login/page.tsx b/src/app/(vendor onboarding)/login/page.tsx index e1dca53..b9c61b2 100644 --- a/src/app/(vendor onboarding)/login/page.tsx +++ b/src/app/(vendor onboarding)/login/page.tsx @@ -192,96 +192,88 @@ const Login = () => {
- {Loading ? ( -
- -
- ) : ( - <> -
-
handleLogin(e)}> -
- {fields.map((field) => ( -
- - { - refs.current[field.id] = el; - }} - /> -
- ))} +
+ handleLogin(e)}> +
+ {fields.map((field) => ( +
+ + { + refs.current[field.id] = el; + }} + />
- {formError && ( -
{formError}
- )} -
-

- To verify it's you, we will send you an OTP to your - mobile number. -

-
-
-
- or continue with -
+ {formError && ( +
{formError}
+ )} +
+

+ To verify it's you, we will send you an OTP to your + mobile number. +

+
+
+
+ or continue with +
+ + + + + + +
+
+
+ Don't have an account?{" "} + - - - - - - -
-
-
- Don't have an account?{" "} - - Sign In - -
- -
+ Sign In +
- + +
- - )} + +
{isModalOpen && ( @@ -296,6 +288,7 @@ const Login = () => { renderError={renderError} /> )} + {Loading && }
); }; diff --git a/src/app/(vendor onboarding)/signup/page.tsx b/src/app/(vendor onboarding)/signup/page.tsx index 3ebf1be..d5cb470 100644 --- a/src/app/(vendor onboarding)/signup/page.tsx +++ b/src/app/(vendor onboarding)/signup/page.tsx @@ -93,6 +93,7 @@ const SignUp = () => { } catch (error) { setFormError(String(error) || "Something goes wrong"); console.log(error); + } finally { setloading(false); } } @@ -176,115 +177,107 @@ const SignUp = () => {
- {loading ? ( -
- -
- ) : ( - <> -

Basic Details

-
-
+

Basic Details

+
+ +
+ {fields.map((field) => (
- {fields.map((field) => ( -
- - { - refs.current[field.id] = el; - }} - /> -
- ))} -
- {formError && !isModalOpen && ( -
{formError}321
- )} -
-
-

- By continueing. You agree with{" "} - - Privacy Policy - -

-
-
-
-

- To verify it's you, we will send you an OTP to your - mobile number. -

+ + { + refs.current[field.id] = el; + }} + />
-
-
- or continue with -
+ {formError && !isModalOpen && ( +
{formError}321
+ )} +
+
+

+ By continueing. You agree with{" "} + - - - - - - -

-
-
- Already have an account?{" "} - - Log In - -
- -
+ Privacy Policy + + +
+
+
+

+ To verify it's you, we will send you an OTP to your + mobile number. +

+
+
+
+ or continue with +
+ + + + + + +
+
+
+ Already have an account?{" "} + + Log In +
- + +
- - )} + +
{isModalOpen && ( @@ -299,6 +292,7 @@ const SignUp = () => { renderError={renderError} /> )} + {loading && }
); }; diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index c6a94c4..f0b654f 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -6,17 +6,18 @@ interface LoaderProps { width?: string; // width can be optional and specified as a string } -const Loadingeanimation: React.FC = ({ width = "w-56" }) => { +const Loadingeanimation: React.FC = ({ width = "w-64" }) => { // Default width return ( -
+
Loading...
); }; export default Loadingeanimation; +// https://eventory-bucket.s3.ap-south-1.amazonaws.com/website/ezgif-3-19f3ab10a0.gif