Skip to content

Commit c94a3f3

Browse files
Merge pull request #368 from bitlogic/dev
Release 3
2 parents 1e342df + 3983025 commit c94a3f3

File tree

19 files changed

+382
-135
lines changed

19 files changed

+382
-135
lines changed

src/components/Banner/Banner.js

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CustomImage from "../CustomImage/CustomImage"
99

1010
const Banner = ({ data }) => {
1111
const { theme } = useTheme()
12-
const { title, variant, summary, animation, image, imageDark, button } = data
12+
const { title, variant, summary, animation, image, imageDark, arrayButtons, button } = data
1313

1414
const defaultOptions = {
1515
loop: true,
@@ -39,14 +39,27 @@ const Banner = ({ data }) => {
3939
dangerouslySetInnerHTML={{ __html: summary }}
4040
/>
4141
)}
42-
{button && (
43-
<CustomLink
44-
content={button.content}
45-
url={button?.url}
46-
landing={button?.landing_page}
47-
className={"button"}
48-
/>
42+
{Array.isArray(arrayButtons) && arrayButtons.length > 0 && (
43+
<div className="banner__buttons">
44+
{arrayButtons.map((btn, index) => (
45+
<CustomLink
46+
key={index}
47+
content={btn.content}
48+
url={btn.url}
49+
landing={btn.landing_page}
50+
className="button"
51+
/>
52+
))}
53+
</div>
4954
)}
55+
{button && (
56+
<CustomLink
57+
content={button.content}
58+
url={button?.url}
59+
landing={button?.landing_page}
60+
className={'button'}
61+
/>
62+
)}
5063
</div>
5164
</div>
5265

@@ -79,6 +92,15 @@ Banner.propTypes = {
7992
title: PropTypes.string.isRequired,
8093
variant: PropTypes.string.isRequired,
8194
summary: PropTypes.string,
95+
arrayButtons: PropTypes.arrayOf(
96+
PropTypes.shape({
97+
content: PropTypes.string,
98+
url: PropTypes.string,
99+
landing_page: PropTypes.shape({
100+
slug: PropTypes.string.isRequired,
101+
}),
102+
})
103+
),
82104
button: PropTypes.shape({
83105
content: PropTypes.string.isRequired,
84106
url: PropTypes.string,

src/components/Banner/Banner.scss

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@
170170
&.diagonalReverse {
171171
.banner__wrapper {
172172
margin: 32px auto;
173+
display: flex;
174+
flex-direction: column;
173175
}
174176

175177
.imagen {
@@ -183,14 +185,23 @@
183185
object-fit: cover;
184186
}
185187
}
186-
188+
//aca estan los botones
189+
.banner__buttons{
190+
display: flex;
191+
flex-direction: row;
192+
justify-content: flex-start;
193+
padding-top: 25px;
194+
padding-right: 10px;
195+
}
196+
187197
.button {
188-
margin-top: 20px;
189-
margin-bottom: 20px;
190-
display: inline-block;
191-
color: #607ee7;
192-
text-decoration: underline;
193-
padding-left: 5px;
198+
color:$primary;
199+
200+
@include primaryBtn;
201+
display: block;
202+
width: max-content;
203+
padding: 10px 15px;
204+
margin-right: 20px;
194205
}
195206

196207
.title {
@@ -332,7 +343,7 @@
332343
}
333344
}
334345
}
335-
346+
// modificar aca en deskyop
336347
&.diagonalReverse {
337348
.banner__wrapper {
338349
height: 400px;
@@ -356,9 +367,6 @@
356367
}
357368
}
358369

359-
.button {
360-
padding-left: 5rem;
361-
}
362370

363371
.title {
364372
display: flex;

src/components/BannerList/Banner.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@
4444
a {
4545
margin-top: 10px;
4646
@include primaryBtn;
47-
align-self: baseline;
47+
align-self: flex-start;
4848

49-
@media screen and (max-width: ($breakpoint-md - 1px)) {
50-
display: none;
51-
}
49+
@media screen and (max-width: ($breakpoint-md - 1px)) {
50+
display: inline-block;
51+
@include primaryBtn;
52+
text-align: center;
53+
align-self:flex-start;
54+
}
55+
5256
}
5357
}
5458
}

src/components/Banners/BannerTop.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,26 @@ const BannerTop = ({ banner }) => {
1212

1313
return (
1414
<div className={`BannerTop ${variant}`}>
15-
<BgImage image={imageBanner} className="BannerTop__bgImage">
15+
{imageBanner ? (
16+
<BgImage
17+
image={imageBanner}
18+
className="BannerTop__bgImage"
19+
loading="eager"
20+
fetchpriority="high"
21+
>
22+
<div className="BannerTop__titleContainer">
23+
<h1 className={`BannerTop__title ${variant && "background container"}`}>
24+
{title}
25+
</h1>
26+
</div>
27+
</BgImage>
28+
) : (
1629
<div className="BannerTop__titleContainer">
17-
<h1
18-
className={`BannerTop__title ${variant && "background container"}`}
19-
>
30+
<h1 className={`BannerTop__title ${variant && "background container"}`}>
2031
{title}
2132
</h1>
2233
</div>
23-
</BgImage>
34+
)}
2435
</div>
2536
)
2637
}
@@ -38,4 +49,4 @@ BannerTop.propTypes = {
3849
}).isRequired,
3950
}
4051

41-
export default BannerTop
52+
export default BannerTop

src/components/Banners/BannerTop.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@
5656
}
5757
}
5858
}
59-
}
59+
}

src/components/FaIcon/FaIcon.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
import React from "react"
22
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
33
import { faEnvelope, faLocationDot } from "@fortawesome/free-solid-svg-icons"
4-
import { faLinkedin, faTwitter, faInstagram, faYoutube, faSpotify } from "@fortawesome/free-brands-svg-icons"
4+
import {
5+
faLinkedin,
6+
faInstagram,
7+
faYoutube,
8+
faSpotify,
9+
faXTwitter,
10+
} from "@fortawesome/free-brands-svg-icons"
511
import PropTypes from "prop-types"
612

7-
// Mapeo de los íconos que se usan
813
const iconMap = {
914
"fa-envelope": faEnvelope,
1015
"fa-location-dot": faLocationDot,
1116
"fa-linkedin": faLinkedin,
12-
"fa-twitter": faTwitter,
17+
"fa-x-twitter": faXTwitter,
1318
"fa-instagram": faInstagram,
1419
"fa-youtube": faYoutube,
1520
"fa-spotify": faSpotify,
1621
}
1722

1823
const FaIcon = ({ type, code }) => {
19-
const icon = iconMap[code]
24+
const normalizedCode = code?.toLowerCase()
25+
const icon = iconMap[normalizedCode]
2026

2127
if (!icon) {
2228
console.warn(`Icono no encontrado: type=${type}, code=${code}`)
@@ -31,4 +37,4 @@ FaIcon.propTypes = {
3137
code: PropTypes.string.isRequired,
3238
}
3339

34-
export default FaIcon
40+
export default FaIcon

src/components/Footer/SocialLinks/socialLinks.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@ import PropTypes from "prop-types"
88
export default function SocialLinks({ image, socialMedia }) {
99
const logo = getImage(image?.localFile?.childImageSharp?.gatsbyImageData)
1010

11-
const socialMediaItems = socialMedia?.map(item => {
12-
return (
13-
<a
14-
key={item.id}
15-
href={item.url}
16-
target="_blank"
17-
className={`btn-social m-2 btn-social-icon btn-${item.icon?.name}`}
18-
rel="noreferrer"
19-
aria-label={`Link externo a ${item?.name}`}
20-
>
21-
<FaIcon type={item.icon?.type} code={item.icon?.code} />
22-
</a>
23-
)
24-
})
11+
const socialMediaItems = socialMedia?.map(item => (
12+
<a
13+
key={item.id}
14+
href={item.url}
15+
target="_blank"
16+
className={`btn-social m-2 btn-social-icon btn-${item.icon?.name}`}
17+
rel="noreferrer"
18+
aria-label={`Link externo a ${item?.name}`}
19+
>
20+
<FaIcon type={item.icon?.type} code={item.icon?.code} />
21+
</a>
22+
))
2523

2624
return (
2725
<div className="Footer__socialMedia d-flex flex-column">
@@ -60,6 +58,9 @@ SocialLinks.propTypes = {
6058
url: PropTypes.string,
6159
name: PropTypes.string,
6260
icon: PropTypes.shape({
61+
name: PropTypes.string,
62+
type: PropTypes.string,
63+
code: PropTypes.string,
6364
url: PropTypes.string,
6465
alternativeText: PropTypes.string,
6566
localFile: PropTypes.shape({

src/components/Seo/Seo.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ function Seo({ description, lang, meta, title, keywords }) {
7676
content: metaDescription,
7777
},
7878
].concat(meta)}
79-
link={[{
80-
rel: "canonical",
81-
href:'https://es.bitlogic.io',
82-
}
83-
]}
8479
/>
8580
)
8681
}

src/components/Text/Text.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
flex: 2;
2323
background-color: $primary-container;
2424
border-radius: 10px;
25-
padding: 32px 16px;
25+
padding: 32px 35px;
2626
@media (min-width: $breakpoint-lg) {
2727
padding: 24px 32px;
2828
}

src/components/layout.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import React, { lazy, Suspense } from "react"
1+
import React, { lazy, Suspense, useEffect } from "react"
22
import Header from "./header"
33
import ThemeProvider from "../context/themeContext"
44
import Footer from "./Footer/Footer"
55
import "./layout.scss"
66
import PropTypes from "prop-types"
77
import "./FontAwesomeOne/FontAwesomeOne"
8+
import { Helmet } from "react-helmet"
9+
import { useStaticQuery, graphql } from "gatsby"
810

911
const BannerRedirect = lazy(() => import("./BannerRedirect/BannerRedirect"))
1012

@@ -16,7 +18,7 @@ const Layout = ({ children, options = {}, location }) => {
1618

1719
options = { ...defaultOptions, ...options }
1820

19-
React.useEffect(() => {
21+
useEffect(() => {
2022
const hash = location?.state?.component
2123
let el = hash && document.getElementById(hash)
2224
if (el) {
@@ -27,17 +29,50 @@ const Layout = ({ children, options = {}, location }) => {
2729
const userLanguage =
2830
typeof window !== "undefined" ? navigator.language : undefined
2931

32+
const { allStrapiHome } = useStaticQuery(graphql`
33+
query PreloadDynamicHero {
34+
allStrapiHome {
35+
nodes {
36+
body {
37+
strapi_component
38+
backgroundImage {
39+
url
40+
}
41+
}
42+
}
43+
}
44+
}
45+
`)
46+
47+
const heroBlock = allStrapiHome.nodes[0].body.find(
48+
b => b.strapi_component === "home.video-background"
49+
)
50+
51+
const raw = heroBlock?.backgroundImage?.url
52+
const heroUrl = raw
53+
? raw.startsWith("http")
54+
? raw
55+
: `https://strapi-s3-bitlogic.s3.sa-east-1.amazonaws.com${raw}`
56+
: null
57+
3058
return (
3159
<ThemeProvider>
60+
<Helmet>
61+
<meta name="viewport" content="width=device-width, initial-scale=1" />
62+
{/* 🔻 Preload eliminado para evitar error CORS */}
63+
</Helmet>
64+
3265
{options.hasHeader && <Header />}
66+
3367
{userLanguage?.startsWith("en") && (
34-
<Suspense fallback>
68+
<Suspense fallback={null}>
3569
<BannerRedirect />
3670
</Suspense>
3771
)}
72+
3873
<main>{children}</main>
74+
3975
{options.hasFooter && <Footer />}
40-
{/*© {new Date().getFullYear()}, Built with*/}
4176
</ThemeProvider>
4277
)
4378
}

0 commit comments

Comments
 (0)