Files
rubix-admin-panel/src/Pages/Community/CommunityBannerCard.jsx

184 lines
4.3 KiB
React
Raw Normal View History

2024-05-08 17:33:10 +05:30
import {
Badge,
Box,
Button,
Card,
CardBody,
CardHeader,
Heading,
Image,
Text,
2024-05-17 19:01:20 +05:30
Tooltip,
2024-05-08 17:33:10 +05:30
} from "@chakra-ui/react";
2024-05-07 12:47:06 +05:30
import React from "react";
import WebButton from "../../Components/WebButton";
import { formatDate } from "../../Components/Functions/UTCConvertor";
2024-05-08 17:33:10 +05:30
const CommunityBannerCard = ({
bgImage,
subHeading,
heading,
ctoBtnTitle,
createdAt,
status,
}) => {
2024-05-07 12:47:06 +05:30
return (
<Card
2024-05-08 12:53:53 +05:30
// bgImage={`https://rubix.betadelivery.com/${bgImage}`}
2024-05-08 17:33:10 +05:30
color={"teal.900"}
2024-05-07 12:47:06 +05:30
bgSize="cover"
bgPosition="center"
w={"100%"}
h={"100%"}
size={"md"}
2024-05-08 17:33:10 +05:30
// boxShadow="md"
2024-05-21 20:21:30 +05:30
// overflow={"hidden"}
2024-05-08 17:33:10 +05:30
position={"relative"}
2024-05-21 20:21:30 +05:30
// rounded={"lg"}
2024-05-17 19:01:20 +05:30
boxShadow={
" rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px"
}
2024-05-21 20:21:30 +05:30
borderRadius={8.5}
2024-05-07 12:47:06 +05:30
>
2024-05-08 17:33:10 +05:30
<CardBody
position={"absolute"}
h={"100%"}
w={"100%"}
bottom={0}
2024-05-21 20:21:30 +05:30
// border={"1px solid #9B4651"}
borderRadius={8}
overflow={"hidden"}
backgroundColor={"#101015"}
2024-05-08 17:33:10 +05:30
// backgroundColor={status ? "#ffe5ea": '#ffffff'}
backdropFilter="blur(1px)"
2024-05-07 12:47:06 +05:30
>
2024-05-17 19:01:20 +05:30
{status ? (
<Badge
position={"absolute"}
top={2}
right={-2}
pe={3}
colorScheme="green"
>
Active
</Badge>
) : (
<Badge
position={"absolute"}
top={2}
right={-2}
pe={3}
colorScheme="red"
>
Inactive
</Badge>
)}
2024-05-07 12:47:06 +05:30
2024-05-08 17:33:10 +05:30
<Box
mb={0}
display={"flex"}
justifyContent={"space-between"}
h={"100%"}
w={"100%"}
>
2024-05-17 19:01:20 +05:30
<Box
w={40}
display={"flex"}
flexDirection={"column"}
alignItems={"start"}
>
<Tooltip
className="rounded-2 web-text-xsmall"
width={"fit-content"}
placement="top"
hasArrow
label={heading}
bg="blue.200"
>
<Box
display={"flex"}
className="web-text-large fw-bold"
alignItems={"center"}
w={"100%"}
>
2024-05-21 20:21:30 +05:30
<Text color={"#DE858E"} as={"span"} isTruncated={true}>
2024-05-17 19:01:20 +05:30
{heading}
</Text>
</Box>
</Tooltip>
2024-05-08 12:53:53 +05:30
2024-05-17 19:01:20 +05:30
<Box
display={"flex"}
className="web-text-large fw-bold"
alignItems={"center"}
w={180}
>
<Tooltip
className="rounded-2 web-text-xsmall"
width={"fit-content"}
placement="top"
hasArrow
label={subHeading}
bg="blue.200"
>
<Text
className="web-text-medium"
as={"span"}
isTruncated={true}
2024-05-21 20:21:30 +05:30
color={'whitesmoke'}
2024-05-17 19:01:20 +05:30
>
{subHeading}
</Text>
</Tooltip>
</Box>
2024-05-22 00:16:29 +05:30
<Box
2024-05-21 20:21:30 +05:30
fontWeight={"normal"}
2024-05-08 17:33:10 +05:30
className="web-text-xsmall"
ps={3}
pe={3}
pt={1}
pb={1}
mt={2}
2024-05-21 20:21:30 +05:30
color={"#ffffff"}
2024-05-08 17:33:10 +05:30
// bg={'#1E114B'}
2024-05-21 20:21:30 +05:30
bgGradient="linear(to-r, #1E114B, purple)"
2024-05-08 17:33:10 +05:30
variant={"outline"}
2024-05-21 20:21:30 +05:30
// colorScheme="purple"
2024-05-08 17:33:10 +05:30
rounded={"md"}
size={"xs"}
2024-05-21 20:21:30 +05:30
border={'none'}
2024-05-08 17:33:10 +05:30
>
{ctoBtnTitle}
2024-05-22 00:16:29 +05:30
</Box>
2024-05-07 12:47:06 +05:30
</Box>
2024-05-08 17:33:10 +05:30
<Box display={"flex"} alignItems={"center"}>
<Image
boxShadow={"inner"}
rounded={"md"}
2024-05-17 19:01:20 +05:30
w={130}
h={"75px"}
2024-05-08 17:33:10 +05:30
src={`https://rubix.betadelivery.com/${bgImage}`}
/>
</Box>
</Box>
2024-05-07 12:47:06 +05:30
</CardBody>
2024-05-08 17:33:10 +05:30
<span
2024-05-22 00:16:29 +05:30
className="web-text-xsmall text-secondary fw-bold"
2024-05-08 17:33:10 +05:30
style={{
position: "absolute",
bottom: 4,
right: 10,
opacity: 0.5,
}}
>
{formatDate(createdAt)}
</span>
2024-05-07 12:47:06 +05:30
</Card>
);
};
export default CommunityBannerCard;