diff --git a/src/components/Banner/Banner.js b/src/components/Banner/Banner.js new file mode 100644 index 00000000..4fb009ab --- /dev/null +++ b/src/components/Banner/Banner.js @@ -0,0 +1,43 @@ +import React from "react" +import { Link } from "gatsby" +import "./Banner.scss" + +const Banner = ({ data }) => { + const title = data?.title + const variant = data?.variant + const summary = data?.summary + const image = data?.image + const button = data?.button + const id = data?.id + return ( +
+
+
+

{title}

+

{summary}

+ {button && + (button?.landing_page ? ( + + {button.content} + + ) : ( + + {button.content} + + ))} +
+
+ +
+ {title} +
+
+ ) +} + +export default Banner diff --git a/src/components/Banner/Banner.scss b/src/components/Banner/Banner.scss new file mode 100644 index 00000000..a06f26ca --- /dev/null +++ b/src/components/Banner/Banner.scss @@ -0,0 +1,244 @@ +@import "../../styles/global.scss"; +.banner { + color: $primary; + overflow: hidden; + display: flex; + flex-direction: column-reverse; + justify-content: space-around; + align-items: center; + &.hero { + height: auto; + justify-content: end; + .button { + @include primaryBtn; + margin-top: 20px; + margin-bottom: 20px; + display: inline-block; + } + .imagen { + padding: 2rem; + display: flex; + justify-content: center; + img { + width: 100%; + max-width: 540px; + } + } + .title { + h1 { + text-transform: uppercase; + } + } + } + &.top { + height: auto; + justify-content: end; + .button { + @include primaryBtn; + margin-top: 20px; + margin-bottom: 20px; + display: inline-block; + } + .imagen { + display: flex; + justify-content: flex-end; + img { + width: 100%; + max-width: 450px; + } + } + .title { + padding-top: 2rem; + h1 { + text-transform: uppercase; + text-align: center; + } + h3 { + display: none; + } + } + } + &.diagonal { + height: auto; + justify-content: end; + background-color: #f2f0f7; + .button { + margin-top: 20px; + margin-bottom: 20px; + display: inline-block; + } + .imagen { + display: flex; + justify-content: flex-end; + img { + width: 100%; + } + } + .title { + padding-top: 2rem; + h1 { + text-transform: uppercase; + color: #607ee7; + margin-bottom: 0; + } + h3 { + display: none; + } + } + } + + &.diagonalReverse { + height: auto; + justify-content: end; + background-color: #f2f0f7; + .button { + margin-top: 20px; + margin-bottom: 20px; + display: inline-block; + } + .imagen { + display: flex; + justify-content: flex-end; + img { + width: 100%; + } + } + .title { + padding-top: 2rem; + h1 { + text-transform: uppercase; + color: #607ee7; + margin-bottom: 0; + } + h3 { + display: none; + } + } + } + + .gatsby-image-wrapper { + display: block; + } + + @media screen and (min-width: $breakpoint-md) { + flex-direction: row; + align-items: flex-start; + &.hero { + height: 80vh; + position: relative; + .imagen { + max-height: 80vh; + overflow: hidden; + padding: 0; + justify-content: flex-end; + } + + .title { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + h1 { + margin-bottom: 1rem; + padding-right: 3rem; + } + h3 { + font-weight: 400; + padding-right: 3rem; + } + } + } + &.top { + height: 400px; + position: relative; + align-items: center; + .imagen { + max-height: 500px; + overflow: hidden; + padding: 0; + justify-content: flex-end; + img { + width: 100%; + max-width: 600px; + } + } + + .title { + position: absolute; + padding-top: 0; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + h1 { + margin-bottom: 1rem; + padding-right: 3rem; + text-align: left; + } + h3 { + font-weight: 400; + padding-right: 3rem; + } + } + } + &.diagonal { + height: 400px; + position: relative; + align-items: center; + .imagen { + height: 500px; + overflow: hidden; + padding: 0; + justify-content: flex-end; + img { + width: 100%; + } + } + + .title { + position: absolute; + padding-top: 0; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + h1 { + margin-bottom: 1rem; + padding-right: 3rem; + } + h3 { + font-weight: 400; + padding-right: 3rem; + } + } + } + &.diagonalReverse { + height: 400px; + position: relative; + align-items: center; + .imagen { + height: 500px; + overflow: hidden; + padding: 0; + justify-content: flex-end; + img { + width: 100%; + } + } + + .title { + position: absolute; + padding-top: 0; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + h1 { + margin-bottom: 1rem; + padding-right: 3rem; + } + h3 { + font-weight: 400; + padding-right: 3rem; + } + } + } + } +} diff --git a/src/components/BannerList/Banner.scss b/src/components/BannerList/Banner.scss index 27ed8d1d..4777f4ba 100644 --- a/src/components/BannerList/Banner.scss +++ b/src/components/BannerList/Banner.scss @@ -3,15 +3,31 @@ .bannerList { color: $primary; .card_item { - p { - text-align: justify; - margin: 0 !important; + h4 { + margin: 0; + } + a { + color: inherit; + &:hover { + color: $secondary; + } } img { + margin: 0 10px 0 auto; width: 48px; } } + button { + margin-top: 10px; + @include primaryBtn; + align-self: baseline; + a { + color: inherit; + } + } &__title { + display: flex; + flex-direction: column; font-weight: 700; text-align: left; } @@ -21,8 +37,37 @@ .bannerList { .card_item { img { - width: 70px; + width: 80px; } } + &__buttonMobile{ + display: none; + } + } +} + +@media screen and (max-width: $breakpoint-md) { + .bannerList { + &__buttonMobile{ + margin-left: 1.5em; + } + &__title { + button { + display: none; + } + } + } +} + +@media screen and (min-width: $breakpoint-md) { + .bannerList { + .card_item { + img { + width: 80px; + } + } + &__buttonMobile{ + display: none; + } } } diff --git a/src/components/BannerList/BannerLis.js b/src/components/BannerList/BannerLis.js deleted file mode 100644 index 0d93afed..00000000 --- a/src/components/BannerList/BannerLis.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from "react" -import "./Banner.scss" - -export default function BannerLis({ data }) { - const title = data?.title - const image = data?.Card[0]?.icon?.url - - const cards = data?.Card.map(item => { - return ( -
-
- -
-
-

{item.title}

-

{item.description}

-
-
- ) - }) - - return ( -
-
-

- {title} -

-
{cards}
-
-
- ) -} diff --git a/src/components/BannerList/BannerList.js b/src/components/BannerList/BannerList.js new file mode 100644 index 00000000..ff1db0eb --- /dev/null +++ b/src/components/BannerList/BannerList.js @@ -0,0 +1,58 @@ +import { Link } from "gatsby" +import React from "react" +import "./Banner.scss" + +export default function BannerList({ data }) { + const title = data?.title + const cards = data?.Card.map(item => { + return ( +
+ {item.icon && ( +
+ +
+ )} +
+ {item.landing_page ? ( + +

{item.title}

+

{item.description}

+ + ) : ( + <> +

{item.title}

+

{item.description}

+ + )} +
+
+ ) + }) + + return ( +
+
+

+ {title} + {data.contactForm && ( + + )} +

+
{cards} + +
+ {data.contactForm && ( + + )} + +
+
+ ) +} diff --git a/src/components/Footer/ContactData/contactData.js b/src/components/Footer/ContactData/contactData.js index 2b78cd4e..a7485e37 100644 --- a/src/components/Footer/ContactData/contactData.js +++ b/src/components/Footer/ContactData/contactData.js @@ -5,7 +5,7 @@ import "./contactData.scss"; export default function ContactData() { const data = useFooter(); - const dataFooter = data?.allStrapiLayout?.nodes[0].footer; + const dataFooter = data?.allStrapiLayout?.nodes[0]?.footer; const contact = dataFooter?.contact?.iconText.map((item) => { return ( diff --git a/src/components/Footer/Subscription/subscription.js b/src/components/Footer/Subscription/subscription.js index a353f7e2..fb73274f 100644 --- a/src/components/Footer/Subscription/subscription.js +++ b/src/components/Footer/Subscription/subscription.js @@ -4,11 +4,11 @@ import './subscription.scss'; export default function Subscription() { const data = useFooter(); - const dataSubscription = data?.allStrapiLayout?.nodes[0].footer.subscription; + const dataSubscription = data?.allStrapiLayout?.nodes[0]?.footer?.subscription; return (
-
{dataSubscription.title}
+
{dataSubscription?.title}