diff --git a/src/components/Banner/Banner.js b/src/components/Banner/Banner.js index f97dc3d2..ea978e8b 100644 --- a/src/components/Banner/Banner.js +++ b/src/components/Banner/Banner.js @@ -5,6 +5,7 @@ import { useTheme } from "../../context/themeContext" import "./Banner.scss" import PropTypes from 'prop-types' import CustomLink from "../CustomLink/CustomLink" +import CustomImage from "../CustomImage/CustomImage" const Banner = ({ data }) => { const { theme } = useTheme() @@ -21,23 +22,21 @@ const Banner = ({ data }) => { const showTitle = () => { if (variant === "diagonal" || variant === "diagonalReverse") { return

{title}

- } else { - return

{title}

} + + return

{title}

} return (
{variant === "background" ? -
-
+

{title}

{summary && ( {
- {image?.url ? ( - {image?.alternativeText) : ( + /> + ) : (
- {animation && } + {animation && ( + + )}
)}
diff --git a/src/components/Banner/Banner.scss b/src/components/Banner/Banner.scss index 66d2aef6..7a1a351e 100644 --- a/src/components/Banner/Banner.scss +++ b/src/components/Banner/Banner.scss @@ -23,6 +23,10 @@ -webkit-box-align: center; -ms-flex-align: center; align-items: center; + + .imagen { + min-height: 450px; + } } .cont-lottie { diff --git a/src/components/BannerList/Banner.scss b/src/components/BannerList/Banner.scss index 3bb09f04..9f42c762 100644 --- a/src/components/BannerList/Banner.scss +++ b/src/components/BannerList/Banner.scss @@ -2,29 +2,43 @@ .bannerList { color: $primary; + .card_item { + align-items: center; + h4 { margin: 0; } + + p { + margin: 0; + } + a { color: inherit; + &:hover { color: $secondary; } } + img { margin: 0; width: 80px; + object-fit: cover; } } + button { margin-top: 10px; @include primaryBtn; align-self: baseline; + a { color: inherit; } } + &__title { display: flex; flex-direction: column; @@ -36,12 +50,7 @@ @media screen and (min-width: $breakpoint-xl) { .bannerList { - .card_item { - img { - width: 80px; - } - } - &__buttonMobile{ + &__buttonMobile { display: none; } } @@ -59,13 +68,8 @@ @media screen and (min-width: $breakpoint-md) { .bannerList { - .card_item { - img { - width: 80px; - } - } - &__buttonMobile{ + &__buttonMobile { display: none; } } -} +} \ No newline at end of file diff --git a/src/components/BannerList/BannerList.js b/src/components/BannerList/BannerList.js index d0cfc3dc..68c1d72a 100644 --- a/src/components/BannerList/BannerList.js +++ b/src/components/BannerList/BannerList.js @@ -3,19 +3,21 @@ import React from "react" import "./Banner.scss" import useLandingUrl from "../../hooks/useLandingUrl" import PropTypes from "prop-types" +import CustomImage from "../CustomImage/CustomImage" export default function BannerList({ data }) { const { title, Card, contactForm, concactFormAnchor, callToAction } = data const getUrl = useLandingUrl() const cards = Card.map(item => { return ( -
+
{item?.icon && (
- {item?.icon?.alternativeText
)} @@ -37,17 +39,17 @@ export default function BannerList({ data }) { }) return ( -
+
-

+

{title} {contactForm && concactFormAnchor && callToAction && ( )} -

-
+ +
{cards}
{contactForm && concactFormAnchor && callToAction && ( diff --git a/src/components/BlogPage/BlogArticle/BlogArticle.js b/src/components/BlogPage/BlogArticle/BlogArticle.js index d6bc4ff5..69717849 100644 --- a/src/components/BlogPage/BlogArticle/BlogArticle.js +++ b/src/components/BlogPage/BlogArticle/BlogArticle.js @@ -10,18 +10,17 @@ const BlogArticle = ({ title, summary, image, slug, text }) => { return (
-
-
{`${title}`}
-
- -
+

{title}

+
{text || 'Ver más'} diff --git a/src/components/BlogPage/BlogArticle/BlogArticle.scss b/src/components/BlogPage/BlogArticle/BlogArticle.scss index e676ae7e..5ceaa410 100644 --- a/src/components/BlogPage/BlogArticle/BlogArticle.scss +++ b/src/components/BlogPage/BlogArticle/BlogArticle.scss @@ -1,28 +1,31 @@ @import "../../../styles/global.scss"; + .article { color: $primary; + &__container { display: flex; justify-content: center; align-items: center; width: 100%; + height: 100%; padding: 0.5em; color: $primary; } + &__image { width: 100%; height: 170px; transition: opacity 3s ease-in; border-radius: 8px; } + &__description { - // display: flex; - // flex-direction: column; - // justify-content: flex-start; position: relative; width: 100%; height: 170px; padding: 0 0 0 15px; + h1, h2, h3, @@ -30,26 +33,35 @@ h5, h6 { padding-left: 0; - // font-size: 15px !important; - margin-bottom: 15px; - // line-height: 1rem; + margin-bottom: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; } + + h4 { + text-wrap: pretty; + line-height: 1.3rem; + margin-bottom: 10px; + font-size: $medium; + } + p { margin-bottom: 15px; - line-height: 24px; + line-height: 28px; + font-weight: $standard; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } } + &__link { position: absolute; bottom: 15px; + a { margin-right: 0; font-weight: $max_bold; @@ -60,19 +72,16 @@ } } } + @media (min-width: $breakpoint-md) { .article { - &__description { - h6 { - margin-bottom: 2px; - line-height: 1.3rem; - } - } + &__link { bottom: 0; } } } + @media (min-width: $breakpoint-lg) { .article { &__container { @@ -90,9 +99,9 @@ width: 100%; height: 190px; padding: 0; + p { font-size: 18px; - line-height: 30px; em { font-size: 18px; @@ -100,4 +109,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/components/BlogPage/BlogContainer.js b/src/components/BlogPage/BlogContainer.js index bcf8c90d..f251bf1c 100644 --- a/src/components/BlogPage/BlogContainer.js +++ b/src/components/BlogPage/BlogContainer.js @@ -32,7 +32,7 @@ const Blog = () => { {category.map((item, idx) => ( { />
-
{caso.title}
+

{caso.title}

{caso.description && (
{
{caso?.quote?.title && ( -
+

{caso.quote.title} -

+ )} {caso?.quote?.description && (
diff --git a/src/components/CasesSection/CasesSection.js b/src/components/CasesSection/CasesSection.js index 90208563..ae9ab0ad 100644 --- a/src/components/CasesSection/CasesSection.js +++ b/src/components/CasesSection/CasesSection.js @@ -1,5 +1,4 @@ import React from "react" -import { getImage, GatsbyImage } from "gatsby-plugin-image" import { useCases } from "../../hooks/index" import "./CasesSection.scss" import PropTypes from "prop-types" @@ -28,15 +27,17 @@ const CasesSection = ({ data }) => {
-
+

{caso.title} -

+ {caso?.description && (
{ )}
{caso?.button && ( - + )}
)) return ( -
-
{listSectionParts}
+
+
+ {listSectionParts} +
) } diff --git a/src/components/DualSection/DualSection.scss b/src/components/DualSection/DualSection.scss index dd8d01b5..622b364f 100644 --- a/src/components/DualSection/DualSection.scss +++ b/src/components/DualSection/DualSection.scss @@ -6,14 +6,28 @@ h4 { margin-top: 1rem; font-weight: 700; + margin-bottom: 16px; } &__image { width: 100%; + min-height: 250px; + + img { + width: 100%; + object-fit: cover; + } } - button { + a { @include primaryBtn; + display: block; + min-width: auto; + padding: 10px 15px; + + @media screen and (min-width: $breakpoint-lg) { + padding: 12px 30px; + } } &__textContainer { @@ -27,10 +41,13 @@ } } - .one_sec { color: $primary; + h4 { + margin-bottom: 16px; + } + &-background { background-size: cover; background-repeat: no-repeat; @@ -45,8 +62,15 @@ padding-top: 3em; padding-bottom: 3em; - button { + a { @include primaryBtn; + display: block; + width: max-content; + padding: 10px 15px; + + @media screen and (min-width: $breakpoint-lg) { + padding: 12px 30px; + } } .gatsby-image-wrapper { @@ -56,26 +80,27 @@ &-title { flex-basis: 45%; - h3 { - font-weight: 700; - font-size: 36px; - line-height: 40px; - } - &-body { - font-weight: 400 !important; p, a { font-size: $medium; + margin-bottom: 16px; } + + font-weight: 400 !important; } } &-img { + width: 100%; + height: 100%; + min-height: 180px; flex-basis: 55%; img { + height: 100%; + object-fit: cover; border-radius: 8px; width: 100%; padding: 0; diff --git a/src/components/DualSection/OneSection.js b/src/components/DualSection/OneSection.js index 54b44995..dbb36c2c 100644 --- a/src/components/DualSection/OneSection.js +++ b/src/components/DualSection/OneSection.js @@ -1,9 +1,11 @@ import React from "react" import { useTheme } from "../../context/themeContext" -import ButtonLink from "../ButtonLink/ButtonLink" -import MarkdowView from 'react-showdown' +import MarkdownView from 'react-showdown' +import CustomImage from "../CustomImage/CustomImage" +import CustomLink from "../CustomLink/CustomLink" +import PropTypes from "prop-types" -const OneSection = ({ data: { id, strapi_component, dualSectionPart } }) => { +const OneSection = ({ data: { dualSectionPart } }) => { const { theme } = useTheme() const { title, @@ -17,33 +19,75 @@ const OneSection = ({ data: { id, strapi_component, dualSectionPart } }) => {
-
+

{title}

- {description && ( -
- -
+
+ +
+ {button && ( + )} -
- one_sec +
) } +OneSection.propTypes = { + data: PropTypes.shape({ + dualSectionPart: PropTypes.arrayOf( + PropTypes.shape({ + title: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + image: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }).isRequired, + button: PropTypes.shape({ + content: PropTypes.string.isRequired, + url: PropTypes.string, + landing_page: PropTypes.shape({ + slug: PropTypes.string.isRequired + }) + }), + backgroundImage: PropTypes.shape({ + url: PropTypes.string + }), + backgroundImageDark: PropTypes.shape({ + url: PropTypes.string + }) + }) + ) + }) +} + export default OneSection diff --git a/src/components/FeaturedBlogs/FeaturedBlogs.js b/src/components/FeaturedBlogs/FeaturedBlogs.js index a470afda..753c9b84 100644 --- a/src/components/FeaturedBlogs/FeaturedBlogs.js +++ b/src/components/FeaturedBlogs/FeaturedBlogs.js @@ -15,28 +15,30 @@ const compareDates = (a, b) => { } const FeaturedBlogs = ({ data }) => { - const callToAction = useBlog()?.allStrapiBlogPage?.callToAction; + const { title, subtitle, articles } = data; + const callToAction = useBlog()?.allStrapiBlogPage?.callToActionArticle; return (
-

{data.title}

-
{data.subtitle}
- -
- {data.articles - .sort(compareDates) - .slice(0, 3) - .map((item, idx) => ( - - ))} -
+ {title &&

{title}

} + {subtitle &&

{subtitle}

} + {articles?.length > 0 && ( +
+ {articles + .sort(compareDates) + .slice(0, 3) + .map((item, idx) => ( + + ))} +
+ )}
) } @@ -59,7 +61,16 @@ FeaturedBlogs.propTypes = { gatsbyImageData: PropTypes.object.isRequired }) }) - }).isRequired + }), + imagePage: PropTypes.shape({ + alternativeText: PropTypes.string, + url: PropTypes.string.isRequired, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }), }) ) }) diff --git a/src/components/FeaturedBlogs/featuredBlogs.scss b/src/components/FeaturedBlogs/featuredBlogs.scss index 9174251d..4cac1b9c 100644 --- a/src/components/FeaturedBlogs/featuredBlogs.scss +++ b/src/components/FeaturedBlogs/featuredBlogs.scss @@ -3,18 +3,22 @@ .featured { color: $primary; padding-bottom: 3rem; + h2 { margin-top: 2em; flex-grow: 1; font-weight: 700; text-transform: uppercase; + @media screen and (min-width: $breakpoint-md) { text-align: center; } } - h6 { + + h3 { line-height: 28px; font-weight: 400; + @media screen and (min-width: $breakpoint-md) { text-align: center; } @@ -22,6 +26,7 @@ &-blogs { align-items: center; + img { object-fit: cover; max-width: 140px; @@ -30,7 +35,8 @@ display: flex; flex-direction: row; justify-content: center; - & > * { + + &>* { flex-basis: 33%; } @@ -41,12 +47,8 @@ background-color: $blog-card-container; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); border-radius: 8px; - h6 { - text-align: left; - font-weight: 700; - font-size: 18px !important; - } } + &__link { button { font-size: 18px; @@ -69,4 +71,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/components/Footer/ContactData/contactData.js b/src/components/Footer/ContactData/contactData.js index 9cbd984b..9deb8188 100644 --- a/src/components/Footer/ContactData/contactData.js +++ b/src/components/Footer/ContactData/contactData.js @@ -1,21 +1,20 @@ -import { Link } from "gatsby" import React from "react" -import { useFooter, useLandingUrl } from "../../../hooks" +import { useFooter } from "../../../hooks" import FaIcon from "../../FaIcon/FaIcon" import "./contactData.scss" +import CustomLink from "../../CustomLink/CustomLink" export default function ContactData() { const data = useFooter() - const getUrl = useLandingUrl() const dataFooter = data?.allStrapiLayout?.nodes[0]?.footer - const dataNav = data?.allStrapiLayout?.nodes[0].navbar?.navButton + const navButton = data?.allStrapiLayout?.nodes[0].navbar?.navButton const contact = dataFooter?.contact?.iconText.map(item => { return ( -

+

{item.name} -

+
) }) @@ -23,21 +22,15 @@ export default function ContactData() { <>
{dataFooter?.contact?.title}
-

{contact}

- {dataNav && ( +
{contact}
+ {navButton && dataFooter?.internalLink && (
- {dataNav.landing_page ? ( - - {dataFooter?.internalLink?.name} - - ) : (dataNav.url && ( - - {dataFooter?.internalLink?.name} - - ))} +
)} diff --git a/src/components/Footer/ContactData/contactData.scss b/src/components/Footer/ContactData/contactData.scss index 2ade690b..63eb199d 100644 --- a/src/components/Footer/ContactData/contactData.scss +++ b/src/components/Footer/ContactData/contactData.scss @@ -12,8 +12,11 @@ .icon-text { font-size: 16px; + margin-bottom: 16px; } + } + &__link { a { font-weight: 600; @@ -23,12 +26,14 @@ } } } + @media screen and (min-width: $breakpoint-md) { .ContactData__Item { - + &__contact { display: block; } + .icon-text { svg { margin-right: 5px; @@ -41,10 +46,12 @@ .ContactData__Item { .icon-text { font-size: 18px; + svg { margin-right: 10px; } } + &__link { a { font-size: 20px; @@ -57,15 +64,17 @@ .ContactData__Item { .icon-text { font-size: 18px; + svg { margin-right: 10px; } } + &__link { a { font-size: 20px; } } } - -} + +} \ No newline at end of file diff --git a/src/components/Footer/Location/location.js b/src/components/Footer/Location/location.js index d7f4ee99..57404816 100644 --- a/src/components/Footer/Location/location.js +++ b/src/components/Footer/Location/location.js @@ -4,21 +4,23 @@ import FaIcon from "../../FaIcon/FaIcon" import "./location.scss"; export default function Location() { - const data = useFooter(); - const dataFooter = data?.allStrapiLayout?.nodes[0].footer; + const dataFooter = useFooter()?.allStrapiLayout?.nodes[0].footer; - const location = dataFooter.location?.iconText.map((item) => { - return ( -

- - {item.name} -

- ) - }); + const location = dataFooter?.location?.iconText?.map((item) => { return ( -
-
{dataFooter?.location?.title}
-

{location}

-
+
+ + {item.name} +
) + }); + + return ( +
+
{dataFooter?.location?.title}
+
+ {location} +
+
+ ) } diff --git a/src/components/Footer/Location/location.scss b/src/components/Footer/Location/location.scss index 302d080a..74f63f79 100644 --- a/src/components/Footer/Location/location.scss +++ b/src/components/Footer/Location/location.scss @@ -12,6 +12,7 @@ } .icon-text { + margin-bottom: 16px; align-items: center; svg { diff --git a/src/components/Footer/Sites/Sites.js b/src/components/Footer/Sites/Sites.js index 3da32981..e720b132 100644 --- a/src/components/Footer/Sites/Sites.js +++ b/src/components/Footer/Sites/Sites.js @@ -1,31 +1,28 @@ import React from "react"; import { useFooter } from '../../../hooks'; -import { getImage, GatsbyImage } from "gatsby-plugin-image"; import './Sites.scss' +import CustomImage from "../../CustomImage/CustomImage" const Sites = () => { const sitesData = useFooter()?.allStrapiLayout?.nodes[0]?.Sites + const { title, websites } = sitesData; - const websitesItems = sitesData?.websites?.map(website => { - const image = website?.icon?.localFile?.childImageSharp?.gatsbyImageData - ? getImage(website?.icon?.localFile?.childImageSharp?.gatsbyImageData) - : undefined; + if (!websites) return null + + const websitesItems = websites?.map(website => { return ( @@ -34,7 +31,7 @@ const Sites = () => { return (
- {sitesData?.title &&
{sitesData.title}
} + {title &&
{title}
}
{websitesItems}
diff --git a/src/components/Footer/SocialLinks/socialLinks.js b/src/components/Footer/SocialLinks/socialLinks.js index c59e526b..e09966b6 100644 --- a/src/components/Footer/SocialLinks/socialLinks.js +++ b/src/components/Footer/SocialLinks/socialLinks.js @@ -6,16 +6,14 @@ import FaIcon from '../../FaIcon/FaIcon'; import './socialLinks.scss'; export default function SocialLinks() { - const data = useFooter(); - const dataFooter = data?.allStrapiLayout?.nodes[0].footer; + const dataFooter = useFooter()?.allStrapiLayout?.nodes[0].footer; const logo = getImage(dataFooter?.logo?.localFile?.childImageSharp?.gatsbyImageData); const dataSocialMedia = dataFooter?.socialMedia; - const socialMedia = dataSocialMedia?.socialMedia?.map((item) => { + const socialMedia = dataSocialMedia?.socialMedia?.map(item => { return ( - - - ); + ) }); return ( @@ -37,14 +34,12 @@ export default function SocialLinks() { {logo && (
-
)} -
) } \ No newline at end of file diff --git a/src/components/Form/PipedriveForm.js b/src/components/Form/PipedriveForm.js index 0690ec55..e64ea564 100644 --- a/src/components/Form/PipedriveForm.js +++ b/src/components/Form/PipedriveForm.js @@ -4,6 +4,7 @@ import Lottie from 'react-lottie' import "./Form.scss" import { Helmet } from "react-helmet" import PropTypes from "prop-types" +import CustomImage from "../CustomImage/CustomImage" const PipedriveForm = ({ data }) => { const { title, content, form_url, image, animation } = data; @@ -50,10 +51,10 @@ const PipedriveForm = ({ data }) => { /> )}
- {image?.url ? ( - {image?.alternativeText diff --git a/src/components/HomePage/HomeContainer/HomeContainer.js b/src/components/HomePage/HomeContainer/HomeContainer.js index 7c8a926d..600d0f8e 100644 --- a/src/components/HomePage/HomeContainer/HomeContainer.js +++ b/src/components/HomePage/HomeContainer/HomeContainer.js @@ -14,13 +14,11 @@ const Home = ({ location }) => { return ( - {data?.allStrapiHome?.nodes[0]?.pageMetadata && ( - - )} + {/* Dynamic zone */} {data?.body?.length > 0 && ( diff --git a/src/components/LogosSection/logosSection.js b/src/components/LogosSection/logosSection.js index 44020557..ea0639c8 100644 --- a/src/components/LogosSection/logosSection.js +++ b/src/components/LogosSection/logosSection.js @@ -4,22 +4,25 @@ import { useTheme } from "../../context/themeContext" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import Carousel from 'react-multi-carousel' import 'react-multi-carousel/lib/styles.css' +import PropTypes from "prop-types" +import CustomImage from "../CustomImage/CustomImage" const LogosSection = ({ data }) => { const { title, summary, media } = data const { theme } = useTheme() - const logoList = media.map(logo => { + const logoList = media?.map(logo => { + + if (!logo.img && !logo.imageDark) return null + return ( -
- {logo.name} +
) @@ -43,39 +46,72 @@ const LogosSection = ({ data }) => { items: 1 } }; + const CustomLeftArrow = ({ onClick }) => { return onClick()} />; }; + const CustomRightArrow = ({ onClick }) => { return onClick()} />; }; return ( -
+
{title &&

{title}

} - {summary &&
{summary}
} - - 4} - autoPlaySpeed={3000} - infinite={logoList.length > 4} - containerClass={'containerCarrusel'} - customRightArrow={} - customLeftArrow={} - removeArrowOnDeviceType={logoList.length <= 4 && ['tablet', 'desktop']} - > - {logoList} - - + {summary &&

{summary}

} + {media?.length > 0 && ( + 4} + autoPlaySpeed={3000} + infinite={logoList.length > 4} + containerClass={'containerCarrusel'} + customRightArrow={} + customLeftArrow={} + removeArrowOnDeviceType={logoList.length <= 4 && ['tablet', 'desktop']} + > + {logoList} + + )}
) } +LogosSection.propTypes = { + data: PropTypes.shape({ + title: PropTypes.string, + summary: PropTypes.string, + media: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.number.isRequired, + name: PropTypes.string.isRequired, + img: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }).isRequired, + imageDark: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }) + }) + ) + }) +} + export default LogosSection diff --git a/src/components/LogosSection/logosSection.scss b/src/components/LogosSection/logosSection.scss index 9cdd4877..8c9bfa15 100644 --- a/src/components/LogosSection/logosSection.scss +++ b/src/components/LogosSection/logosSection.scss @@ -1,14 +1,27 @@ @import "../../styles/global.scss"; +.containerCarrusel { + min-width: 290px; + min-height: 185px; + + &-inactive { + min-height: 0; + } +} + .logos { color: $primary; + &__title { font-weight: 700; text-transform: uppercase; } + &__summary { font-weight: 400; + font-size: $medium; } + &__logos { margin-top: 10px; margin-bottom: 20px; @@ -16,9 +29,15 @@ flex-direction: column; align-items: center; } + &__image { margin-top: 15px; max-width: 220px; + + img { + width: 100%; + height: 100%; + } } .react-multi-carousel-list { @@ -28,12 +47,15 @@ max-width: 20px; max-height: 20px; } + .left { left: -8px; } + .right { right: -8px; } + button { background: none; @@ -42,6 +64,7 @@ font-weight: 900; } } + .react-multi-carousel-item { display: flex; justify-content: center; @@ -55,21 +78,24 @@ &__title { text-align: center; } + &__summary { text-align: center; margin-top: 20px; margin-bottom: 50px !important; line-height: 28px; } + &__logos { margin: 30px 0; flex-direction: row; flex-wrap: wrap; justify-content: center; } + &__image { margin: 10px 10px 0 10px; padding: 0px 25px; } } -} +} \ No newline at end of file diff --git a/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js b/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js index ef3e4804..d74ee349 100644 --- a/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js +++ b/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js @@ -58,8 +58,8 @@ const Dropdown = ({ sections, topLevel }) => { )}
{sections?.map(section => -
-
+
+
{section.icon && ( { const { theme, toggleTheme } = useTheme() - const navbarData = useNavbar() - const getUrl = useLandingUrl(); + const navbarData = useNavbar()?.allStrapiLayout?.nodes[0] + const menuData = navbarData?.menu - const menuData = navbarData.allStrapiLayout?.nodes[0].menu - - const logoLight = getImage( - navbarData.allStrapiLayout?.nodes[0].navbar?.logo?.localFile - ) - const logoDark = getImage( - navbarData.allStrapiLayout?.nodes[0].navbar?.logoDark?.localFile - ) - - const navbarButton = navbarData.allStrapiLayout?.nodes[0].navbar?.navButton + const logoLight = getImage(navbarData?.navbar?.logo?.localFile) + const logoDark = getImage(navbarData?.navbar?.logoDark?.localFile) + const navbarButton = navbarData?.navbar?.navButton return ( <> @@ -47,26 +40,22 @@ const NavBar = () => { {menuData && (
)}
{navbarButton && ( - )} - - ) - )} +
)}
@@ -103,4 +109,39 @@ Quote.defaultProps = { image: {}, } +Quote.propTypes = { + data: PropTypes.shape({ + title: PropTypes.string, + description: PropTypes.string.isRequired, + variant: PropTypes.string, + profileDescription: PropTypes.string, + videoUrl: PropTypes.string, + button: PropTypes.shape({ + content: PropTypes.string.isRequired, + url: PropTypes.string, + landing_page: PropTypes.shape({ + slug: PropTypes.string.isRequired + }) + }), + profile: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }), + image: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }) + }) +} + export default Quote diff --git a/src/components/quote/quote.scss b/src/components/quote/quote.scss index 566dcd41..9ecd522c 100644 --- a/src/components/quote/quote.scss +++ b/src/components/quote/quote.scss @@ -4,14 +4,22 @@ display: grid; gap: 2em; color: $primary; + &-body { + grid-area: quote-body; + img { + max-height: 450px; + height: 100%; width: 100%; object-fit: cover; + object-position: top; border-radius: 8px; } + iframe { + height: 100%; width: 100%; margin-bottom: 0; min-height: 250px; @@ -27,6 +35,7 @@ &-title { margin-bottom: 1rem; } + &-text { margin-bottom: 0; display: -webkit-box; @@ -34,27 +43,35 @@ -webkit-box-orient: vertical; overflow: hidden; } + + div>p { + margin: 0; + } } &-profile { grid-area: quote-profile; flex-grow: 0; + align-items: center; align-self: flex-start; border-radius: 50%; width: 100%; z-index: 4; + img { width: 65px; height: 65px; border-radius: 50%; } - .markdown { - p { - margin: 0; - } + + div>p { + margin-bottom: 6px; } } + &-btn { + margin-top: 8px; + button { @include primaryBtn; border-radius: 8px; @@ -73,19 +90,26 @@ } } } + @media (min-width: $breakpoint-lg) { .quote { &-body { + img { + max-height: 550px; + } + iframe { min-height: 350px !important; } } + &-btn { button { width: 150px; height: 40px; } } + &-profile { img { width: 100px; @@ -98,10 +122,12 @@ @media (min-width: $breakpoint-xl) { .quote { &-body { + iframe { min-height: 500px !important; } } + &-person { &-title { margin-bottom: 15px; @@ -109,7 +135,7 @@ } } } -// variantes + .variant { &-quote { grid-template-areas: @@ -128,27 +154,19 @@ } grid-template-rows: auto 1fr; + @media screen and (max-width: calc($breakpoint-md - 3px)) { grid-template-areas: "quote-body quote-body" "quote-profile quote-person"; grid-template-columns: auto 1fr; } + @media screen and (max-width: calc($breakpoint-md - 3px)) { display: flex; flex-direction: column; gap: 1em; + p { margin-bottom: 0; } } - /* @media screen and (max-width: calc($breakpoint-xl - 3px)) { - .variant { - &-quote { - grid-template-columns: 1fr 2fr !important; - } - - &-media { - grid-template-columns: 2fr 1fr; - } - } - } */ -} +} \ No newline at end of file diff --git a/src/components/videoBackground/VideoBackground.js b/src/components/videoBackground/VideoBackground.js index 0975ddb2..5a20aa79 100644 --- a/src/components/videoBackground/VideoBackground.js +++ b/src/components/videoBackground/VideoBackground.js @@ -1,18 +1,18 @@ import React, { useEffect, useRef, useState } from "react" -import ButtonLink from "../ButtonLink/ButtonLink" import "./videoBackground.scss" +import CustomLink from "../CustomLink/CustomLink" +import PropTypes from "prop-types" -const VideoBackground = ({ - data: { video, description, button, strapi_component, id, backgroundImage, videoUrl }, -}) => { +const VideoBackground = ({ data }) => { + const { video, description, button, backgroundImage, videoUrl } = data const [isVideoPause, setIsVideoPause] = useState(false) const videoRef = useRef(null) const pausePlay = () => { if (isVideoPause) { - videoRef.current.play() + videoRef?.current?.play() } else { - videoRef.current.pause() + videoRef?.current?.pause() } setIsVideoPause(prev => !prev) } @@ -24,17 +24,18 @@ const VideoBackground = ({ : undefined if (isVideoPauseLocal === "true") { - videoRef.current?.pause() + videoRef?.current?.pause() setIsVideoPause(isVideoPauseLocal) } }, []) useEffect(() => { localStorage.setItem("videoPaused", isVideoPause) + }, [isVideoPause]) const url = videoUrl?.replace("watch?v=", "embed/") - let code = url?.substring(url.lastIndexOf("/") + 1, url.length) + let code = url?.substring(url?.lastIndexOf("/") + 1, url?.length) const codeIndex = code?.indexOf("?") if (codeIndex !== -1 && code !== undefined) { @@ -42,20 +43,14 @@ const VideoBackground = ({ } return ( -
-
-
+
+
{(video?.url !== null && video?.url !== undefined) ?
}
@@ -107,4 +107,24 @@ const VideoBackground = ({ ) } +VideoBackground.propTypes = { + data: PropTypes.shape({ + video: PropTypes.shape({ + url: PropTypes.string.isRequired + }), + videoUrl: PropTypes.string, + description: PropTypes.string, + backgroundImage: PropTypes.shape({ + url: PropTypes.string.isRequired, + }), + button: PropTypes.shape({ + content: PropTypes.string.isRequired, + url: PropTypes.string, + landing_page: PropTypes.shape({ + slug: PropTypes.string.isRequired + }) + }) + }) +} + export default VideoBackground diff --git a/src/components/videoBackground/videoBackground.scss b/src/components/videoBackground/videoBackground.scss index e97512dc..a0d0d875 100644 --- a/src/components/videoBackground/videoBackground.scss +++ b/src/components/videoBackground/videoBackground.scss @@ -1,10 +1,14 @@ @import "../../styles/global.scss"; .videoBackground { + aspect-ratio: 1.91/1; + max-width: 100%; + &-container { - margin-top: 50px; - margin-bottom: 50px; + padding-top: 50px; + padding-bottom: 50px; } + video, iframe { width: 100%; @@ -12,7 +16,9 @@ object-fit: cover; display: block; border-radius: 5px; + margin-bottom: 0px; } + &-card { width: 100%; backdrop-filter: blur(14px); @@ -23,30 +29,29 @@ word-wrap: break-all; padding: 15px; } - h5 { + + h4 { width: 100%; + margin-bottom: 8px; color: $grey; } - button { + + a { @include secondaryBtn; - a { - color: $grey; - } + color: $grey; + display: block; + width: max-content; + padding: 8px 16px; } } @media screen and (min-width: $breakpoint-md) { .videoBackground { - // width: calc(100% - 6em); height: 400px; position: relative; z-index: 3; display: flex; - // margin: 3em; - &-container { - margin-top: 80px; - margin-bottom: 80px; - } + .video { top: 0; position: absolute; @@ -55,8 +60,8 @@ object-fit: cover; z-index: -1; cursor: pointer; - // border-radius: 20px; } + &-card { z-index: 4; align-self: flex-end; @@ -70,12 +75,9 @@ margin: 2em; padding: 2em; - h5 { + h4 { color: $grey; } - button { - @include secondaryBtn; - } } } } @@ -83,9 +85,6 @@ @media screen and (min-width: $breakpoint-lg) { .videoBackground { height: 520px; - &-container { - margin-bottom: 80px; - } } } @@ -93,16 +92,4 @@ .videoBackground { height: 720px; } -} - -// @media screen and (max-width: $breakpoint-md) { -// .videoBackground { -// height: 500px; -// video { -// height: 80%; -// } -// &-card { -// height: 20%; -// } -// } -// } +} \ No newline at end of file diff --git a/src/context/themeContext.js b/src/context/themeContext.js index f4bfa746..3d533e14 100644 --- a/src/context/themeContext.js +++ b/src/context/themeContext.js @@ -50,7 +50,7 @@ const getDeviseTheme = () => { } } ThemeProvider.propTypes = { - children: PropTypes.object, + children: PropTypes.node, } export default ThemeProvider diff --git a/src/hooks/useBlog.js b/src/hooks/useBlog.js index 2a2821b0..10cb46b6 100644 --- a/src/hooks/useBlog.js +++ b/src/hooks/useBlog.js @@ -22,6 +22,15 @@ const useBlog = () => { } } } + imagePage { + url + alternativeText + localFile { + childImageSharp { + gatsbyImageData + } + } + } blog_category { name diff --git a/src/hooks/useFooter.js b/src/hooks/useFooter.js index b8097518..9018cc3b 100644 --- a/src/hooks/useFooter.js +++ b/src/hooks/useFooter.js @@ -44,6 +44,7 @@ const useFooter = () => { contact { title iconText { + id name icon { code @@ -59,6 +60,7 @@ const useFooter = () => { location { title iconText { + id name icon { code diff --git a/src/schema/blogSchema.js b/src/schema/blogSchema.js index 122f4891..fc860c26 100644 --- a/src/schema/blogSchema.js +++ b/src/schema/blogSchema.js @@ -247,6 +247,7 @@ type StrapiBlogCategory implements Node { locale: String ): Date image: LocalFile + imagePage: LocalFile slug: String } diff --git a/src/templates/BlogItemDetail.js b/src/templates/BlogItemDetail.js index 04f65e60..9b44c76c 100644 --- a/src/templates/BlogItemDetail.js +++ b/src/templates/BlogItemDetail.js @@ -1,21 +1,16 @@ import React from "react" import { graphql } from "gatsby" -import showdown from "showdown" -// import ReactMarkdown from "react-markdown" import MarkdownView from "react-showdown" import Layout from "../components/layout" -import { Seo } from "../components/index.js" -import { BannerTop } from "../components/index.js" -import { getImage, GatsbyImage } from "gatsby-plugin-image" +import { Seo, BannerTop, CustomImage } from "../components/index.js" +import PropTypes from "prop-types" import "./BlogItemDetail.scss" const BlogDetail = ({ data }) => { const { title, description, image, imagePage, author } = data?.allStrapiArticle?.nodes[0] - const bannerTop = imagePage ? { title, imagePage } : { title, image } + const bannerTop = imagePage ? { title, imagePage } : { title, image } - let { summary } = author - return ( @@ -25,15 +20,16 @@ const BlogDetail = ({ data }) => {
- {/* */}
{author?.map(author => (
-
@@ -46,27 +42,59 @@ const BlogDetail = ({ data }) => {
- {/*
-
-

Artículos relacionados

-
-
-
-

{title}

-

{summary}

- - Ver más - -
-
-
-
-
*/}
) } +BlogDetail.propTypes = { + data: PropTypes.shape({ + allStrapiArticle: PropTypes.shape({ + nodes: PropTypes.arrayOf( + PropTypes.shape({ + title: PropTypes.string.isRequired, + description: PropTypes.string.isRequired, + slug: PropTypes.string.isRequired, + image: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }), + imagePage: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }), + author: PropTypes.arrayOf( + PropTypes.shape({ + name: PropTypes.string.isRequired, + subTitle: PropTypes.string, + summary: PropTypes.string, + image: PropTypes.shape({ + url: PropTypes.string.isRequired, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired + }) + }) + }) + }) + ) + }) + ) + }) + }) +} + export const query = graphql` query($slug: String!) { allStrapiArticle(filter: { slug: { eq: $slug } }) { @@ -75,6 +103,8 @@ export const query = graphql` description slug image { + url + alternativeText localFile { childImageSharp { gatsbyImageData @@ -82,6 +112,8 @@ export const query = graphql` } } imagePage{ + url + alternativeText localFile { childImageSharp { gatsbyImageData @@ -93,6 +125,8 @@ export const query = graphql` subTitle summary image { + url + alternativeText localFile { childImageSharp { gatsbyImageData(width: 150, height: 150) @@ -104,4 +138,5 @@ export const query = graphql` } } ` + export default BlogDetail diff --git a/src/templates/LandingPage.js b/src/templates/LandingPage.js index fe9b2b2c..41cf5ccc 100644 --- a/src/templates/LandingPage.js +++ b/src/templates/LandingPage.js @@ -13,7 +13,10 @@ const LandingPage = ({ data, location }) => { return ( - + {pageData?.body?.length > 0 && ( )} @@ -29,7 +32,12 @@ LandingPage.propTypes = { name: PropTypes.string.isRequired, body: PropTypes.arrayOf( PropTypes.object - ) + ), + seo: PropTypes.shape({ + pageTitle: PropTypes.string.isRequired, + pageDescription: PropTypes.string.isRequired, + pageKeywords: PropTypes.string + }) }) ) }) @@ -43,6 +51,11 @@ export const query = graphql` nodes { body name + seo { + pageTitle + pageKeywords + pageDescription + } } } }