From 671310b7cf35e05081a249230ab62820484378b8 Mon Sep 17 00:00:00 2001 From: priyanshuvish Date: Mon, 14 Oct 2024 13:34:03 +0530 Subject: [PATCH] last thre pending --- src/App.css | 12 ++ src/Components/RupeeSlider/RupeeSlider.jsx | 70 ++++++++ src/Pages/OptiFiiExpense/WalletProgram.jsx | 12 +- .../OptiFiiExpense/wallet/BenifitStepOne.jsx | 136 +++++++++++++++ .../wallet/CreateBenefitWalletModal.jsx | 159 ++++++++++++++++++ .../ApplyForGiftCard/DigiTable.jsx | 8 +- .../ApplyForGiftCard/SelectCard.jsx | 34 ++-- 7 files changed, 405 insertions(+), 26 deletions(-) create mode 100644 src/Components/RupeeSlider/RupeeSlider.jsx create mode 100644 src/Pages/OptiFiiExpense/wallet/BenifitStepOne.jsx create mode 100644 src/Pages/OptiFiiExpense/wallet/CreateBenefitWalletModal.jsx diff --git a/src/App.css b/src/App.css index caecd47..547a3ff 100644 --- a/src/App.css +++ b/src/App.css @@ -550,3 +550,15 @@ a.active { } /* Styling the scrollbar */ + +/* for stepper */ +.css-1mdamwy[data-status=complete] { + background: #3725EA !important; +} +.css-1mdamwy[data-status=active] { + border-width: 1px !important; + border-color: #3725EA !important; +} +.css-ylpnre { + gap: 0 !important; +} \ No newline at end of file diff --git a/src/Components/RupeeSlider/RupeeSlider.jsx b/src/Components/RupeeSlider/RupeeSlider.jsx new file mode 100644 index 0000000..afbdf08 --- /dev/null +++ b/src/Components/RupeeSlider/RupeeSlider.jsx @@ -0,0 +1,70 @@ +import { + Box, + Slider, + SliderTrack, + SliderFilledTrack, + SliderThumb, + SliderMark, + HStack, + Text, +} from '@chakra-ui/react' +import React, { useState } from 'react' + + +const RupeeSlider = () => { + const [sliderValue, setSliderValue] = useState(100000); // Default value in rupees + + const formatRupee = (val) => `₹ ${val.toLocaleString('en-IN')}`; + + return ( + + + ₹ 100 + setSliderValue(val)} + colorScheme='purple' + min={100} + max={500000} + defaultValue={100000} + > + + {formatRupee(sliderValue)} + + + + + + + + ₹ 5,00,000 + + + ) +} + +export default RupeeSlider \ No newline at end of file diff --git a/src/Pages/OptiFiiExpense/WalletProgram.jsx b/src/Pages/OptiFiiExpense/WalletProgram.jsx index 161d836..87c3a8c 100644 --- a/src/Pages/OptiFiiExpense/WalletProgram.jsx +++ b/src/Pages/OptiFiiExpense/WalletProgram.jsx @@ -16,6 +16,7 @@ import { Tag, TagLabel, Text, + useDisclosure, VStack, } from "@chakra-ui/react"; import React, { useContext, useEffect, useMemo, useState } from "react"; @@ -64,12 +65,14 @@ import { TabPanels, TabPanel, } from "@chakra-ui/react"; +import CreateBenefitWalletModal from "./wallet/CreateBenefitWalletModal"; const WalletProgram = () => { const { walletProgram } = useContext(GlobalStateContext); const [isLoading, setIsLoading] = useState(false); const [searchTerm, setSearchTerm] = useState(""); const [showGrid, setShowGrid] = useState(true); + const { isOpen, onOpen, onClose } = useDisclosure(); const handleViewToggle = (viewType) => { setShowGrid(viewType === "grid"); @@ -201,9 +204,10 @@ const WalletProgram = () => { - - } title={"Create wallet"} /> - + } title={"Create wallet"} /> + + {/* + */} @@ -343,6 +347,8 @@ const WalletProgram = () => { )} + {/* Modal */} + ); }; diff --git a/src/Pages/OptiFiiExpense/wallet/BenifitStepOne.jsx b/src/Pages/OptiFiiExpense/wallet/BenifitStepOne.jsx new file mode 100644 index 0000000..79a4897 --- /dev/null +++ b/src/Pages/OptiFiiExpense/wallet/BenifitStepOne.jsx @@ -0,0 +1,136 @@ +import React, { useState } from 'react'; +import { + Box, Text, Input, Select, Stack, + InputGroup, + InputLeftElement, + HStack, + Divider, +} from "@chakra-ui/react"; +import { MdCurrencyRupee } from "react-icons/md"; +import { HiOutlineExclamationCircle } from "react-icons/hi2"; +import RupeeSlider from '../../../Components/RupeeSlider/RupeeSlider'; + +const BenifitStepOne = () => { + return ( + + {/* Your form fields */} + + + Create wallet policy + + + Wallet name + + Food + + + + Description + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et massa mi. Aliquam in hendrerit urna. Pellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. + + + + + + Transaction limit + Total amount + + + + + + + + + + + + Grades & transaction limit + + + Grade/level + + + + Amount + + + + + + + + + + + + + Select wallet type + + + + + Select transaction type + + + + + + Merchant transaction rule + + + Transaction rule + + + Either of them + + + + + + Transaction rule + + + Merchant category + + + + + + + + + Set transaction limit + + Set maximum limit + + + + Maximum limit - + ₹ 50,000 + + + Set daily limit + + + + Set weekly limit + + + + Set monthly limit + + + + + + ) +} + +export default BenifitStepOne \ No newline at end of file diff --git a/src/Pages/OptiFiiExpense/wallet/CreateBenefitWalletModal.jsx b/src/Pages/OptiFiiExpense/wallet/CreateBenefitWalletModal.jsx new file mode 100644 index 0000000..314b7f0 --- /dev/null +++ b/src/Pages/OptiFiiExpense/wallet/CreateBenefitWalletModal.jsx @@ -0,0 +1,159 @@ +import React, { useState } from 'react'; +import { + Box, Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalCloseButton, Text, Input, Select, Stack, + InputGroup, + InputLeftElement, + HStack, + Divider, + Button +} from "@chakra-ui/react"; +import { + Step, + StepIndicator, + StepSeparator, + StepStatus, + StepTitle, + Stepper, +} from '@chakra-ui/react'; +import { IoIosCheckmark } from "react-icons/io"; +import { MdCurrencyRupee } from "react-icons/md"; +import { HiOutlineExclamationCircle } from "react-icons/hi2"; +import PrimaryButton from "../../../../src/Components/Buttons/PrimaryButton" +import RupeeSlider from '../../../Components/RupeeSlider/RupeeSlider'; +import BenifitStepOne from './BenifitStepOne'; + +const CreateBenefitWalletModal = ({ isOpen, onClose }) => { + // Define steps + const steps = [ + { title: 'Wallet policy' }, + { title: 'Approval policy' }, + { title: 'Submission policy' }, + { title: 'Define budget' }, + ]; + + // Use useState to control the active step + const [activeStep, setActiveStep] = useState(0); + + const nextStep = () => { + if (activeStep < steps.length - 1) { + setActiveStep(activeStep + 1); + } + }; + + const prevStep = () => { + if (activeStep > 0) { + setActiveStep(activeStep - 1); + } + }; + + return ( + + {/* Modal component */} + + + + Create Benefit Wallet + + + {/* Stepper Component */} + + {steps.map((step, index) => ( + + + + {index < activeStep ? ( + + ) : ( + {index + 1} + )} + + + + + + + {step.title} + + + + + {index !== steps.length - 1 && ( + + )} + + ))} + + + + {/* Conditionally render form fields based on active step */} + + + {/* Step 1 Content: Create Wallet Policy */} + {activeStep === 0 && ( + + )} + + {/* Step 2 Content: Approval Policy */} + {activeStep === 1 && ( + + Approval Policy + This is step 2 content. + + )} + + {/* Step 3 Content: Submission Policy */} + {activeStep === 2 && ( + + Submission Policy + This is step 3 content. + + )} + + {/* Step 4 Content: Define Budget */} + {activeStep === 3 && ( + + Define Budget + + + )} + + {/* Stepper Controls */} + + + + + + + + + + + + ); +}; + +export default CreateBenefitWalletModal; diff --git a/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/DigiTable.jsx b/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/DigiTable.jsx index f8c79cf..307d225 100644 --- a/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/DigiTable.jsx +++ b/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/DigiTable.jsx @@ -56,13 +56,13 @@ const BrandVoucherTable = () => { - + Download a{" "} @@ -70,7 +70,7 @@ const BrandVoucherTable = () => { {" "} to quickly start your import - + {/* Divider with "OR" */} diff --git a/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/SelectCard.jsx b/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/SelectCard.jsx index 264822c..a05052c 100644 --- a/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/SelectCard.jsx +++ b/src/Pages/OptiFiiGifsAndVouchers/ApplyForGiftCard/SelectCard.jsx @@ -5,7 +5,6 @@ import mobilepng from "../../../assets/mobileCard.png"; import cardfooter from "../../../assets/cardFooter.png"; import cardfooter2 from "../../../assets/cardFooter2.png"; import cardfooter3 from "../../../assets/cardFooter3.png"; -import { CheckIcon } from "@chakra-ui/icons"; import { IoMdCheckmark } from "react-icons/io"; const cards = [ @@ -36,15 +35,16 @@ const cards = [ const SelectCard = ({ handleNext }) => { const tiltRefs = useRef([]); + const [selectedCardIndex, setSelectedCardIndex] = useState(null); // Store the selected card index useEffect(() => { tiltRefs.current.forEach((node) => { if (node) { VanillaTilt.init(node, { - max: 13, + max: 8, speed: 700, glare: true, - scale: 1.05, + scale: 1.01, "max-glare": 0.5, onEnter: () => { node.style.zIndex = 10; // Bring to top on hover @@ -66,17 +66,13 @@ const SelectCard = ({ handleNext }) => { }; }, [tiltRefs]); - // For check select - - const [isSelected, setIsSelected] = useState(false); - - const handleClick = () => { - setIsSelected((prevState) => !prevState); + // Handle card selection + const handleClick = (index) => { + setSelectedCardIndex(index); // Set the clicked card as selected }; - return ( - + {cards.map((card, index) => ( { color="white" borderRadius="lg" overflow="hidden" - width={{ base: "100%", md: "300px" }} + width={{ base: "100%", md: "270px" }} padding={6} textAlign="center" boxShadow="lg" position="relative" > {