Skip to content

Commit 5c8fa53

Browse files
authored
Merge pull request #62 from bitlogic/develop
Release 24-09-2024
2 parents 5abe3d1 + de6e7f8 commit 5c8fa53

File tree

27 files changed

+724
-1031
lines changed

27 files changed

+724
-1031
lines changed

gatsby-config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
trailingSlash: "always",
23
siteMetadata: {
34
title: "Bitlogic | End-to-end software development",
45
description: `Bitlogic Web is a company dedicated to the design, engineering, and agile development of software products, specializing in the digital transformation of educational institutions.`,
@@ -39,7 +40,7 @@ module.exports = {
3940
lastmod: homePage.updated_at,
4041
},
4142
{
42-
path: "/blog",
43+
path: "/blog/",
4344
lastmod: blogPage.updated_at,
4445
},
4546
]
@@ -89,8 +90,9 @@ module.exports = {
8990
{
9091
resolve: `gatsby-plugin-canonical-urls`,
9192
options: {
93+
stripQueryString: true,
9294
siteUrl: process.env.SITE_URL,
93-
// siteUrl: "https://bitlogic.io",
95+
// siteUrl: "https://en.bitlogic.io",
9496
},
9597
},
9698
{

src/components/Banner/Banner.js

Lines changed: 59 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,76 @@
11
import React from "react"
2-
import { Link } from "gatsby"
32
import MarkdownView from "react-showdown"
43
//import ReactMarkdown from "react-markdown"
5-
import Lottie from 'react-lottie'
4+
import Lottie from "react-lottie"
65
import { useTheme } from "../../context/themeContext"
7-
import { useLandingUrl } from '../../hooks'
86
import "./Banner.scss"
9-
import PropTypes from 'prop-types'
7+
import PropTypes from "prop-types"
8+
import CustomLink from "../CustomLink/CustomLink"
9+
import CustomImage from "../CustomImage/CustomImage"
1010

1111
const Banner = ({ data }) => {
1212
const { theme } = useTheme()
1313
const { title, variant, summary, animation, image, imageDark, button } = data
14-
const getUrl = useLandingUrl()
1514

1615
const defaultOptions = {
1716
loop: true,
1817
autoplay: true,
1918
rendererSettings: {
20-
preserveAspectRatio: 'xMidYMid slice'
19+
preserveAspectRatio: "xMidYMid slice",
2120
},
2221
}
2322

24-
const Button = ({ button }) => {
25-
if (button?.english_landing_page) {
26-
return (
27-
<Link
28-
className="button"
29-
araa-label={`Navigate to ${button.content}`}
30-
to={getUrl(button.english_landing_page.slug)}
31-
>
32-
{button?.content}
33-
</Link>
34-
)
35-
} else if (button?.url) {
36-
if (button.url?.startsWith('https')) {
37-
return (
38-
<a href={button.url}
39-
target="_blank"
40-
rel="noreferrer"
41-
className="button"
42-
aria-label="External Link"
43-
>
44-
{button?.content}
45-
</a>
46-
)
47-
} else {
48-
return (
49-
<a
50-
href={button.url}
51-
className="button"
52-
aria-label={`Navigate to ${button.content}`}
53-
>
54-
{button?.content}
55-
</a>
56-
)
57-
}
58-
}
59-
60-
return null
61-
};
62-
6323
const showTitle = () => {
64-
if (variant === "hero") {
65-
return <h1>{title}</h1>
66-
} else {
24+
if (variant === "diagonal" || variant === "diagonalReverse") {
6725
return <h2>{title}</h2>
6826
}
27+
28+
return <h1>{title}</h1>
6929
}
7030

7131
return (
72-
<div
73-
className={`banner ${variant}`}
74-
id={data?.strapi_component + "-" + data?.id}
75-
>
32+
<div className={`banner ${variant}`}>
7633
<div className="container banner__wrapper">
77-
{variant === "background" ?
78-
<div
79-
className="bgImage"
80-
style={{
81-
backgroundImage: `url(${image?.url})`,
82-
backgroundPosition: 'center',
83-
// backgroundSize: 'cover',
84-
}}>
85-
<div className="title-background ">
86-
<h1 style={{ color: theme === 'dark' ? 'white' : '#3F6BE8' }}>{title}</h1>
87-
{<MarkdownView
34+
<div className="title container-md">
35+
<div>
36+
{/* {variant === "hero" ? <h1>{title}</h1> : <h2>{title}</h2>} */}
37+
{showTitle()}
38+
{
39+
<MarkdownView
8840
markdown={summary}
8941
dangerouslySetInnerHTML={{ __html: summary }}
90-
/>}
91-
<Button button={button} />
92-
</div>
93-
</div> :
94-
<>
95-
<div className="title container-md">
96-
<div>
97-
{/* {variant === "hero" ? <h1>{title}</h1> : <h2>{title}</h2>} */}
98-
{showTitle()}
99-
{<MarkdownView
100-
markdown={summary}
101-
dangerouslySetInnerHTML={{ __html: summary }}
102-
/>}
103-
{/* <ReactMarkdown source={summary} className="banner-markdown" />*/}
104-
<Button button={button} />
105-
</div>
106-
</div>
42+
/>
43+
}
44+
<CustomLink
45+
content={button?.content}
46+
url={button?.url}
47+
landing={button?.english_landing_page}
48+
className={"button"}
49+
/>
50+
</div>
51+
</div>
10752

108-
<div className="imagen">
109-
{/* <img src={image?.url} alt={title} /> */}
110-
{image?.url ? (
111-
<img
112-
src={theme === "dark" && imageDark ? imageDark?.url : image?.url}
113-
width={290}
114-
height={200}
115-
alt={image?.alternativeText
116-
? image.alternativeText
117-
: title
118-
}
119-
/>) : (
120-
<div className="cont-lottie">
121-
{animation && <Lottie options={{
53+
<div className="imagen">
54+
{image ? (
55+
<CustomImage
56+
image={theme === "dark" && imageDark ? imageDark : image}
57+
width={290}
58+
height={200}
59+
alt={image?.alternativeText || title}
60+
/>
61+
) : (
62+
<div className="cont-lottie">
63+
{animation && (
64+
<Lottie
65+
options={{
12266
...defaultOptions,
12367
animationData: animation,
12468
}}
125-
/>}
126-
</div>
69+
/>
12770
)}
12871
</div>
129-
</>
130-
}
72+
)}
73+
</div>
13174
</div>
13275
</div>
13376
)
@@ -142,15 +85,29 @@ Banner.propTypes = {
14285
content: PropTypes.string.isRequired,
14386
url: PropTypes.string,
14487
english_landing_page: PropTypes.shape({
145-
slug: PropTypes.string.isRequired
146-
})
88+
slug: PropTypes.string.isRequired,
89+
}),
14790
}),
14891
animation: PropTypes.object,
14992
image: PropTypes.shape({
15093
alternativeText: PropTypes.string,
15194
url: PropTypes.string,
152-
})
153-
}).isRequired
95+
localFile: PropTypes.shape({
96+
childImageSharp: PropTypes.shape({
97+
gatsbyImageData: PropTypes.object,
98+
}),
99+
}),
100+
}),
101+
imageDark: PropTypes.shape({
102+
alternativeText: PropTypes.string,
103+
url: PropTypes.string,
104+
localFile: PropTypes.shape({
105+
childImageSharp: PropTypes.shape({
106+
gatsbyImageData: PropTypes.object,
107+
}),
108+
}),
109+
}),
110+
}).isRequired,
154111
}
155112

156113
export default Banner

0 commit comments

Comments
 (0)