Skip to content

Commit 229c83c

Browse files
committed
SBIT-576 se agregan los botones de partners
1 parent 52c0938 commit 229c83c

File tree

5 files changed

+68
-18
lines changed

5 files changed

+68
-18
lines changed

src/components/Banner/Banner.js

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ 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
13+
14+
console.log("arrayButtons:", arrayButtons)
1315

1416
const defaultOptions = {
1517
loop: true,
@@ -39,14 +41,27 @@ const Banner = ({ data }) => {
3941
dangerouslySetInnerHTML={{ __html: summary }}
4042
/>
4143
}
42-
{button && (
43-
<CustomLink
44-
content={button?.content}
45-
url={button?.url}
46-
landing={button?.english_landing_page}
47-
className={"button"}
48-
/>
44+
{Array.isArray(arrayButtons) && arrayButtons.length > 0 && (
45+
<div className="banner__buttons">
46+
{arrayButtons.map((btn, index) => (
47+
<CustomLink
48+
key={index}
49+
content={btn.content}
50+
url={btn.url}
51+
landing={btn.english_landing_page}
52+
className="button"
53+
/>
54+
))}
55+
</div>
4956
)}
57+
{button && (
58+
<CustomLink
59+
content={button.content}
60+
url={button?.url}
61+
landing={button?.landing_page}
62+
className={'button'}
63+
/>
64+
)}
5065
</div>
5166
</div>
5267

@@ -81,6 +96,15 @@ Banner.propTypes = {
8196
title: PropTypes.string.isRequired,
8297
variant: PropTypes.string.isRequired,
8398
summary: PropTypes.string,
99+
arrayButtons: PropTypes.arrayOf(
100+
PropTypes.shape({
101+
content: PropTypes.string,
102+
url: PropTypes.string,
103+
english_landing_page: PropTypes.shape({
104+
slug: PropTypes.string.isRequired,
105+
}),
106+
})
107+
),
84108
button: PropTypes.shape({
85109
content: PropTypes.string.isRequired,
86110
url: PropTypes.string,

src/components/Banner/Banner.scss

Lines changed: 18 additions & 9 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 {
@@ -184,13 +186,22 @@
184186
}
185187
}
186188

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 {
@@ -356,9 +367,7 @@
356367
}
357368
}
358369

359-
.button {
360-
padding-left: 5rem;
361-
}
370+
362371

363372
.title {
364373
display: flex;

src/hooks/useHomePage.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ const useHomePage = () => {
152152
slug
153153
}
154154
}
155+
arrayButtons {
156+
content
157+
158+
english_landing_page {
159+
id
160+
slug
161+
}
162+
}
155163
backgroundImageDark {
156164
url
157165
}

src/schema/generalSchema.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const generalSchema = `
9696
9797
type ComponentButton {
9898
id: Int
99-
content: String!
99+
content: String
100100
url: String
101101
english_landing_page: StrapiEnglishLandingPage
102102
}
@@ -196,6 +196,7 @@ const generalSchema = `
196196
summary: String
197197
image: LocalFile
198198
button: ComponentButton
199+
arrayButtons: [ComponentButton]
199200
imageDark: LocalFile
200201
animation: JSON
201202
navTitle: String

src/templates/LandingPage.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ export const query = graphql`
234234
slug
235235
}
236236
}
237+
arrayButtons {
238+
content
239+
240+
english_landing_page {
241+
id
242+
slug
243+
}
244+
}
237245
backgroundImageDark {
238246
url
239247
}

0 commit comments

Comments
 (0)