This commit is contained in:
2024-08-14 18:48:25 +05:30
parent 2d641a9748
commit c9ad4a4377
9 changed files with 31 additions and 42 deletions

View File

@@ -136,7 +136,7 @@ const DashboardLayout = ({ isOnline }) => {
case path.startsWith("/sponser"):
return (
<span className="d-flex align-items-end gap-2">
<RiMoneyDollarBoxLine className="h4 m-0" /> Sponsorer
<RiMoneyDollarBoxLine className="h4 m-0" /> Sponsor
</span>
);
case path.startsWith("/investment-type"):

View File

@@ -70,15 +70,6 @@ const DepositRequest = () => {
} = useGetDepositRequestQuery({ page: currentPage, size: pageSize });
useEffect(() => {
// Simulate loading
const timer = setTimeout(() => {
setIsLoading(false);
}, 1500);
// Cleanup the timer on component unmount
return () => clearTimeout(timer);
}, []);
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
@@ -311,7 +302,7 @@ const DepositRequest = () => {
emptyMessage={`We don't have any Investment type `}
tableHeadRow={tableHeadRow}
data={extractedArray}
isLoading={isLoading}
isLoading={depositRequestLoading}
viewActionId={actionId}
setViewActionId={setActionId}
// totalPages={10}

View File

@@ -28,7 +28,7 @@ const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
export const conformModalSchema = yup.object().shape({
investorAmount: yup.string().required("Investor amount is required"),
comment: yup.string().required("Comment is required"),
comment: yup.string().notRequired(),
supporting_FileName: yup.mixed().required("File is required"),
// .test("fileType", "Unsupported File Format", (value) => {
// return value && FILE_TYPES.includes(value.type);

View File

@@ -64,15 +64,6 @@ const DepositHistory = () => {
} = useGetDepositHistoryQuery({ page: currentPage, size: pageSize });
useEffect(() => {
// Simulate loading
const timer = setTimeout(() => {
setIsLoading(false);
}, 1500);
// Cleanup the timer on component unmount
return () => clearTimeout(timer);
}, []);
// ====================================================[Table Setup]================================================================
const tableHeadRow = [
@@ -304,7 +295,7 @@ const filteredData = data?.data?.rows.filter((item) => {
tableHeadRow={tableHeadRow}
// setData={setExtractedArray}
data={extractedArray}
isLoading={isLoading}
isLoading={depositHistoryLoading}
viewActionId={actionId}
setViewActionId={setActionId}
setMouseEnteredId={setMouseEnteredId}

View File

@@ -27,7 +27,10 @@ import ToastBox from "../../../Components/ToastBox";
const investmentVideoSchema = yup.object().shape({
artifactName: yup.string().required("Artifact name is required"),
artifactStreamingURL: yup.string().required("Artifact streaming URL is required").url("Invalid URL format"),
artifactStreamingURL: yup.string()
.required("Artifact streaming URL is required")
.url("Invalid URL format")
.matches(/\.mp4$/, "URL must end with .mp4"),
});
const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, data }) => {

View File

@@ -286,6 +286,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
section: " ",
width: "49%",
value: IObyID?.data?.holdingPeriod,
maxLength:20,
helperText:`Maximum length should be 20 characters. You have entered ${watch()?.holdingPeriod?.length || 0} characters.`
},
{
label: "Holding Period (Arabic)",
@@ -297,6 +299,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
section: " ",
width: "49%",
value: IObyID?.data?.holdingPeriodArabic,
maxLength:20,
helperText:`Maximum length should be 20 characters. You have entered ${watch()?.holdingPeriodArabic?.length || 0} characters.`
},

View File

@@ -136,6 +136,7 @@ const KeyMeritsAdd = ({ isOpen, onClose, firstField, id, icons }) => {
const handleClose = () => {
onClose();
setIsLoading(false);
setAlert(false);
reset();
setFile(null);

View File

@@ -158,7 +158,9 @@ const filteredMenu = menu?.filter(item => apiTransactionTitles?.includes(item.id
console.log(isLoading);
console.log(IODetails?.ioNAV);
console.log(IODetails?.ioCash);
console.log(IODetails?.ioMVNAV);
@@ -305,7 +307,7 @@ console.log(isLoading);
IO cash
</Text>
<Text as={"span"} fontSize={"sm"} fontWeight={"500"}>
{IODetails?.ioCash ? formatCurrency(IODetails?.ioCash) : "00.00"}
{IODetails?.ioCash ? IODetails?.ioCash : "00.00"}
</Text>
</Box>

View File

@@ -54,7 +54,7 @@ const AddSponser = () => {
const [isLoadingBtn, setIsLoadingBtn] = useState(false);
const [alert, setAlert] = useState(false);
const [form, setForm] = useState();
const [isSwitchOn, setIsSwitchOn] = useState();
const [isSwitchOn, setIsSwitchOn] = useState(true);
const [createSponser] = useCreateSponserMutation();
const [updateSponser] = useUpdateSponserMutation();
@@ -62,9 +62,6 @@ const AddSponser = () => {
// Fetch sponsor data only if id exists
const {data: sponserByIdData,error,isLoading,} = useGetSponserByIdQuery(id, {skip: !id,});
console.log(sponserByIdData);
// ======================== [validators] ===========================
const {
@@ -124,15 +121,15 @@ const AddSponser = () => {
setIsLoadingBtn(false);
setAlert(false);
navigate("/sponser");
} else {
} else if(response?.error?.status === 400) {
toast({
render: () => (
<ToastBox message={"Something Went Wrong"} status={"error"} />
<ToastBox message={response?.error?.data?.message} status={"error"} />
),
});
setIsLoadingBtn(false);
navigate("/sponser");
setAlert(false)
}
});
} catch (error) {
@@ -179,22 +176,22 @@ const AddSponser = () => {
const formFields = [
{
label: "Sponser name (English)",
label: "Sponsor name (English)",
placeHolder: " ",
name: "sponsorName",
type: "text",
isRequired: true,
section: "Add Details",
section: "",
maxLength:50,
helperText:`Maximum length should be 50 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.`
},
{
label: "Sponser name (Arabic)",
label: "Sponsor name (Arabic)",
name: "sponsorNameArabic",
placeHolder: " ",
type: "text",
isRequired: true,
section: "Add Details",
section: "",
arabic: true,
right: true,
maxLength:55,
@@ -206,7 +203,7 @@ const AddSponser = () => {
placeHolder: " ",
type: "email",
// isRequired: true,
section: "Add Details",
section: "",
},
];
@@ -214,22 +211,22 @@ const AddSponser = () => {
const formEditFields = [
{
label: "Sponser name",
label: "Sponsor name",
placeHolder: " ",
name: "sponsorName",
type: "text",
isRequired: true,
section: "Add Details",
section: "",
maxLength:55,
helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.`
},
{
label: "Sponser name (Arabic)",
label: "Sponsor name (Arabic)",
name: "sponsorNameArabic",
placeHolder: " ",
type: "text",
isRequired: true,
section: "Add Details",
section: "",
arabic: true,
maxLength:55,
helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorNameArabic?.length || 0} characters.`
@@ -240,7 +237,7 @@ const AddSponser = () => {
placeHolder: " ",
type: "email",
// isRequired: true,
section: "Add Details",
section: "",
},
];