From 0d5be7fe565137f16d4e6005baedee6d35eb684d Mon Sep 17 00:00:00 2001 From: rockyeverlast Date: Thu, 6 Jun 2024 13:47:57 +0530 Subject: [PATCH] fix for blog and banner pages --- src/components/BlogPost/BlogPost.jsx | 4 ++-- src/components/BuildPage/BuildBanner.jsx | 24 ++++++++++--------- src/components/Community/CommunityBanner.jsx | 25 +++++++++++--------- src/components/EcoPage/EcoBanner.jsx | 20 ++++++++++++---- src/components/Footer/Footer.jsx | 4 +++- src/components/Footer/MobileFooter.jsx | 4 ++-- src/components/HomePage/HomeBanner.jsx | 14 +++++++++-- src/components/LearnPage/LearnBanner.jsx | 17 +++++++++---- src/components/MobileMenu/MobileMenu.jsx | 4 ++-- 9 files changed, 76 insertions(+), 40 deletions(-) diff --git a/src/components/BlogPost/BlogPost.jsx b/src/components/BlogPost/BlogPost.jsx index 0d14055..381b987 100644 --- a/src/components/BlogPost/BlogPost.jsx +++ b/src/components/BlogPost/BlogPost.jsx @@ -71,11 +71,11 @@ const BlogPost = () => { > { + const highlightFirstPart = (heading) => { + const words = heading.split(" "); + const firstThreeWords = words.slice(0, 3).join(" "); + const rest = words.slice(3).join(" "); + return `${firstThreeWords} ${rest}`; + }; + if (isLoading) { return (
@@ -82,7 +89,8 @@ const BuildBanner = ({ data, isLoading }) => { fontWeight={700} fontSize={"52px"} textTransform={"capitalize"} - color={"#DE858E"} + // color={"#DE858E"} + color={"#fff"} lineHeight={"62px"} letterSpacing={"1px"} sx={{ @@ -95,16 +103,10 @@ const BuildBanner = ({ data, isLoading }) => { lineHeight: "54px", }, }} - > - {item.Heading}
- {/* - {BannerContent[0].heading2} - */} - + dangerouslySetInnerHTML={{ + __html: highlightFirstPart(item.Heading), + }} + /> { const { data } = useGetCommunitiesBannerQuery(); const content = data?.data.rows; const filteredContent = content?.filter((item) => item.status === true); - console.log(filteredContent); + // console.log(filteredContent); + + const highlightFirstPart = (heading) => { + const words = heading.split(" "); + const firstThreeWords = words.slice(0, 3).join(" "); + const rest = words.slice(3).join(" "); + return `${firstThreeWords} ${rest}`; + }; return ( <> @@ -79,7 +86,8 @@ const CommunityBanner = ({ onClick }) => { fontWeight={700} fontSize={"52px"} // textTransform={"upperCase"} - color={"#DE858E"} + // color={"#DE858E"} + color={"#fff"} lineHeight={"62px"} letterSpacing={"1px"} width={"65%"} @@ -94,15 +102,10 @@ const CommunityBanner = ({ onClick }) => { width: "100%", }, }} - > - - {item.Heading} - - + dangerouslySetInnerHTML={{ + __html: highlightFirstPart(item.Heading), + }} + /> { const { data, isLoading, error } = useGetEcoSystemQuery(); const dataHeader = data?.data?.data; - console.log(dataHeader); + // console.log(dataHeader); + + const highlightFirstPart = (heading) => { + const words = heading.split(" "); + const firstThreeWords = words.slice(0, 3).join(" "); + const rest = words.slice(3).join(" "); + return `${firstThreeWords} ${rest}`; + }; + if (isLoading) { return (
@@ -79,7 +87,8 @@ const EcoBanner = () => { fontWeight={700} fontSize={"52px"} textTransform={"Capitalize"} - color={"#DE858E"} + // color={"#DE858E"} + color={"#fff"} lineHeight={"62px"} letterSpacing={"1px"} sx={{ @@ -92,9 +101,10 @@ const EcoBanner = () => { lineHeight: "54px", }, }} - > - {item.Heading} - + dangerouslySetInnerHTML={{ + __html: highlightFirstPart(item.Heading), + }} + /> { > Wallet - Careers + + Careers + diff --git a/src/components/Footer/MobileFooter.jsx b/src/components/Footer/MobileFooter.jsx index 3be37fa..6c5fa1d 100644 --- a/src/components/Footer/MobileFooter.jsx +++ b/src/components/Footer/MobileFooter.jsx @@ -48,7 +48,7 @@ const MobileFooter = () => { @@ -99,7 +99,7 @@ const MobileFooter = () => { diff --git a/src/components/HomePage/HomeBanner.jsx b/src/components/HomePage/HomeBanner.jsx index 9c8c08a..97da448 100644 --- a/src/components/HomePage/HomeBanner.jsx +++ b/src/components/HomePage/HomeBanner.jsx @@ -26,6 +26,13 @@ const HomeBanner = () => { console.log(data); const HomeBanner = data?.data?.data; + const highlightFirstPart = (heading) => { + const words = heading.split(" "); + const firstThreeWords = words.slice(0, 3).join(" "); + const rest = words.slice(3).join(" "); + return `${firstThreeWords} ${rest}`; + }; + if (isLoading) { return (
@@ -87,7 +94,8 @@ const HomeBanner = () => { fontWeight={700} fontSize={"52px"} textTransform={"upperCase"} - color={"#DE858E"} + // color={"#DE858E"} + color={"#fff"} lineHeight={"62px"} // letterSpacing={"1px"} sx={{ @@ -103,7 +111,9 @@ const HomeBanner = () => { marginTop: "1rem", }, }} - dangerouslySetInnerHTML={{ __html: item.Heading }} + dangerouslySetInnerHTML={{ + __html: highlightFirstPart(item.Heading), + }} /> { const { data, isLoading, error } = useGetLearnPageQuery(); const learnData = data?.data?.data; + const highlightFirstPart = (heading) => { + const words = heading.split(" "); + const firstThreeWords = words.slice(0, 3).join(" "); + const rest = words.slice(3).join(" "); + return `${firstThreeWords} ${rest}`; + }; + if (isLoading) { return (
@@ -91,7 +98,8 @@ const LearnBanner = () => { fontWeight={700} fontSize={"52px"} textTransform={"Capitalize"} - color={"#DE858E"} + // color={"#DE858E"} + color={"#fff"} lineHeight={"62px"} letterSpacing={"1px"} sx={{ @@ -104,9 +112,10 @@ const LearnBanner = () => { lineHeight: "54px", }, }} - > - {item.Heading} - + dangerouslySetInnerHTML={{ + __html: highlightFirstPart(item.Heading), + }} + /> { {useCase?.map((slug) => (