diff --git a/src/Components/Cards/BlueCard.jsx b/src/Components/Cards/BlueCard.jsx index e719eee..9b0894c 100644 --- a/src/Components/Cards/BlueCard.jsx +++ b/src/Components/Cards/BlueCard.jsx @@ -1,13 +1,16 @@ -import { Box, Stack, Text, Link, Badge } from '@chakra-ui/react'; -import React from 'react'; +import { Box, Stack, Text, Link } from '@chakra-ui/react'; +import React, { useState } from 'react'; // Import useState import { MdGroups } from 'react-icons/md'; +import EmployeesAddModal from '../../Pages/ManageHumanResource/EmployeesAddModal'; + +function BlueCard({ blueCardData }) { + const [isOpen, setIsOpen] = useState(false); // State to manage modal visibility + + const openModal = () => setIsOpen(true); // Function to open the modal + const closeModal = () => setIsOpen(false); // Function to close the modal -function BlueCard({blueCardData}) { return ( - + @@ -17,7 +20,7 @@ function BlueCard({blueCardData}) { {blueCardData.title.toUpperCase()} - + {blueCardData.count} @@ -31,9 +34,12 @@ function BlueCard({blueCardData}) { - {blueCardData.buttonText} + {blueCardData.buttonText} + {blueCardData.title === "Total EMPLOYEES" && ( + + )} ); } diff --git a/src/Pages/Onboarding/OnboardingAboutCompany.jsx b/src/Pages/Onboarding/OnboardingAboutCompany.jsx index 6cae1a3..07611d3 100644 --- a/src/Pages/Onboarding/OnboardingAboutCompany.jsx +++ b/src/Pages/Onboarding/OnboardingAboutCompany.jsx @@ -38,7 +38,7 @@ const validationSchema = Yup.object().shape({ mobileNumber_corporate: Yup.string() .matches(/^\d{10}$/, "Phone number must be 10 digits") .required("Phone number is required"), - logo_path_file_name:Yup.mixed().required('Company logo is required'), + logo_path_file_name: Yup.mixed().required('Company logo is required'), }); const OnboardingAboutCompany = ({ @@ -85,15 +85,12 @@ const OnboardingAboutCompany = ({ }; const onSubmit = async (data) => { - setCorpData({ ...corpData, ...data }); + setCorpData({ ...corpData, ...data }); handleNext(); // Handle your submit logic here }; - - - const handleFileUpload = async (file, setPreview) => { setIsLoading(true) console.log('File uploaded:', file); @@ -103,23 +100,23 @@ const OnboardingAboutCompany = ({ const code = localStorage?.getItem("codeCorporate"); try { const res = await sendFile({ data: formData, code }); // Upload file to server - console.log(res); + console.log(res); if (res?.data?.data) { // Assuming res.data.data contains the file URL or some ID - setCorpData({ ...corpData, logo_path_file_name:res?.data?.data }); + setCorpData({ ...corpData, logo_path_file_name: res?.data?.data }); setValue("logo_path_file_name", res?.data?.data); - console.log(errors); + console.log(errors); setPreview(res?.data?.data) toast({ render: () => , }); setIsLoading(false); - } else if (res?.error?.data?.message){ + } else if (res?.error?.data?.message) { toast({ render: () => , }); - - } else if(res?.error){ + + } else if (res?.error) { toast({ render: () => , }); @@ -175,9 +172,9 @@ const OnboardingAboutCompany = ({ {/* Industry Select Field */} - + Industry - + { - handleFileChange(e); // Handle file input - }} - /> + {activeStep === steps.length - 1 ? "Next step" : "Next step"} + + - {fileName && ( - - Uploaded file: {fileName} - - )} - - - {errors.logo_path_file_name && ( - - {errors.logo_path_file_name.message} - - )} - - - - Supported formats- jpg, png, svg - - - Maximum size - 20MB - - - - - } - variant="outline" - size="sm" - px={8} - _hover={{ opacity: 0.8 }} - color={"#d0b8ef"} - border={"1px solid #d0b8ef"} - isDisabled={activeStep === 0} - onClick={() => setActiveStep(activeStep - 1)} - /> - - - - */} - - - - - {errors.logo_path_file_name?.message && ( - - {errors.logo_path_file_name?.message} - - )} - - - - - } - variant="outline" - size="sm" - px={8} - _hover={{ opacity: 0.8 }} - color={"#d0b8ef"} - border={"1px solid #d0b8ef"} - isDisabled={activeStep === 0} - onClick={() => setActiveStep(activeStep - 1)} - /> - - - - - {/* Display the loading spinner */} - {isLoading && ( - + {/* Display the loading spinner */} + {isLoading && ( + Uploading please wait... )} diff --git a/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx b/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx index 0cc639a..ed8b032 100644 --- a/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx +++ b/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx @@ -225,9 +225,9 @@ const OnboardingAddCompanyDetails = ({ {/* Company PAN Field */} - + Company PAN - + - + Company GST number - + { - - + + {/* */} - - + + {/* */}