mirror of
https://github.com/WDI-Ideas/rubix.git
synced 2026-04-29 02:55:51 +00:00
Blogs api/ Community Banner api/ New api integration
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
/* eslint-disable react/prop-types */
|
||||
/* eslint-disable react/no-unknown-property */
|
||||
import { Box, Button, Container, Text } from "@chakra-ui/react";
|
||||
import banner from "../../assets/images/communityBanner.webp";
|
||||
import { useGetCommunitiesBannerQuery } from "../../Redux/slice/communityBannerSlice";
|
||||
|
||||
const BannerContent = [
|
||||
{
|
||||
@@ -19,10 +21,20 @@ const BannerContent = [
|
||||
];
|
||||
|
||||
const CommunityBanner = ({ onClick }) => {
|
||||
const { data } = useGetCommunitiesBannerQuery();
|
||||
const content = data?.data.rows;
|
||||
// const loop = () => {
|
||||
// blogPosts.map((item) => {
|
||||
// console.log(item);
|
||||
// });
|
||||
// };
|
||||
// loop();
|
||||
console.log(content);
|
||||
|
||||
return (
|
||||
<Box
|
||||
height={"100vh"}
|
||||
backgroundImage={`url(${banner})`}
|
||||
backgroundImage={`url(https://rubix.betadelivery.com/${content?.[1]?.banner_image})`}
|
||||
backgroundRepeat={"no-repeat"}
|
||||
backgroundSize={"cover"}
|
||||
display={"grid"}
|
||||
@@ -53,7 +65,7 @@ const CommunityBanner = ({ onClick }) => {
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
width={"75%"}
|
||||
width={"100%"}
|
||||
sx={{
|
||||
"@media (max-width: 500px)": {
|
||||
width: "100%",
|
||||
@@ -84,7 +96,7 @@ const CommunityBanner = ({ onClick }) => {
|
||||
color: "#fff",
|
||||
}}
|
||||
>
|
||||
{BannerContent[0].heading1}
|
||||
{content?.[1]?.Heading}
|
||||
</span>
|
||||
<br
|
||||
sx={{
|
||||
@@ -94,7 +106,7 @@ const CommunityBanner = ({ onClick }) => {
|
||||
},
|
||||
}}
|
||||
/>
|
||||
{BannerContent[0].heading2}
|
||||
{/* {BannerContent[0].heading2} */}
|
||||
</Text>
|
||||
<Box
|
||||
marginTop={"1.5rem"}
|
||||
@@ -122,7 +134,7 @@ const CommunityBanner = ({ onClick }) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
{BannerContent[1].subheading}
|
||||
{content?.[1]?.sub_heading}
|
||||
</Text>
|
||||
</Box>
|
||||
<Button
|
||||
@@ -181,7 +193,7 @@ const CommunityBanner = ({ onClick }) => {
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
{BannerContent[2].btn}
|
||||
{content?.[1]?.CTO_button_title}
|
||||
</Button>
|
||||
</Box>
|
||||
</Container>
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
SimpleGrid,
|
||||
Text,
|
||||
} from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
import React, { useState } from "react";
|
||||
import CommCard from "../Card/CommCard";
|
||||
import imgOne from "../../assets/images/Component115.png";
|
||||
import imgtwo from "../../assets/images/Component116.png";
|
||||
@@ -28,6 +28,7 @@ import imgtweleve from "../../assets/images/kiran.jpg";
|
||||
import { useEffect } from "react";
|
||||
import axios from "axios";
|
||||
import { useGetCommunitiesQuery } from "../../Redux/slice/communitySlice";
|
||||
import Loader from "../Loader/Loader";
|
||||
|
||||
const individuals = [
|
||||
{
|
||||
@@ -129,78 +130,81 @@ const individuals = [
|
||||
];
|
||||
|
||||
const CommunityCard = () => {
|
||||
// const { data, error, isLoading } = useGetCommunitiesQuery();
|
||||
|
||||
useEffect(() => {
|
||||
// async function fetchData() {
|
||||
// try {
|
||||
// const response = await axios.get(
|
||||
// "https://rubix.betadelivery.com/api/admin/community"
|
||||
// );
|
||||
// console.log(response.data.data.rows);
|
||||
// } catch (error) {
|
||||
// // Handle errors
|
||||
// console.error("Error fetching data:", error.message);
|
||||
// }
|
||||
// }
|
||||
// // Call the fetchData function to initiate the request
|
||||
// fetchData();
|
||||
}, []);
|
||||
const { data, error, isLoading } = useGetCommunitiesQuery();
|
||||
const [state, setState] = useState();
|
||||
const profile = data?.data?.data;
|
||||
console.log(data?.data?.data);
|
||||
useEffect(() => {}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box backgroundColor={"#101015"}>
|
||||
<Container
|
||||
maxW={"1200px"}
|
||||
padding={"0rem"}
|
||||
paddingBottom={"6rem"}
|
||||
sx={{
|
||||
"@media (max-width: 1024px)": {
|
||||
padding: "3rem",
|
||||
},
|
||||
"@media (max-width: 435px)": {},
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
as={"h2"}
|
||||
paddingTop={"4rem"}
|
||||
paddingBottom={"4rem"}
|
||||
fontWeight={700}
|
||||
fontSize={"38px"}
|
||||
textAlign={"center"}
|
||||
textTransform={"capitalize"}
|
||||
color={"#fff"}
|
||||
id="rubix-community"
|
||||
{isLoading ? (
|
||||
<Loader />
|
||||
) : (
|
||||
<Box backgroundColor={"#101015"}>
|
||||
<Container
|
||||
maxW={"1200px"}
|
||||
padding={"0rem"}
|
||||
paddingBottom={"6rem"}
|
||||
sx={{
|
||||
"@media (max-width: 435px)": {
|
||||
fontSize: "35px",
|
||||
},
|
||||
"@media (max-width: 375px)": {
|
||||
fontSize: "28px",
|
||||
textAlign: "center",
|
||||
"@media (max-width: 1024px)": {
|
||||
padding: "3rem",
|
||||
},
|
||||
"@media (max-width: 435px)": {},
|
||||
}}
|
||||
>
|
||||
Rubix Community
|
||||
</Text>
|
||||
<SimpleGrid
|
||||
spacing={"50px"}
|
||||
templateColumns="repeat(auto-fill, minmax(230px, 1fr))"
|
||||
>
|
||||
{individuals.map((item) => (
|
||||
<CommCard
|
||||
key={item.id}
|
||||
location={item.location}
|
||||
name={item.name}
|
||||
jobTitle={item.jobTitle}
|
||||
description={item.description}
|
||||
imageUrl={item.imageUrl}
|
||||
link={item.link}
|
||||
/>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</Container>
|
||||
</Box>
|
||||
<Text
|
||||
as={"h2"}
|
||||
paddingTop={"4rem"}
|
||||
paddingBottom={"4rem"}
|
||||
fontWeight={700}
|
||||
fontSize={"38px"}
|
||||
textAlign={"center"}
|
||||
textTransform={"capitalize"}
|
||||
color={"#fff"}
|
||||
id="rubix-community"
|
||||
sx={{
|
||||
"@media (max-width: 435px)": {
|
||||
fontSize: "35px",
|
||||
},
|
||||
"@media (max-width: 375px)": {
|
||||
fontSize: "28px",
|
||||
textAlign: "center",
|
||||
},
|
||||
}}
|
||||
>
|
||||
Rubix Community
|
||||
</Text>
|
||||
<SimpleGrid
|
||||
spacing={"50px"}
|
||||
templateColumns="repeat(auto-fill, minmax(230px, 1fr))"
|
||||
>
|
||||
{/* {individuals.map((item) => (
|
||||
<CommCard
|
||||
key={item.id}
|
||||
location={item.location}
|
||||
name={item.name}
|
||||
jobTitle={item.jobTitle}
|
||||
description={item.description}
|
||||
imageUrl={item.imageUrl}
|
||||
link={item.link}
|
||||
item.profile_image
|
||||
/>
|
||||
))} */}
|
||||
{profile.map((item) => (
|
||||
<CommCard
|
||||
key={item.id}
|
||||
description={item.description}
|
||||
designation={item.designation}
|
||||
name={item.member_name}
|
||||
img={`https://rubix.betadelivery.com/${item.profile_image}`}
|
||||
link={item.linkedin}
|
||||
/>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</Container>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user