From ca56feb5039ab3ff1301d59b3ef435c51c9348f4 Mon Sep 17 00:00:00 2001 From: Drina_Rincon Date: Tue, 3 May 2022 12:25:56 -0300 Subject: [PATCH 1/2] Modificar banner para funcionalidad de lotti --- src/components/Banner/Banner.js | 26 +++++++++++++++++---- src/components/DualSection/DualSection.scss | 1 + src/components/Text/Text.scss | 22 +++++++++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/components/Banner/Banner.js b/src/components/Banner/Banner.js index a9da2101..29815c0c 100644 --- a/src/components/Banner/Banner.js +++ b/src/components/Banner/Banner.js @@ -1,4 +1,4 @@ -import React from "react" +import React, { useEffect, useState } from "react" import { Link } from "gatsby" import ReactMarkdown from "react-markdown" import Lottie from 'react-lottie' @@ -17,7 +17,9 @@ const Banner = ({ data }) => { const diagonalReverseState = variant === "diagonalReverse" ? "col-md-4" : "col-lg-6" - console.log(image) + console.log(image?.url) + + const [lottieLight, setLottieLight] = useState(null) const defaultOptions = { loop: true, @@ -25,9 +27,22 @@ const Banner = ({ data }) => { rendererSettings: { preserveAspectRatio: 'xMidYMid slice' }, - path: image?.url, } + useEffect(() => { + //if (image.mime === "application/json") { + + fetch("https://strapi-s3-bitlogic-dev.s3.sa-east-1.amazonaws.com/coffe_b531a703f3.json", { + method: 'GET', // or 'PUT' + mode: 'cors', + headers: { + 'Access-Control-Allow-Origin': '*' + } + }).then(res => res.json()) + .catch(error => console.error('Error:', error)) + .then(res => setLottieLight(res)); + }, []) + return (
{ > {/* {title} */} - {image?.mime === "application/json" ? : : {title}} diff --git a/src/components/DualSection/DualSection.scss b/src/components/DualSection/DualSection.scss index 1ccf03a1..4f471022 100644 --- a/src/components/DualSection/DualSection.scss +++ b/src/components/DualSection/DualSection.scss @@ -53,6 +53,7 @@ &-img { flex-basis: 55%; img { + border-radius: 8px; width: 100%; padding: 0; } diff --git a/src/components/Text/Text.scss b/src/components/Text/Text.scss index eb6c0492..e0a7fc16 100644 --- a/src/components/Text/Text.scss +++ b/src/components/Text/Text.scss @@ -13,7 +13,7 @@ background-color: $primary-container; border-radius: 10px; p:first-child { - padding-top: 1rem; + padding-top: 29px; } p { color: $primary; @@ -26,13 +26,27 @@ padding-bottom: 3rem; .notTitle { + display: flex; + flex-direction: column; + justify-content: center; color: $primary; border-radius: 20px; background-color: $primary-container; - padding: 1rem; - margin: 1.5rem 0rem; - p:nth-last-child(-n + 2) { + padding: 0rem 1rem; + + p:first-child { + padding-top: 29px; + } + + h6 { margin-bottom: 0px; + + &:last-child { + padding-bottom: 29px; + } + strong { + font-size: 16px !important; + } } } } From be62d5b8cc7fd2184dd22b0eadca3ef0263cb457 Mon Sep 17 00:00:00 2001 From: Drina_Rincon Date: Tue, 3 May 2022 12:33:02 -0300 Subject: [PATCH 2/2] modificar permisos y url --- src/components/Banner/Banner.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/Banner/Banner.js b/src/components/Banner/Banner.js index 29815c0c..c3ab5314 100644 --- a/src/components/Banner/Banner.js +++ b/src/components/Banner/Banner.js @@ -32,12 +32,8 @@ const Banner = ({ data }) => { useEffect(() => { //if (image.mime === "application/json") { - fetch("https://strapi-s3-bitlogic-dev.s3.sa-east-1.amazonaws.com/coffe_b531a703f3.json", { + fetch(image?.url, { method: 'GET', // or 'PUT' - mode: 'cors', - headers: { - 'Access-Control-Allow-Origin': '*' - } }).then(res => res.json()) .catch(error => console.error('Error:', error)) .then(res => setLottieLight(res));