This commit is contained in:
YasinShaikh123
2024-10-17 13:39:39 +05:30
parent 3079e7f269
commit 94b8be1130
6 changed files with 67 additions and 31 deletions

View File

@@ -22,12 +22,14 @@ import {
Td,
InputGroup,
InputRightAddon,
HStack,
} from "@chakra-ui/react";
import { Controller } from "react-hook-form";
import { TiWarning } from "react-icons/ti";
import { motion } from "framer-motion";
import { AddIcon, CloseIcon } from "@chakra-ui/icons";
import CurrencyInput from "./CurrencyInput";
import ShariahLogo from "../../src/assets/shariah-icon.png"
const today = new Date().toISOString().split("T")[0];
@@ -506,7 +508,18 @@ const FormField = ({
// value={dateValue}
/>
);} else{
);}
else if(type === 'checkBox'){
return (
<HStack justifyContent={"space-between"} mt={3}>
{/* <Image w={"38px"} aspectRatio={"1/1"} src={ShariahLogo} /> */}
<Checkbox
{...field}
{...props} size='md' colorScheme='forestGreen'>
<Text as={"span"} fontSize={"sm"}>Is This Sharia Compliant</Text>
</Checkbox>
</HStack>
);} else{
return (
<Input
bg={"#F5F8F6"}

View File

@@ -29,7 +29,7 @@ import { ViewIcon } from "@chakra-ui/icons";
import { useGetUnbanInvestorQuery } from "../../Services/ban.investor.service";
export const notification = yup.object().shape({
investmentNameEnglish: yup
title: yup
.string()
.required("Investment Name is required"),
ManualDate: yup
@@ -48,6 +48,16 @@ export const notification = yup.object().shape({
.required("Expected Return is required"),
});
export const notificationNew = yup.object().shape({
title: yup
.string()
.required("Investment Name is required"),
message: yup
.string()
.required("Message is required"),
});
const Notification = () => {
@@ -63,7 +73,7 @@ const Notification = () => {
handleSubmit,
formState: { errors },
} = useForm({
resolver: yupResolver(notification),
resolver: yupResolver(notificationNew),
});
console.log(errors);
@@ -112,39 +122,22 @@ const Notification = () => {
{
label: "Investment Name",
placeHolder: " ",
name: "investmentNameEnglish",
name: "title",
type: "text",
isRequired: true,
section: "Add Details",
// value: contact?.phoneNumber || "",
},
{
label: "Manual Date",
name: "ManualDate",
label: "Message",
placeHolder: " ",
type: "date",
name: "message",
type: "textarea",
isRequired: true,
section: "Add Details",
// value: contact?.emailAddress || "",
},
{
label: "Manual Time",
name: "ManualTime",
placeHolder: " ",
type: "time",
isRequired: true,
section: "Add Details",
// value: contact?.websiteUrl || "",
},
{
label: "Expected Return",
name: "expectedReturn",
placeHolder: " ",
type: "text",
isRequired: true,
section: "Add Details",
// value: contact?.websiteUrl || "",
// value: contact?.phoneNumber || "",
},
];
const groupedFields = formFields.reduce((groups, field) => {

View File

@@ -138,6 +138,7 @@ import {
];
const extractedArray = filteredData?.map((item, idx) => ({
// id: item?.id,
"Sr.no": (
<Text

View File

@@ -16,10 +16,13 @@ import {
} from "../../../Services/io.service";
import ToastBox from "../../../Components/ToastBox";
import {
Box,
Checkbox,
Input,
Table,
Tbody,
Td,
Text,
Th,
Thead,
Tr,
@@ -229,6 +232,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
holdingPeriod: yup.string().required("Holding period is required"),
holdingPeriodArabic: yup.string().required("Holding period is required"),
isShariah: yup.string().required("CheckBox is required"),
// minInvestmentAmount: yup
// .number()
@@ -308,7 +313,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
//=======================[ Creator ]
const formFields = [
{
label: "IO Name ",
label: "IO Name",
name: "investmentNameEnglish",
value: IObyID?.data?.investmentNameEnglish,
type: "text",
@@ -387,7 +392,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
type: "text",
isRequired: true,
section: " ",
width: "49%",
width: "32.3%",
value: IObyID?.data?.expectedReturn,
},
@@ -398,9 +403,18 @@ const IODetails = ({ enableNextTab, index, data }) => {
isRequired: true,
arabic: true,
section: " ",
width: "49%",
width: "32.3%",
value: IObyID?.data?.expectedReturnArabic,
},
{
label: "Shariah",
name: "isShariah",
type: "checkBox",
isRequired: true,
section: " ",
width: "32.3%",
value: IObyID?.data?.isShariah,
},
{
@@ -752,7 +766,13 @@ const IODetails = ({ enableNextTab, index, data }) => {
onSubmit={handleSubmit(onSubmit)}
btnLoading={isLoading}
submitTitle={id ? "Update" : "Submit"}
></FormInputMain>
>
{/* <Box display={"flex"} justifyContent={"end"} mb={3} mt={4} me={3}>
<Checkbox colorScheme='forestGreen' display={"flex"} gap={3} flexDirection= {"row-reverse"}>
<Text as={"span"} fontWeight={500} fontSize={"sm"}>Shariah</Text>
</Checkbox>
</Box> */}
</FormInputMain>
);
};

View File

@@ -35,9 +35,18 @@ export const contact = createApi({
// ========[Update Investment]=======
// sendNotification: builder.mutation({
// query: (data) => ({
// url: `/notification/admin/create`,
// method: "POST",
// body: data,
// }),
// }),
sendNotification: builder.mutation({
query: (data) => ({
url: `/notification/admin/create`,
url: `/notification/admin/create-with-title-message`,
method: "POST",
body: data,
}),

BIN
src/assets/shariah-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB