diff --git a/src/components/NavBar/NavBar.jsx b/src/components/NavBar/NavBar.jsx
index a271dd5..66328e0 100644
--- a/src/components/NavBar/NavBar.jsx
+++ b/src/components/NavBar/NavBar.jsx
@@ -45,6 +45,7 @@ const NavBar = () => {
const { data } = useGetUseCaseQuery();
// console.log(data);
const useCase = data?.data?.rows;
+ console.log(useCase);
const location = useLocation();
const linkStyle = {
@@ -496,7 +497,7 @@ const NavBar = () => {
borderRadius={"10px"}
border={"none"}
padding={"1rem"}
- width={"60%"}
+ width={useCase?.length > 1 ? "50%" : "auto"}
margin={"0 auto"}
_focus={{
boxShadow: "none",
@@ -551,6 +552,7 @@ const NavBar = () => {
diff --git a/src/components/ResourcesPage/Content.jsx b/src/components/ResourcesPage/Content.jsx
index 3380c4c..f84099f 100644
--- a/src/components/ResourcesPage/Content.jsx
+++ b/src/components/ResourcesPage/Content.jsx
@@ -5,8 +5,11 @@ import TabsVideo from "./tabInsideContent/TabsVideo";
import WhitepaperDocs from "./tabInsideContent/WhitepaperDocs";
import ArticlesTable from "./tableContent/ArticlesTable";
import VideoTable from "./tableContent/VideoTable";
+import { useParams } from "react-router-dom";
const Content = ({ tab }) => {
+ const { tabs } = useParams();
+
switch (tab) {
case "The Rubix whitepapers":
return (
diff --git a/src/components/ResourcesPage/tabInsideContent/TabsArticles.jsx b/src/components/ResourcesPage/tabInsideContent/TabsArticles.jsx
index dde6189..93963d0 100644
--- a/src/components/ResourcesPage/tabInsideContent/TabsArticles.jsx
+++ b/src/components/ResourcesPage/tabInsideContent/TabsArticles.jsx
@@ -1,66 +1,110 @@
+/* eslint-disable no-unused-vars */
import { Badge, Box, Image, Text } from "@chakra-ui/react";
import pic from "../../../assets/images/eventsPic.png";
+import { useState } from "react";
+import { useGetBlogQuery } from "../../../Redux/slice/blogsSlice";
+import Loader from "../../Loader/Loader";
+import { Swiper, SwiperSlide } from "swiper/react";
+import { Autoplay, Navigation, Pagination } from "swiper/modules";
const TabsArticles = () => {
+ const [currentPage, setCurrentPage] = useState(1);
+ const pageSize = 5;
+
+ const { data, isLoading, error } = useGetBlogQuery({
+ page: currentPage,
+ pageSize,
+ });
+
+ if (isLoading) {
+ return (
+
+
+
+ );
+ }
+
+ if (error) {
+ return Error: {error.message}
;
+ }
+
+ const articles = data?.data?.rows;
+ console.log(articles);
return (
- <>
-
+ Newest Post
+
- Newest Post
-
-
-
-
-
- (
+
+
- News & Article
-
-
- The Proofchain Technical Whitepaper
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et
- massa mi. Aliquam in hendrerit urna. Pellentesque sit amet sapien
- fringilla, mattis ligula consectetur, ultrices mauris. Maecenas
- vitae,Aliquam in hendrerit urna. Pellentesque sit amet sapien
- fringilla, mattis ligula consectetur, ultrices mauris. Maecenas
- vitae,Aliquam in hendrerit urna. Pellentesque sit amet sapien
- fringilla, mattis ligula consectetur, ultrices mauris. Maecenas
- vitae
-
-
-
-
- >
+
+
+
+
+
+ Video : {item.read_time}
+
+
+ {item.title}
+
+ {item.summary}
+
+
+
+ ))}
+
+
);
};
diff --git a/src/components/ResourcesPage/tabInsideContent/TabsVideo.jsx b/src/components/ResourcesPage/tabInsideContent/TabsVideo.jsx
index d8b639c..97e26e1 100644
--- a/src/components/ResourcesPage/tabInsideContent/TabsVideo.jsx
+++ b/src/components/ResourcesPage/tabInsideContent/TabsVideo.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
import { Badge, Box, Image, Text } from "@chakra-ui/react";
import pic1 from "../../../assets/images/eventsPic.png";
import pic2 from "../../../assets/images/BuildBanner.webp";
@@ -9,6 +10,10 @@ import "swiper/css/pagination";
import "swiper/css/navigation";
import { Navigation, Pagination, Autoplay } from "swiper/modules";
+import Loader from "../../Loader/Loader";
+import { useGetVideoQuery } from "../../../Redux/slice/whitePaperSlice";
+import { useState } from "react";
+import { Link } from "react-router-dom";
const videoTab = [
{
@@ -56,6 +61,30 @@ const videoTab = [
];
const TabsVideo = () => {
+ const [currentPage, setCurrentPage] = useState(1);
+ const pageSize = 5;
+
+ const { data, isLoading, error } = useGetVideoQuery({
+ page: currentPage,
+ pageSize,
+ });
+
+ if (isLoading) {
+ return (
+
+
+
+ );
+ }
+
+ if (error) {
+ return Error: {error.message}
;
+ }
+
+ const videos = data?.data?.data?.rows;
+ console.log(videos);
+
+ const title_slug = videos.map((item) => item.title_slug);
return (
{
}}
>
Newest Post
+
{
}}
loop={true}
>
- {videoTab.map((item) => (
+ {videos?.slice(0, 3).map((item) => (
-
-
-
+
+
+
+
+
+
+
+ Video : {item.duration} min
+
+
+ {item.title}
+
+ {item.description}
+
-
-
- {item.badge}
-
-
- {item.title}
-
- {item.descript}
-
-
+
))}
diff --git a/src/components/ResourcesPage/tabInsideContent/WhitepaperDocs.jsx b/src/components/ResourcesPage/tabInsideContent/WhitepaperDocs.jsx
index 67ccd84..ae05899 100644
--- a/src/components/ResourcesPage/tabInsideContent/WhitepaperDocs.jsx
+++ b/src/components/ResourcesPage/tabInsideContent/WhitepaperDocs.jsx
@@ -28,7 +28,7 @@ const WhitepaperDocs = () => {
return {console.log(error)}
;
}
- const docs = data?.data?.data;
+ const docs = data?.data?.data?.rows;
const totalPages = data?.data?.totalPages;
console.log(docs);
@@ -67,7 +67,7 @@ const WhitepaperDocs = () => {
>
{
const [currentPage, setCurrentPage] = useState(1);
- const itemsPerPage = 9;
- const totalPages = Math.ceil(contents.length / itemsPerPage);
+ const pageSize = 5;
- const handlePageChange = (newPage) => {
- setCurrentPage(newPage);
- window.scrollTo({ top: 0, behavior: "smooth" });
- };
+ const { data, isLoading, error } = useGetBlogQuery({
+ page: currentPage,
+ pageSize,
+ });
- const startIndex = (currentPage - 1) * itemsPerPage;
- const endIndex = Math.min(startIndex + itemsPerPage, contents.length);
- const currentPageContents = contents.slice(startIndex, endIndex);
+ if (isLoading) {
+ return (
+
+
+
+ );
+ }
+
+ if (error) {
+ return Error: {error.message}
;
+ }
+
+ const articles = data?.data?.rows;
+ console.log(articles);
+ const totalItems = data?.data?.data?.totalItems;
+ const totalPages = data?.data?.data?.totalPages;
+
+ function goToPage(page) {
+ if (page >= 1 && page <= totalPages) {
+ setCurrentPage(page);
+ }
+ }
+
+ // const [currentPage, setCurrentPage] = useState(1);
+ // const itemsPerPage = 9;
+ // const totalPages = Math.ceil(contents.length / itemsPerPage);
+
+ // const handlePageChange = (newPage) => {
+ // setCurrentPage(newPage);
+ // window.scrollTo({ top: 0, behavior: "smooth" });
+ // };
+
+ // const startIndex = (currentPage - 1) * itemsPerPage;
+ // const endIndex = Math.min(startIndex + itemsPerPage, contents.length);
+ // const currentPageContents = contents.slice(startIndex, endIndex);
return (
<>
@@ -83,7 +117,7 @@ const ArticlesTable = () => {
justifyContent={"space-between"}
alignItems={"center"}
>
- {currentPageContents.map((content) => (
+ {articles?.map((content) => (
<>
{
},
}}
>
-
+
{content.title}
@@ -131,7 +167,7 @@ const ArticlesTable = () => {
zIndex: "2",
}}
>
-
+
{
>
);
diff --git a/src/components/ResourcesPage/tableContent/VideoTable.jsx b/src/components/ResourcesPage/tableContent/VideoTable.jsx
index c6230ed..f5a5a63 100644
--- a/src/components/ResourcesPage/tableContent/VideoTable.jsx
+++ b/src/components/ResourcesPage/tableContent/VideoTable.jsx
@@ -84,7 +84,7 @@ const VideoTable = () => {
}
const videos = data?.data?.data?.rows;
- console.log(videos);
+ // console.log(videos);
const totalItems = data?.data?.data?.totalItems;
const totalPages = data?.data?.data?.totalPages;
@@ -100,8 +100,8 @@ const VideoTable = () => {
margin={"4rem 0"}
display={"flex"}
flexWrap={"wrap"}
- rowGap={"2rem"}
- justifyContent={"space-between"}
+ gap={"2rem"}
+ justifyContent={"start"}
alignItems={"center"}
>
{videos.map((content) => (
@@ -119,17 +119,23 @@ const VideoTable = () => {
},
}}
>
-
-
+
+
{content.title}
+
+
+ Duration : {content.duration} min
+
{
zIndex: "2",
}}
>
-
+
-
{matchingUseCase.solution}
-
+ */}
+
*/}
- {matchingUseCase.attachments.map((item) => (
-
- {item ? (
-
- Use Cases
-
- ) : (
- ""
- )}
+ Use Cases
+
+ ) : (
+ ""
+ )}
+
+ {matchingUseCase.attachments.map((item) => (
-
- ))}
+ ))}
+
) : (
diff --git a/src/components/VideoInternal/VideoInternal.jsx b/src/components/VideoInternal/VideoInternal.jsx
index a21e82d..9f47ba4 100644
--- a/src/components/VideoInternal/VideoInternal.jsx
+++ b/src/components/VideoInternal/VideoInternal.jsx
@@ -2,8 +2,20 @@
import React, { useEffect, useState } from "react";
import { Box, Text, Image } from "@chakra-ui/react";
import { AspectRatio } from "@chakra-ui/react";
+import { useGetVideoQuery } from "../../Redux/slice/whitePaperSlice";
+import Loader from "../Loader/Loader";
+import { useParams } from "react-router-dom";
const VideoInternal = () => {
+ const { title_slug } = useParams();
+ const [currentPage, setCurrentPage] = useState(1);
+ const pageSize = 5;
+ const { data, isLoading, error } = useGetVideoQuery({
+ page: currentPage,
+ pageSize,
+ });
+
+ console.log(data);
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
useEffect(() => {
@@ -23,9 +35,32 @@ const VideoInternal = () => {
useEffect(() => {
window.scrollTo(0, 0);
}, []);
+
+ if (isLoading) {
+ return (
+
+
+
+ );
+ }
+
+ if (error) {
+ return Error: {error.message}
;
+ }
+
+ const videos = data?.data?.data?.rows;
+ // console.log(videos);
+
+ const matchingvideos = videos
+ ? videos.find((item) => item.title_slug === title_slug)
+ : null;
+
+ console.log(matchingvideos);
+
return (
<>
{
},
}}
>
- How is Rubix Changing the World?
+ {matchingvideos.title}
{
},
}}
>
- Videos January 5, 2023
+ Video duration : {matchingvideos.duration} min
{
},
}}
>
- Rubix’s technology may live on the web but it was designed to
- address real world problems like climate change, hunger and
- inequality. We select our partners with care. Every app built on the
- Rubix platform is designed to address a real world issue.
+ {matchingvideos.description}
@@ -130,7 +162,7 @@ const VideoInternal = () => {
}}
>
VIDEOVIDEO ,
},
{
- path: "resources-page",
+ path: "resources-page/:tabs?",
element: ,
},
{
- path: "video-page",
+ path: "video-page/:title_slug",
element: ,
},
{