Skip to content

Commit 3ceb174

Browse files
Merge pull request #63 from bitlogic/SBIT-400
SBIT-400: fix code smells to sonar
2 parents de6e7f8 + c6445db commit 3ceb174

File tree

21 files changed

+308
-480
lines changed

21 files changed

+308
-480
lines changed

src/components/Banner/Banner.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react"
22
import MarkdownView from "react-showdown"
3-
//import ReactMarkdown from "react-markdown"
43
import Lottie from "react-lottie"
54
import { useTheme } from "../../context/themeContext"
65
import "./Banner.scss"
@@ -33,20 +32,21 @@ const Banner = ({ data }) => {
3332
<div className="container banner__wrapper">
3433
<div className="title container-md">
3534
<div>
36-
{/* {variant === "hero" ? <h1>{title}</h1> : <h2>{title}</h2>} */}
3735
{showTitle()}
3836
{
3937
<MarkdownView
4038
markdown={summary}
4139
dangerouslySetInnerHTML={{ __html: summary }}
4240
/>
4341
}
44-
<CustomLink
45-
content={button?.content}
46-
url={button?.url}
47-
landing={button?.english_landing_page}
48-
className={"button"}
49-
/>
42+
{button && (
43+
<CustomLink
44+
content={button?.content}
45+
url={button?.url}
46+
landing={button?.english_landing_page}
47+
className={"button"}
48+
/>
49+
)}
5050
</div>
5151
</div>
5252

src/components/BannerHead/BannerHead.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/components/BannerHead/BannerHead.scss

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/components/BannerList/BannerList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function BannerList({ data }) {
1515
<div className="card_item">
1616
<CustomImage
1717
image={item?.icon}
18-
alt={item?.icon?.alternativeText || item?.icon?.name}
18+
alt={item?.icon?.alternativeText || item.title}
1919
className={"d-block"}
2020
width={70}
2121
height={70}

src/components/CustomImage/CustomImage.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import PropTypes from "prop-types"
55
const CustomImage = ({ image, className, alt, width, height }) => {
66
if (!image) return null
77

8-
98
const { url, localFile } = image
9+
const localImage = getImage(localFile?.childImageSharp?.gatsbyImageData)
1010

11-
if (localFile) {
12-
const localImage = getImage(localFile?.childImageSharp?.gatsbyImageData)
13-
11+
if (localImage) {
1412
return (
1513
<GatsbyImage
1614
loading="lazy"

src/components/DualSection/OneSection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const OneSection = ({ data: { dualSectionPart } }) => {
6060
)
6161
}
6262

63-
OneSection.protoTypes = {
63+
OneSection.propTypes = {
6464
data: PropTypes.shape({
6565
dualSectionPart: PropTypes.arrayOf(
6666
PropTypes.shape({

src/components/LogosSection/logosSection.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
11
import "./logosSection.scss"
22
import React from "react"
33
import { useTheme } from "../../context/themeContext"
4-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
54
import Carousel from "react-multi-carousel"
65
import "react-multi-carousel/lib/styles.css"
76
import PropTypes from "prop-types"
87

9-
const handleKeyDown = (event, onClick) => {
10-
if (event.key === "Enter" || event.key === " ") {
11-
onClick()
12-
}
13-
}
14-
158
const CustomLeftArrow = ({ onClick }) => {
169
return (
17-
<FontAwesomeIcon
18-
role="button"
10+
<button
1911
aria-label="Left arrow to see the previous logo"
20-
tabIndex={0}
21-
aria-hidden={false}
22-
focusable
23-
onKeyDown={event => handleKeyDown(event, onClick)}
2412
className="react-multiple-carousel__arrow react-multiple-carousel__arrow--left custom-arrow left"
25-
icon="fa-solid fa-chevron-left"
2613
onClick={() => onClick()}
2714
/>
2815
)
2916
}
3017
const CustomRightArrow = ({ onClick }) => {
3118
return (
32-
<FontAwesomeIcon
33-
role="button"
19+
<button
3420
aria-label="Right arrow to see the previous logo"
35-
tabIndex={0}
36-
aria-hidden={false}
37-
focusable
38-
onKeyDown={event => handleKeyDown(event, onClick)}
3921
className="react-multiple-carousel__arrow react-multiple-carousel__arrow--right custom-arrow right"
40-
icon="fa-solid fa-chevron-right"
4122
onClick={() => onClick()}
4223
/>
4324
)

0 commit comments

Comments
 (0)