banner update

This commit is contained in:
2024-05-08 12:53:53 +05:30
parent 3e1714cf39
commit e299449b0c
6 changed files with 40 additions and 17 deletions

View File

@@ -12,7 +12,7 @@ const BannerStack = ({
viewBannerLink,
}) => {
return (
<Box>
<Box >
<HStack
display={"flex"}
justifyContent={"space-between"}
@@ -44,6 +44,7 @@ const BannerStack = ({
w={"100%"}
// h={"auto"}
h={200}
ps={1}
>
{bannerIsLoading
? Array.from({ length: 4 }).map((_, index) => (

View File

@@ -22,6 +22,12 @@ const Header = ({ link, btnTitle, title }) => {
{title}
</Text>
{/* <Text fontWeight='bold' bgGradient='linear(to-l, #A5626D, #331E8C)' bgClip='text' as={"span"} className="fs-6 ">
{title}
</Text> */}
{btnTitle && link && (
<Link to={link}>
<Button

View File

@@ -131,7 +131,8 @@ const DashboardLayout = () => {
width: isDrawerOpen || openDrawerClick ? 225 : 66,
transition: "width 0.3s ease-in-out", // Smooth transition for width change
overflow: "hidden", // Hide overflow to prevent content overflow during transition
backgroundColor:"#FAFBFC"
// backgroundColor:"#FAFBFC"
backgroundColor:"#F7FAFC"
}}
>
<div className="d-flex justify-content-start p-3 pt-3 pb-4 position-relative">

View File

@@ -1,4 +1,4 @@
import { Box, Button, Card, CardBody, CardHeader, Heading, Text } from "@chakra-ui/react";
import { Box, Button, Card, CardBody, CardHeader, Heading, Image, Text } from "@chakra-ui/react";
import React from "react";
import WebButton from "../../Components/WebButton";
import { formatDate } from "../../Components/Functions/UTCConvertor";
@@ -6,36 +6,47 @@ import { formatDate } from "../../Components/Functions/UTCConvertor";
const CommunityBannerCard = ({ bgImage, subHeading, heading, ctoBtnTitle, createdAt }) => {
return (
<Card
bgImage={`https://rubix.betadelivery.com/${bgImage}`}
// bgImage={`https://rubix.betadelivery.com/${bgImage}`}
color={'teal.900'}
bgSize="cover"
bgPosition="center"
w={"100%"}
h={"100%"}
size={"md"}
shadow={'md'}
boxShadow='md'
overflow={'hidden'}
position={'relative'}
rounded={"lg"}
>
<CardBody
position={'absolute'}
h={"60%"}
h={"100%"}
w={'100%'}
bottom={0}
backgroundColor={'#ffffffb4'}
backgroundColor={'#ffffff'}
backdropFilter='blur(1px)'
>
<Heading className="web-text-large " mb={0} size="md">{heading}</Heading>
<Box mb={0} display={"flex"} alignItems={"center"} w={250}>
<Box mb={0} display={'flex'} justifyContent={'space-between'} h={"100%"} w={"100%"}>
<Box display={"flex"} flexDirection={'column'} alignItems={"start"}>
<Heading className="web-text-large " mb={0} size="md">{heading}</Heading>
<Text className="web-text-medium" as={"span"} isTruncated={true}>
{subHeading}
</Text>
<Button fontWeight={"normal"} className="web-text-xsmall" ps={3} pe={3} color={'white'} bgGradient='linear(to-r, #1E114B, #1E114B)' variant={'solid'} rounded={'sm'} size={'xs'}>{ctoBtnTitle}</Button>
</Box>
<Box display={'flex'} alignItems={'center'}>
<Image boxShadow={'inner'} rounded={'sm'} w={140} h={"80px"} src={`https://rubix.betadelivery.com/${bgImage}`} />
</Box>
</Box>
<Button colorScheme="teal" rounded={'sm'} size={'xs'}>{ctoBtnTitle}</Button>
</CardBody>
<span

View File

@@ -49,12 +49,7 @@ export const addNews = Yup.object().shape({
release_date: Yup.date().required("Release date is required"),
meta_description: Yup.string().required("Description is required"),
content: Yup.string().required("Content is required"),
banner_image: Yup.mixed().test("fileSize", "Image must be at least 2MB", (value) => {
if (!value) return true;
const fileSizeInBytes = value.size;
const fileSizeInMB = fileSizeInBytes / (1024 * 1024);
return fileSizeInMB >= 10;
}).required("Banner image is required"),
banner_image: Yup.mixed().required("Banner image is required"),
});
export const editNews = Yup.object().shape({
@@ -62,5 +57,14 @@ export const editNews = Yup.object().shape({
release_date: Yup.date(),
meta_description: Yup.string(),
content: Yup.string(),
banner_image: Yup.mixed()
banner_image: Yup.mixed().required("Banner image is required"),
});
// test("fileSize", "Image must be at least 2MB", (value) => {
// if (!value) return true;
// const fileSizeInBytes = value.size;
// const fileSizeInMB = fileSizeInBytes / (1024 * 1024);
// return fileSizeInMB >= 10;
// })

BIN
src/assets/Ellipse.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB