Skip to content

Commit ed14445

Browse files
Merge pull request #129 from bitlogic/SBIT-576-agregar-botones-partners
Sbit 576 agregar botones partners
2 parents 52c0938 + 9e31ff5 commit ed14445

File tree

5 files changed

+67
-18
lines changed

5 files changed

+67
-18
lines changed

src/components/Banner/Banner.js

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ 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+
1314

1415
const defaultOptions = {
1516
loop: true,
@@ -39,14 +40,27 @@ const Banner = ({ data }) => {
3940
dangerouslySetInnerHTML={{ __html: summary }}
4041
/>
4142
}
42-
{button && (
43-
<CustomLink
44-
content={button?.content}
45-
url={button?.url}
46-
landing={button?.english_landing_page}
47-
className={"button"}
48-
/>
43+
{Array.isArray(arrayButtons) && arrayButtons.length > 0 && (
44+
<div className="banner__buttons">
45+
{arrayButtons.map((btn, index) => (
46+
<CustomLink
47+
key={index}
48+
content={btn.content}
49+
url={btn.url}
50+
landing={btn.english_landing_page}
51+
className="button"
52+
/>
53+
))}
54+
</div>
4955
)}
56+
{button && (
57+
<CustomLink
58+
content={button.content}
59+
url={button?.url}
60+
landing={button?.landing_page}
61+
className={'button'}
62+
/>
63+
)}
5064
</div>
5165
</div>
5266

@@ -81,6 +95,15 @@ Banner.propTypes = {
8195
title: PropTypes.string.isRequired,
8296
variant: PropTypes.string.isRequired,
8397
summary: PropTypes.string,
98+
arrayButtons: PropTypes.arrayOf(
99+
PropTypes.shape({
100+
content: PropTypes.string,
101+
url: PropTypes.string,
102+
english_landing_page: PropTypes.shape({
103+
slug: PropTypes.string.isRequired,
104+
}),
105+
})
106+
),
84107
button: PropTypes.shape({
85108
content: PropTypes.string.isRequired,
86109
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)