mirror of
https://github.com/WDI-Ideas/rubix-admin-panel.git
synced 2026-04-27 19:25:51 +00:00
bug fix
This commit is contained in:
@@ -131,7 +131,7 @@ const AddBanner = ({ createApi, navigateLink, title, center }) => {
|
||||
<Box display={"flex"}>
|
||||
<Box className="col-5 d-flex flex-column gap-2 pt-4">
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Info
|
||||
Banner info
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary">
|
||||
Select the platform for which you need to create this campaign.
|
||||
@@ -140,7 +140,7 @@ const AddBanner = ({ createApi, navigateLink, title, center }) => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Image
|
||||
Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
@@ -228,11 +228,11 @@ const AddBanner = ({ createApi, navigateLink, title, center }) => {
|
||||
|
||||
<FormControl isRequired className="mb-3">
|
||||
<FormLabel className="web-text-large fw-bold rubix-text-dark">
|
||||
Sub Heading
|
||||
Sub heading
|
||||
</FormLabel>
|
||||
<Textarea
|
||||
{...register("sub_heading")}
|
||||
placeholder="Sub Heading"
|
||||
placeholder="Sub heading"
|
||||
className="web-text-medium"
|
||||
size="sm"
|
||||
errorBorderColor="crimson"
|
||||
@@ -243,7 +243,7 @@ const AddBanner = ({ createApi, navigateLink, title, center }) => {
|
||||
color={formData?.sub_heading?.length > 230 ? "red" : "gray.500"}
|
||||
className="web-text-small"
|
||||
>
|
||||
If sub heading crosses 50 characters it will cause problem in
|
||||
If sub heading crosses 230 characters it will cause problem in
|
||||
alignment on website.you have entered{" "}
|
||||
{formData?.sub_heading?.length} characters
|
||||
</FormHelperText>
|
||||
@@ -395,7 +395,7 @@ const AddBanner = ({ createApi, navigateLink, title, center }) => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ const BannerEdit = ({isLoading, data, updateBanner, navigateTo, refetch, center}
|
||||
}
|
||||
className="web-text-small"
|
||||
>
|
||||
If sub heading crosses 50 characters it will cause problem in alignment on website.you have entered {formData?.sub_heading?.length} characters
|
||||
If sub heading crosses 230 characters it will cause problem in alignment on website.you have entered {formData?.sub_heading?.length} characters
|
||||
</FormHelperText>
|
||||
{errors.sub_heading && (
|
||||
<span className="text-danger web-text-small fw-bold ps-2 d-flex align-items-center gap-1 mt-1">
|
||||
@@ -345,7 +345,7 @@ const BannerEdit = ({isLoading, data, updateBanner, navigateTo, refetch, center}
|
||||
}
|
||||
className="web-text-small"
|
||||
>
|
||||
If sub heading crosses 50 characters it will cause problem in alignment on website.you have entered {formData?.CTO_button_title?.length} characters
|
||||
If sub heading crosses 30 characters it will cause problem in alignment on website.you have entered {formData?.CTO_button_title?.length} characters
|
||||
</FormHelperText>
|
||||
|
||||
{errors.CTO_button_title && (
|
||||
@@ -466,7 +466,7 @@ const BannerEdit = ({isLoading, data, updateBanner, navigateTo, refetch, center}
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ const AddBlogsAndArticles = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Blog's banner image
|
||||
Blog's Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community
|
||||
@@ -284,7 +284,7 @@ const AddBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
) : (
|
||||
@@ -404,7 +404,7 @@ const AddBlogsAndArticles = () => {
|
||||
}
|
||||
className="web-text-small"
|
||||
>
|
||||
If discription crosses 160 characters it will cause problem in SEO
|
||||
If description crosses 160 characters it will cause problem in SEO
|
||||
optimisation.you have entered {metaDescription.length} characters
|
||||
</FormHelperText>
|
||||
|
||||
@@ -556,7 +556,7 @@ const AddBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</Box>
|
||||
@@ -742,7 +742,7 @@ const AddBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ const BlogsAndArticles = () => {
|
||||
// ====================================================[Table Filter]================================================================
|
||||
const filteredData = blog?.data?.data?.rows?.filter((item) => {
|
||||
// Filter by name (case insensitive)
|
||||
const name = item.title;
|
||||
const name = item.author_name;
|
||||
const searchLower = searchTerm.toLowerCase();
|
||||
const nameMatches = name.toLowerCase().includes(searchLower);
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ const EditBlogsAndArticles = () => {
|
||||
const [selectedImage, setSelectedImage] = useState(fallbackImage);
|
||||
const [selectedImageLarge, setSelectedImageLarge] =
|
||||
useState(fallbackImageLarge);
|
||||
const [largeImageData, setLargeImageData] = useState({});
|
||||
const [smallImageData, setSmallImageData] = useState({});
|
||||
const [largeImageData, setLargeImageData] = useState(null);
|
||||
const [smallImageData, setSmallImageData] = useState(null);
|
||||
const [chips, setChips] = useState();
|
||||
|
||||
console.log(error);
|
||||
@@ -230,7 +230,7 @@ const EditBlogsAndArticles = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Blog's banner image
|
||||
Blog's Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community
|
||||
@@ -330,7 +330,7 @@ const EditBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
) : (
|
||||
@@ -346,7 +346,7 @@ const EditBlogsAndArticles = () => {
|
||||
{selectedImageLarge === fallbackImageLarge ? (
|
||||
""
|
||||
) : (
|
||||
<Box display={"flex"} flexDirection={"column"} w={"100%"}>
|
||||
largeImageData && <Box display={"flex"} flexDirection={"column"} w={"100%"}>
|
||||
<span className="web-text-small">
|
||||
{largeImageData?.name}
|
||||
</span>
|
||||
@@ -582,7 +582,7 @@ const EditBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</Box>
|
||||
@@ -622,7 +622,7 @@ const EditBlogsAndArticles = () => {
|
||||
{selectedImage === fallbackImage ? (
|
||||
""
|
||||
) : (
|
||||
<Box display={"flex"} flexDirection={"column"} w={"100%"}>
|
||||
smallImageData && <Box display={"flex"} flexDirection={"column"} w={"100%"}>
|
||||
<span className="web-text-small">{smallImageData?.name}</span>
|
||||
<span className="web-text-small text-secondary fst-italic">
|
||||
{(smallImageData?.size / (1024 * 1024)).toFixed(2)} mb
|
||||
@@ -769,7 +769,7 @@ const EditBlogsAndArticles = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ const ViewBlogsAndArticles = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Blog's banner image
|
||||
Blog's Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
|
||||
@@ -334,7 +334,7 @@ const AddComunity = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ const Community = () => {
|
||||
// ====================================================[Table Setup]================================================================
|
||||
const tableHeadRow = [
|
||||
"Name",
|
||||
"Discription",
|
||||
"Description",
|
||||
"Linked In",
|
||||
"Active",
|
||||
"Created At",
|
||||
@@ -187,7 +187,7 @@ const Community = () => {
|
||||
</span>
|
||||
</RouterLink>
|
||||
),
|
||||
Discription: (
|
||||
Description: (
|
||||
<Text as={"span"} color={"teal.900"}>
|
||||
{item?.description}
|
||||
</Text>
|
||||
|
||||
@@ -391,7 +391,7 @@ const ComunityEditPage = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ const AddEvents = () => {
|
||||
<Box className="d-flex">
|
||||
<Box className="col-5 d-flex flex-column gap-2 pt-4">
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Info
|
||||
Banner info
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary">
|
||||
Select the platform for which you need to create this campaign.
|
||||
@@ -131,7 +131,7 @@ const AddEvents = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Image
|
||||
Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
@@ -374,7 +374,7 @@ const AddEvents = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ const ViewEvents = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Events banner image
|
||||
Events Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
|
||||
@@ -302,7 +302,7 @@ const AddFaq = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl> */}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const Login = () => {
|
||||
setIsLoading(false);
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox status={"success"} message={"Login succesfull"} />
|
||||
<ToastBox status={"success"} message={"Login Successfully"} />
|
||||
),
|
||||
});
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ const AddNews = () => {
|
||||
<Box className="d-flex">
|
||||
<Box className="col-5 d-flex flex-column gap-2 pt-4">
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Info
|
||||
Banner info
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary">
|
||||
Select the platform for which you need to create this campaign.
|
||||
@@ -143,7 +143,7 @@ const AddNews = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Image
|
||||
Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
@@ -213,7 +213,7 @@ const AddNews = () => {
|
||||
</FormLabel>
|
||||
<Input
|
||||
{...register("meta_description")}
|
||||
placeholder="Sub Heading"
|
||||
placeholder="Sub heading"
|
||||
className="web-text-medium"
|
||||
size="sm"
|
||||
/>
|
||||
@@ -357,7 +357,7 @@ const AddNews = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ const News = () => {
|
||||
// ====================================================[Table Setup]================================================================
|
||||
const tableHeadRow = [
|
||||
"Title",
|
||||
"Discription",
|
||||
"Description",
|
||||
"Content",
|
||||
"Release Data",
|
||||
"Active",
|
||||
@@ -132,7 +132,7 @@ const News = () => {
|
||||
return {
|
||||
Title:
|
||||
<RouterLink to={`view/${item.id}`}>{item?.title}</RouterLink>,
|
||||
Discription: (
|
||||
Description: (
|
||||
<Tooltip
|
||||
className="rounded-2 web-text-xsmall"
|
||||
width={"fit-content"}
|
||||
@@ -235,7 +235,7 @@ const News = () => {
|
||||
<>
|
||||
<TabularView
|
||||
title={"News"}
|
||||
btnTitle={"Create videos"}
|
||||
btnTitle={"Create news"}
|
||||
link={"/news/add-news"}
|
||||
apiData={news}
|
||||
tableHeadRow={tableHeadRow}
|
||||
|
||||
@@ -48,7 +48,7 @@ const ViewNews = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
News banner image
|
||||
News Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
|
||||
@@ -320,7 +320,7 @@ const AddPartner = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ const AddPolicy = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ const AddTerms = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ const AddUseCase = () => {
|
||||
}
|
||||
className="web-text-small"
|
||||
>
|
||||
If discription crosses 160 characters it will cause problem in SEO
|
||||
If description crosses 160 characters it will cause problem in SEO
|
||||
optimisation.you have entered {metaDescription.length} characters
|
||||
</FormHelperText>
|
||||
|
||||
@@ -422,7 +422,7 @@ const AddUseCase = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
@@ -515,7 +515,7 @@ const AddUseCase = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ const EditUseCase = () => {
|
||||
fontWeight={metaDescription.length > 160 ? "bold" : ""}
|
||||
className="web-text-small"
|
||||
>
|
||||
If discription crosses 160 characters it will cause problem in SEO
|
||||
If description crosses 160 characters it will cause problem in SEO
|
||||
optimisation.you have entered {metaDescription.length} characters
|
||||
</FormHelperText>
|
||||
|
||||
@@ -424,7 +424,7 @@ const EditUseCase = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
@@ -517,7 +517,7 @@ const EditUseCase = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ const Usecase = () => {
|
||||
const tableHeadRow = [
|
||||
// "Icon",
|
||||
"Title",
|
||||
"Discription",
|
||||
"Description",
|
||||
"Updated Date",
|
||||
"Active",
|
||||
"Created At",
|
||||
@@ -150,7 +150,7 @@ const Usecase = () => {
|
||||
</RouterLink>
|
||||
),
|
||||
// Title: <RouterLink to={`view/${item.id}`}>{item?.title}</RouterLink>,
|
||||
Discription: (
|
||||
Description: (
|
||||
<Tooltip
|
||||
className="rounded-2 web-text-xsmall"
|
||||
width={"fit-content"}
|
||||
|
||||
@@ -65,7 +65,7 @@ const ViewUseCase = () => {
|
||||
</Box>
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Usecase banner image
|
||||
Usecase Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
|
||||
@@ -111,7 +111,7 @@ const AddVideos = () => {
|
||||
<Box className="d-flex">
|
||||
<Box className="col-5 d-flex flex-column gap-2 pt-4">
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Info
|
||||
Banner info
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary">
|
||||
Select the platform for which you need to create this campaign.
|
||||
@@ -120,7 +120,7 @@ const AddVideos = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Banner Image
|
||||
Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
@@ -244,7 +244,7 @@ const AddVideos = () => {
|
||||
|
||||
<FormControl isRequired className="mb-3">
|
||||
<FormLabel className="web-text-large fw-bold rubix-text-dark">
|
||||
Tumbnail image
|
||||
Thumbnail image
|
||||
</FormLabel>
|
||||
{/* <ImageDropBox /> */}
|
||||
|
||||
@@ -330,7 +330,7 @@ const AddVideos = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ const Videos = () => {
|
||||
// ====================================================[Table Setup]================================================================
|
||||
const tableHeadRow = [
|
||||
"Title",
|
||||
"Discription",
|
||||
"Description",
|
||||
"Duration",
|
||||
"Active",
|
||||
"Created At",
|
||||
@@ -83,7 +83,7 @@ const Videos = () => {
|
||||
</Text></Box>
|
||||
</Link>
|
||||
),
|
||||
Discription: (
|
||||
Description: (
|
||||
<Tooltip
|
||||
className="rounded-2 web-text-xsmall"
|
||||
width={"fit-content"}
|
||||
|
||||
@@ -118,10 +118,10 @@ const AddWhitepapers = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Whitepaper banner image
|
||||
Whitepaper Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the whitepaper banner image that will be whitepaper on the community page.
|
||||
Below is the whitepaper Banner image that will be whitepaper on the community page.
|
||||
</span>
|
||||
|
||||
<Box
|
||||
@@ -294,7 +294,7 @@ const AddWhitepapers = () => {
|
||||
</span>
|
||||
)}
|
||||
<FormHelperText className="web-text-small">
|
||||
Maximum limit of image is 5mb.
|
||||
Maximum limit of image is 10MB.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ const ViewWhitePaper = () => {
|
||||
<Divider />
|
||||
|
||||
<span className="web-text-large fw-bold rubix-text-dark">
|
||||
Whitepaper banner image
|
||||
Whitepaper Banner image
|
||||
</span>
|
||||
<span className="web-text-medium text-secondary mb-4">
|
||||
Below is the profile that will be displayed on the community page.
|
||||
|
||||
@@ -18,12 +18,12 @@ export const addCommunitySchema = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -46,8 +46,10 @@ export const schemaEdit = Yup.object().shape({
|
||||
export const addCommunityBannerSchema = Yup.object().shape({
|
||||
heading: Yup.string().required("Name is required"),
|
||||
sub_heading: Yup.string().required("Designation is required"),
|
||||
CTO_button_title: Yup.string().required("Description is required"),
|
||||
CTO_button_link: Yup.string().required("Linked In link is required"),
|
||||
CTO_button_title: Yup.string().required("Description is required"),
|
||||
CTO_button_link: Yup.string()
|
||||
.url("Invalid LinkedIn URL")
|
||||
.required("LinkedIn is required"),
|
||||
banner_image: Yup.mixed()
|
||||
.test("required", "You need to provide a file", (files) => {
|
||||
// return file && file.size <-- u can use this if you don't want to allow empty files to be uploaded;
|
||||
@@ -56,12 +58,12 @@ export const addCommunityBannerSchema = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -88,6 +90,70 @@ export const addBlogSchema = Yup.object().shape({
|
||||
meta_description: Yup.string().required("Description is required"),
|
||||
content: Yup.string(),
|
||||
summary: Yup.string().required("Summary is required"),
|
||||
profile_image:Yup.mixed()
|
||||
.test("required", "You need to provide a file", (files) => {
|
||||
// return file && file.size <-- u can use this if you don't want to allow empty files to be uploaded;
|
||||
if (files) return true;
|
||||
return false;
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
)
|
||||
.test("file_formate", "Image file has unsupported format.", (files) => {
|
||||
// // console.log(files[0].type)
|
||||
|
||||
const SUPPORTED_FORMATS = [
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/png",
|
||||
// "image/gif",
|
||||
"image/tiff",
|
||||
"image/svg+xml",
|
||||
];
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.optional(),
|
||||
content_image_large:Yup.mixed()
|
||||
.test("required", "You need to provide a file", (files) => {
|
||||
// return file && file.size <-- u can use this if you don't want to allow empty files to be uploaded;
|
||||
if (files) return true;
|
||||
return false;
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export const addNews = Yup.object().shape({
|
||||
@@ -103,12 +169,12 @@ export const addNews = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -128,7 +194,7 @@ export const addNews = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -152,12 +218,12 @@ export const editNews = Yup.object().shape({
|
||||
})
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -177,7 +243,7 @@ export const editNews = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -208,12 +274,12 @@ export const addEvents = Yup.object().shape({
|
||||
})
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -233,7 +299,7 @@ export const addEvents = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -254,12 +320,12 @@ export const addWhitePapers = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -280,7 +346,7 @@ export const addWhitePapers = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -297,12 +363,12 @@ export const addWhitePapers = Yup.object().shape({
|
||||
// })
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -324,7 +390,7 @@ export const addWhitePapers = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -334,7 +400,7 @@ export const addWhitePapers = Yup.object().shape({
|
||||
// })
|
||||
});
|
||||
|
||||
// test("fileSize", "Image must be at least 15MB", (value) => {
|
||||
// test("fileSize", "Image must be at least 10MB", (value) => {
|
||||
// if (!value) return true;
|
||||
// const fileSizeInBytes = value.size;
|
||||
// const fileSizeInMB = fileSizeInBytes / (1024 * 1024);
|
||||
@@ -353,12 +419,12 @@ export const addVideos = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -388,12 +454,12 @@ export const addUsecase = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -410,11 +476,11 @@ export const addUsecase = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -441,12 +507,12 @@ export const editUsecase = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
//if u want to allow only certain file sizes
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -463,11 +529,11 @@ export const editUsecase = Yup.object().shape({
|
||||
})
|
||||
.test(
|
||||
"fileSize",
|
||||
" The maximum size of profile picture is 15MB.",
|
||||
" The maximum size of profile picture is 10MB.",
|
||||
(files) => {
|
||||
try {
|
||||
if (files.length !== 0) {
|
||||
return files[0].size <= 15000000;
|
||||
return files[0].size <= 10000000;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
@@ -490,12 +556,12 @@ export const addTerms = Yup.object().shape({
|
||||
// })
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -517,7 +583,7 @@ export const addTerms = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -538,12 +604,12 @@ export const addPolicy = Yup.object().shape({
|
||||
// })
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -565,7 +631,7 @@ export const addPolicy = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -586,12 +652,12 @@ export const addPartnerCard = Yup.object().shape({
|
||||
// })
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -613,7 +679,7 @@ export const addPartnerCard = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
@@ -634,12 +700,12 @@ export const addFaq = Yup.object().shape({
|
||||
// })
|
||||
// .test(
|
||||
// "fileSize",
|
||||
// " The maximum size of profile picture is 15MB.",
|
||||
// " The maximum size of profile picture is 10MB.",
|
||||
// (files) => {
|
||||
// //if u want to allow only certain file sizes
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// return files[0].size <= 15000000;
|
||||
// return files[0].size <= 10000000;
|
||||
// }
|
||||
// return true;
|
||||
// } catch (error) {
|
||||
@@ -661,7 +727,7 @@ export const addFaq = Yup.object().shape({
|
||||
// ];
|
||||
// try {
|
||||
// if (files.length !== 0) {
|
||||
// setPreviewImage(URL.createObjectURL(files[0]));
|
||||
//
|
||||
// return files && SUPPORTED_FORMATS.includes(files[0].type);
|
||||
// }
|
||||
// return true;
|
||||
|
||||
Reference in New Issue
Block a user