Skip to content

Commit a7a8a33

Browse files
Merge pull request #266 from bitlogic/dev
Release 11-06-2024
2 parents 30a120c + 3a8dc64 commit a7a8a33

File tree

15 files changed

+583
-337
lines changed

15 files changed

+583
-337
lines changed

gatsby-config.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ module.exports = {
44
description: `Bitlogic Web es una empresa dedicada al diseño, ingeniería y desarrollo ágil de productos de software, especializada en la transformación digital de instituciones educativas .`,
55
author: `Bitlogic.io`,
66
siteUrl: process.env.SITE_URL,
7-
// siteUrl: 'https://bitlogic.io',
7+
// siteUrl: "https://bitlogic.io",
88
},
99
plugins: [
1010
{
1111
resolve: `gatsby-plugin-sitemap`,
1212
options: {
13-
output: '/',
13+
output: "/",
1414
query: `
1515
{
1616
allSitePage {
@@ -31,26 +31,26 @@ module.exports = {
3131
resolvePages: ({
3232
allSitePage: { nodes: allPages },
3333
strapiBlogPage: blogPage,
34-
strapiHome: homePage
34+
strapiHome: homePage,
3535
}) => {
3636
const singlePages = [
3737
{
38-
path: '/',
39-
lastmod: homePage.updated_at
38+
path: "/",
39+
lastmod: homePage.updated_at,
4040
},
4141
{
42-
path: '/blog',
43-
lastmod: blogPage.updated_at
44-
}
45-
];
42+
path: "/blog",
43+
lastmod: blogPage.updated_at,
44+
},
45+
]
4646

4747
return allPages.map(page => {
48-
if (page.path === '/') return singlePages[0]
49-
else if (page.path === '/blog/') return singlePages[1]
48+
if (page.path === "/") return singlePages[0]
49+
else if (page.path === "/blog/") return singlePages[1]
5050

5151
return {
5252
path: page.path,
53-
lastmod: page?.pageContext?.lastmod
53+
lastmod: page?.pageContext?.lastmod,
5454
}
5555
})
5656
},
@@ -60,27 +60,30 @@ module.exports = {
6060
lastmod: lastmod,
6161
}
6262
},
63-
}
63+
},
6464
},
6565
{
66-
resolve: 'gatsby-plugin-robots-txt',
66+
resolve: "gatsby-plugin-robots-txt",
6767
options: {
6868
host: process.env.SITE_URL,
6969
sitemap: `${process.env.SITE_URL}/sitemap-index.xml`,
70-
policy: [{ userAgent: '*', allow: '/' }]
71-
}
70+
policy: [{ userAgent: "*", allow: "/" }],
71+
},
7272
},
7373
{
7474
resolve: `gatsby-plugin-google-gtag`,
7575
options: {
7676
// You can add multiple tracking ids and a pageview event will be fired for all of them.
77-
trackingIds: [
78-
"G-F6VPYEJ1X0", // Google Analytics / G
79-
],
77+
trackingIds: ["G-F6VPYEJ1X0"],
78+
gtagConfig: {
79+
anonymize_ip: true,
80+
cookie_expires: 0,
81+
cookie_flags: "SameSite=None; Secure",
82+
},
8083
// This object is used for configuration specific to this plugin
8184
pluginConfig: {
82-
// Puts tracking script in the head instead of the body
8385
head: true,
86+
respectDNT: true,
8487
},
8588
},
8689
},
@@ -95,7 +98,7 @@ module.exports = {
9598
{
9699
resolve: `gatsby-plugin-canonical-urls`,
97100
options: {
98-
// siteUrl: 'https://bitlogic.io',
101+
// siteUrl: "https://bitlogic.io",
99102
siteUrl: process.env.SITE_URL,
100103
},
101104
},
@@ -105,7 +108,7 @@ module.exports = {
105108
// apiURL: `http://lb-bitlogic-strapi-dev-48805770.sa-east-1.elb.amazonaws.com:1337`,
106109
// apiURL: `https://strapi.bitlogic.io`,
107110
apiURL: process.env.STRAPI_URL,
108-
// apiURL: 'http://127.0.0.1:1337',
111+
// apiURL: "http://127.0.0.1:1337",
109112
queryLimit: 1000,
110113
collectionTypes: [
111114
`article`,
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import React from "react";
2-
import { GatsbyImage, getImage } from "gatsby-plugin-image";
1+
import React, { memo } from "react"
2+
import { GatsbyImage, getImage } from "gatsby-plugin-image"
33
import PropTypes from "prop-types"
44

5-
const CustomImage = ({ image, className, alt, width, height }) => {
5+
const CustomImage = memo(({ image, className, alt, width, height }) => {
6+
if (!image) return null
67

7-
if (!image) return null;
8-
9-
const { url, localFile } = image;
8+
const { url, localFile } = image
109

1110
if (localFile) {
12-
const localImage = getImage(localFile);
11+
const localImage = getImage(localFile)
1312

1413
return (
15-
<GatsbyImage loading="lazy"
14+
<GatsbyImage
15+
loading="lazy"
1616
image={localImage}
1717
alt={alt}
1818
className={className}
@@ -23,15 +23,16 @@ const CustomImage = ({ image, className, alt, width, height }) => {
2323
}
2424

2525
return (
26-
<img loading="lazy"
26+
<img
27+
loading="lazy"
2728
src={url}
2829
alt={alt}
2930
className={className}
3031
width={width}
3132
height={height}
3233
/>
3334
)
34-
}
35+
})
3536

3637
CustomImage.propTypes = {
3738
className: PropTypes.string,
@@ -42,10 +43,10 @@ CustomImage.propTypes = {
4243
url: PropTypes.string,
4344
localFile: PropTypes.shape({
4445
childImageSharp: PropTypes.shape({
45-
gatsbyImageData: PropTypes.object.isRequired
46-
})
47-
})
48-
})
46+
gatsbyImageData: PropTypes.object.isRequired,
47+
}),
48+
}),
49+
}),
4950
}
5051

51-
export default CustomImage;
52+
export default CustomImage
Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from "react";
1+
import React from "react"
22
import PropTypes from "prop-types"
33

44
/* Imports sections */
55
// import BlogContainer from '../BlogPage/BlogContainer'
6-
import VideoBackground from "../videoBackground/VideoBackground";
7-
import PipedriveForm from "../Form/PipedriveForm";
8-
import Hero from '../Hero/Hero';
6+
import ListItems from "../ListItems/ListItems"
7+
import VideoBackground from "../videoBackground/VideoBackground"
8+
import PipedriveForm from "../Form/PipedriveForm"
9+
import Hero from "../Hero/Hero"
910
import {
1011
AnimatedTransitionContinous,
1112
Banner,
@@ -20,43 +21,44 @@ import {
2021
LogosSection,
2122
Professionals,
2223
Quote,
23-
Text
24-
} from '../';
24+
Text,
25+
} from "../"
2526

2627
const COMPONENTS = Object.freeze({
27-
'home.transition': AnimatedTransitionContinous,
28-
'components.banner': Banner,
29-
'components.banner-list': BannerList,
30-
'components.selected-grid': ExpandGrid,
31-
'components.featured-blogs': FeaturedBlogs,
32-
'components.pipedrive-form': PipedriveForm,
33-
'components.logos-section': LogosSection,
34-
'components.professionals-section': Professionals,
35-
'home.quote': Quote,
36-
'components.text': Text,
37-
'home.video-background': VideoBackground,
38-
'home.hero': Hero,
39-
'scripts.catsone': Catsone,
40-
'components.cases-section': ({ data }) => (data?.allCases
41-
? <CasesList data={data} />
42-
: <CasesSection data={data} />
43-
),
44-
'home.dual-section': ({ data }) => (data?.dualSectionPart?.length === 1
45-
? <OneSection data={data} />
46-
: <DualSection data={data} />
47-
)
48-
});
28+
"home.transition": AnimatedTransitionContinous,
29+
"components.banner": Banner,
30+
"components.banner-list": BannerList,
31+
"components.selected-grid": ExpandGrid,
32+
"components.featured-blogs": FeaturedBlogs,
33+
"components.pipedrive-form": PipedriveForm,
34+
"components.logos-section": LogosSection,
35+
"components.professionals-section": Professionals,
36+
"home.quote": Quote,
37+
"components.text": Text,
38+
"home.video-background": VideoBackground,
39+
"home.hero": Hero,
40+
"components.list-items": ListItems,
41+
"scripts.catsone": Catsone,
42+
"components.cases-section": ({ data }) =>
43+
data?.allCases ? <CasesList data={data} /> : <CasesSection data={data} />,
44+
"home.dual-section": ({ data }) =>
45+
data?.dualSectionPart?.length === 1 ? (
46+
<OneSection data={data} />
47+
) : (
48+
<DualSection data={data} />
49+
),
50+
})
4951

5052
const CustomSection = ({ sections }) => {
51-
const sectionResult = sections.map((section) => {
52-
53+
const sectionResult = sections.map(section => {
5354
if (!section?.strapi_component) return null
5455

5556
const Component = COMPONENTS[section.strapi_component]
5657

5758
if (Component) {
5859
return (
59-
<Component data={section}
60+
<Component
61+
data={section}
6062
key={`${section.strapi_component}-${section.id}`}
6163
/>
6264
)
@@ -65,17 +67,11 @@ const CustomSection = ({ sections }) => {
6567
return null
6668
})
6769

68-
return (
69-
<>
70-
{sectionResult}
71-
</>
72-
)
70+
return <>{sectionResult}</>
7371
}
7472

7573
CustomSection.propTypes = {
76-
sections: PropTypes.arrayOf(
77-
PropTypes.object
78-
)
74+
sections: PropTypes.arrayOf(PropTypes.object),
7975
}
8076

81-
export default CustomSection;
77+
export default CustomSection

src/components/DualSection/DualSection.js

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,88 @@ import "./DualSection.scss"
33
import MarkdownView from "react-showdown"
44
import CustomImage from "../CustomImage/CustomImage"
55
import CustomLink from "../CustomLink/CustomLink"
6+
import PropTypes from "prop-types"
67

78
export default function DualSection({ data }) {
89
const dualSectionParts = data?.dualSectionPart
9-
const listSectionParts = dualSectionParts.map(section => (
10+
const { title, summary } = data
11+
12+
const listSectionParts = dualSectionParts?.map(section => (
1013
<div
1114
key={section.id}
12-
className={`dualSection ${section.length === 3 ? "col - md - 4" : "col - md - 6"
13-
} my-2 p-md-3 p-xl-4`}
15+
className={`dualSection d-flex flex-column ${
16+
section.length === 3 ? "col - md - 4" : "col - md - 6"
17+
}`}
1418
>
1519
<div className="dualSection__image">
16-
<CustomImage image={section?.image}
20+
<CustomImage
21+
image={section?.image}
1722
width={290}
1823
height={250}
1924
alt={section?.image?.alternativeText || section.title}
20-
className=''
25+
className=""
2126
/>
2227
</div>
23-
2428
<div className="dualSection__textContainer">
25-
<h4>{section.title}</h4>
26-
{section?.description && (
27-
<div>
28-
<MarkdownView
29-
markdown={section.description}
30-
dangerouslySetInnerHTML={{ __html: section.description }}
29+
{section.button ? (
30+
<h3 className="dualSection__title active">
31+
<CustomLink
32+
content={section.title}
33+
url={section.button?.url}
34+
landing={section.button?.landing_page}
35+
className="dualSection__title active"
3136
/>
32-
</div>
37+
</h3>
38+
) : (
39+
<h3 className="dualSection__title">{section.title}</h3>
3340
)}
34-
{section.button && (
35-
<CustomLink
36-
content={section.button.content}
37-
url={section.button?.url}
38-
landing={section.button?.landing_page}
39-
className=''
41+
{section?.description && (
42+
<MarkdownView
43+
markdown={section.description}
44+
dangerouslySetInnerHTML={{ __html: section.description }}
4045
/>
4146
)}
4247
</div>
4348
</div>
4449
))
4550

4651
return (
47-
<div className="container py-3">
48-
<div className="d-flex flex-column flex-md-row">
52+
<section className="DualSection container py-5">
53+
{title && <h2>{title}</h2>}
54+
{summary && <p className="summary">{summary}</p>}
55+
<div className={`d-flex flex-column flex-md-row ${title && "pt-4"}`}>
4956
{listSectionParts}
5057
</div>
51-
</div>
58+
</section>
5259
)
5360
}
61+
62+
DualSection.propTypes = {
63+
data: PropTypes.shape({
64+
title: PropTypes.string,
65+
summary: PropTypes.string,
66+
dualSectionPart: PropTypes.arrayOf(
67+
PropTypes.shape({
68+
id: PropTypes.number.isRequired,
69+
title: PropTypes.string.isRequired,
70+
description: PropTypes.string,
71+
button: PropTypes.shape({
72+
content: PropTypes.string,
73+
url: PropTypes.string,
74+
landing_page: PropTypes.shape({
75+
slug: PropTypes.string.isRequired,
76+
}),
77+
}),
78+
image: PropTypes.shape({
79+
url: PropTypes.string.isRequired,
80+
alternativeText: PropTypes.string,
81+
localFile: PropTypes.shape({
82+
childImageSharp: PropTypes.shape({
83+
gatsbyImageData: PropTypes.object.isRequired,
84+
}),
85+
}),
86+
}).isRequired,
87+
})
88+
),
89+
}),
90+
}

0 commit comments

Comments
 (0)