From d7012f26929065a1bb7a7754bf61dd23bddf6159 Mon Sep 17 00:00:00 2001 From: YasinShaikh123 <123150391+YasinShaikh123@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:10:58 +0530 Subject: [PATCH] selected css --- src/App.css | 5 + .../HeaderModal/DistributionInvestor.jsx | 96 +++++++++++++++++-- src/Services/io.service.js | 20 ++-- 3 files changed, 106 insertions(+), 15 deletions(-) diff --git a/src/App.css b/src/App.css index 5668f26..28d4a22 100644 --- a/src/App.css +++ b/src/App.css @@ -14,6 +14,11 @@ /* font-family: "Lato", sans-serif !important; */ } +::selection { + background-color: #004717; /* Change this to your desired color */ + color: white; /* Optional: Change the text color */ +} + .pointer { cursor: pointer !important; } diff --git a/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx b/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx index 36b88a5..421f613 100644 --- a/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx +++ b/src/Pages/IO_Management/ViewIO/HeaderModal/DistributionInvestor.jsx @@ -2,6 +2,7 @@ import { Box, Button, FormControl, + FormErrorMessage, FormLabel, HStack, Input, @@ -23,8 +24,61 @@ import { import DataTable from "../../../../Components/DataTable/DataTable"; import { useState } from "react"; import { AddIcon } from "@chakra-ui/icons"; +import { useGetDistributionInvestorMutation } from "../../../../Services/io.service"; +import { useParams } from "react-router-dom"; +import { useEffect } from "react"; +import { Controller, useForm } from "react-hook-form"; +import * as yup from "yup"; +import { yupResolver } from "@hookform/resolvers/yup"; + + +export const investor = yup.object().shape({ + amount: yup.string().required("Amount is required"), +}); + + + +const DistributionInvestor = ({ isOpen, onClose, }) => { + + + const params = useParams() + const id = params?.id + + // const { + // data:IObyID, + // error, + // isLoading, + // } = useGetDistributionInvestorMutation(id); + + const [ getDistributionInvestment ] = useGetDistributionInvestorMutation() + + const { + control, + handleSubmit, + formState: { errors }, + reset, + } = useForm({ + resolver: yupResolver(investor), + }); + + // useEffect(()=>{ + // try { + // const res = getDistributionInvestment({id,data}) + // console.log(res); + + // } catch (error) { + + // } + // },[]) + + + + // console.log(IObyID); + + + + -const DistributionInvestor = ({ isOpen, onClose }) => { // ====================================================[Table Setup]================================================================ const tableHeadRow = [ "Sr No.", @@ -205,22 +259,48 @@ const DistributionInvestor = ({ isOpen, onClose }) => { ); }; + + + const onSubmit = (data) =>{ + console.log( data ); + + + + } + return ( - Distribution To Investor Transaction + + Distribution To Investor Transaction + - Amount to Distribute - - + {/* + Amount to Distribute + */} + {/* */} + + Amount to Distribute + ( + + )} + /> + + {errors.amount?.message} + + @@ -243,14 +323,12 @@ const DistributionInvestor = ({ isOpen, onClose }) => { _hover={{ bg: "hsl(139deg 98.99% 26.59%)", }} - size={'sm'} + size={"sm"} rounded={"sm"} > Save - diff --git a/src/Services/io.service.js b/src/Services/io.service.js index daa6f5e..f65241f 100644 --- a/src/Services/io.service.js +++ b/src/Services/io.service.js @@ -231,7 +231,7 @@ export const ioService = createApi({ - // =====[ Amount Investment ] + // =====[ Amount Investment ] ====== amountIvestment : builder.mutation({ query: ({ data, id }) => ({ url: `/io/admin/amount-invested/${id}`, @@ -242,11 +242,19 @@ export const ioService = createApi({ }), + // ======== [ Distribution Transaction ] ======== + getDistributionInvestor : builder.mutation({ + query: ({id,data}) => ({ + url: `/io/admin/io-distribution/pre-populate/${id}`, + method: "POST", + body: data, + }), + invalidatesTags: ["getIOById"], + }), - - + @@ -296,8 +304,8 @@ export const { useUpdateStatusIoMutation, - - - useAmountIvestmentMutation, + + + useGetDistributionInvestorMutation, } = ioService;