From ce6c44ff360864070375fb6c7ef2e85ad3209905 Mon Sep 17 00:00:00 2001 From: benjacanas Date: Wed, 20 Apr 2022 07:48:15 -0300 Subject: [PATCH 1/4] featuredBlog landing --- .../BlogPage/BlogArticle/BlogArticle.js | 14 ++++++---- .../BlogPage/BlogArticle/BlogArticle.scss | 3 +- src/components/FeaturedBlogs/FeaturedBlogs.js | 28 +++++++++++++++++++ .../FeaturedBlogs/featuredBlogs.scss | 27 ++++++++++++++++++ src/components/index.js | 5 ++-- src/templates/LandingPage.js | 12 ++++++-- 6 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 src/components/FeaturedBlogs/FeaturedBlogs.js create mode 100644 src/components/FeaturedBlogs/featuredBlogs.scss diff --git a/src/components/BlogPage/BlogArticle/BlogArticle.js b/src/components/BlogPage/BlogArticle/BlogArticle.js index 985bdf21..558a823f 100644 --- a/src/components/BlogPage/BlogArticle/BlogArticle.js +++ b/src/components/BlogPage/BlogArticle/BlogArticle.js @@ -8,11 +8,15 @@ import "./BlogArticle.scss" const BlogArticle = ({ title, summary, image, slug, text }) => { return (
- + {image?.localFile ? ( + + ) : ( + {title} + )}
{`${title} ...`}
diff --git a/src/components/BlogPage/BlogArticle/BlogArticle.scss b/src/components/BlogPage/BlogArticle/BlogArticle.scss index 11012aaf..4c7b731d 100644 --- a/src/components/BlogPage/BlogArticle/BlogArticle.scss +++ b/src/components/BlogPage/BlogArticle/BlogArticle.scss @@ -1,5 +1,6 @@ @import "../../../styles/global.scss"; .article { + color: $primary; &__container { display: flex; justify-content: center; @@ -21,7 +22,6 @@ width: 100%; height: 150px; padding: 0 15px; - color: $black; h1, h2, h3, @@ -32,7 +32,6 @@ font-size: 15px !important; margin-bottom: 15px; line-height: 1rem; - color: $black; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; diff --git a/src/components/FeaturedBlogs/FeaturedBlogs.js b/src/components/FeaturedBlogs/FeaturedBlogs.js new file mode 100644 index 00000000..f5788f07 --- /dev/null +++ b/src/components/FeaturedBlogs/FeaturedBlogs.js @@ -0,0 +1,28 @@ +import React from "react" + +import "./featuredBlogs.scss" +import BlogArticle from "../BlogPage/BlogArticle/BlogArticle" + +const FeaturedBlogs = ({ data }) => { + return ( +
+

{data.title}

+
{data.subtitle}
+ +
+ {data.articles.slice(0, 3).map((item, idx) => ( + + ))} +
+
+ ) +} + +export default FeaturedBlogs diff --git a/src/components/FeaturedBlogs/featuredBlogs.scss b/src/components/FeaturedBlogs/featuredBlogs.scss new file mode 100644 index 00000000..3987ac9f --- /dev/null +++ b/src/components/FeaturedBlogs/featuredBlogs.scss @@ -0,0 +1,27 @@ +@import "../../styles/global.scss"; + +.featured { + color: $primary; + h2 { + flex-grow: 1; + text-align: center; + font-weight: 700; + } + h6 { + text-align: center; + line-height: 30px; + font-weight: 400; + } + + &-blogs { + display: flex; + flex-direction: row; + justify-content: center; + & > * { + flex-basis: 33%; + } + @media screen and (max-width: $breakpoint-lg) { + flex-direction: column; + } + } +} diff --git a/src/components/index.js b/src/components/index.js index 7723068c..08084117 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -15,7 +15,7 @@ import DualSection from "./DualSection/DualSection" import AnimatedTransitionContinous from "./animatedTransitionContinous/AnimatedTransitionContinous" import BannerTop from "./Banners/BannerTop" import BannerHead from "./BannerHead/BannerHead"; - +import FeaturedBlogs from './FeaturedBlogs/FeaturedBlogs' export { Cards, @@ -34,5 +34,6 @@ export { DualSection, AnimatedTransitionContinous, BannerTop, - BannerHead + BannerHead, + FeaturedBlogs } diff --git a/src/templates/LandingPage.js b/src/templates/LandingPage.js index 0d1ba6de..c5251315 100644 --- a/src/templates/LandingPage.js +++ b/src/templates/LandingPage.js @@ -17,12 +17,12 @@ import { AnimatedTransitionContinous, DualSection, OneSection, - Quote + Quote, + FeaturedBlogs } from "../components" import VideoBackground from "../components/videoBackground/VideoBackground" - const LandingPage = ({ data, location }) => { const pageData = data?.allStrapiLandingPage?.nodes[0] const content = pageData.body.map((component, idx) => { @@ -88,11 +88,16 @@ const LandingPage = ({ data, location }) => { ) : null - const videoBackground = + const videoBackground = component.strapi_component === "home.video-background" ? ( ) : null + const featuredBlogs = + component.strapi_component === "components.featured-blogs" ? ( + + ) : null + return (
<> @@ -109,6 +114,7 @@ const LandingPage = ({ data, location }) => { {quote} {dualSection} {animatedTransition} + {featuredBlogs}
) From 6e52431f4df9d4f5622f220e8b1aea3fe9487644 Mon Sep 17 00:00:00 2001 From: benjacanas Date: Wed, 20 Apr 2022 08:45:57 -0300 Subject: [PATCH 2/4] featuredBlog dropdown --- src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js index b7a1f865..bf56de34 100644 --- a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js +++ b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js @@ -14,6 +14,7 @@ const getComponentTitle = component => { "components.cases-section": () => component.title, "home.quote": () => component.title, "home.video-background": () => component.title, + "components.featured-blogs": () => component.title, "home.dual-section": () => component.dualSectionPart.map(section => section.title).join(" - "), } From 13c58c205f8bfda2f3146607ed349c2684dba335 Mon Sep 17 00:00:00 2001 From: benjacanas Date: Wed, 20 Apr 2022 08:46:52 -0300 Subject: [PATCH 3/4] titulo no definido --- src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js index bf56de34..c4f33820 100644 --- a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js +++ b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js @@ -20,8 +20,7 @@ const getComponentTitle = component => { } return ( (titleReference[component.strapi_component] && - titleReference[component.strapi_component]()) || - "Titulo no definido" + titleReference[component.strapi_component]()) ) } From 2edf0579ce26b824b93c71a78fdea5230193e7e7 Mon Sep 17 00:00:00 2001 From: benjacanas Date: Wed, 20 Apr 2022 09:40:54 -0300 Subject: [PATCH 4/4] code smell --- src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js index c4f33820..9c65757d 100644 --- a/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js +++ b/src/components/NavBar/AnimatedNavBar/AnimatedNavbar.js @@ -19,8 +19,8 @@ const getComponentTitle = component => { component.dualSectionPart.map(section => section.title).join(" - "), } return ( - (titleReference[component.strapi_component] && - titleReference[component.strapi_component]()) + titleReference[component.strapi_component] && + titleReference[component.strapi_component]() ) }