Skip to content

Commit a6a20b5

Browse files
Add a wrapper component to define section bg color
1 parent eca868f commit a6a20b5

File tree

5 files changed

+62
-31
lines changed

5 files changed

+62
-31
lines changed

components/containers/Row.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
import styles from '@/styles/Row.module.scss';
1+
import rowStyles from '@/styles/Row.module.scss';
22

3-
export default function Row({ children }) {
4-
return <section className={styles.wrapper}>{children}</section>;
3+
export default function Row({ customClass, children, styles }) {
4+
return (
5+
<div
6+
className={
7+
customClass
8+
? `${rowStyles.row} ${rowStyles[customClass]}`
9+
: rowStyles.row
10+
}
11+
style={styles}
12+
>
13+
{children}
14+
</div>
15+
);
516
}

components/containers/Wrapper.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import wrapperStyles from '@/styles/Wrapper.module.scss';
2+
3+
export default function Wrapper({ customClass, children }) {
4+
return (
5+
<div
6+
className={
7+
customClass
8+
? `${wrapperStyles.wrapper} ${wrapperStyles[customClass]}`
9+
: wrapperStyles.wrapper
10+
}
11+
>
12+
{children}
13+
</div>
14+
);
15+
}

pages/about.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import rowStyles from '@/styles/Row.module.scss';
1010
import CardsColumns from '@/components/containers/CardsColumns';
1111
import Title from '@/components/snippets/Title';
12+
import Wrapper from '@/components/containers/Wrapper';
1213
import Container from '@/components/containers/Container';
1314
import Row from '@/components/containers/Row';
1415
import Member from '@/components/containers/Member';
@@ -218,30 +219,27 @@ export default function AboutUs() {
218219
/>
219220
</RevealContentContainer>
220221
<RevealContentContainer>
221-
<section className={rowStyles.primaryBg}>
222+
<Wrapper customClass='primary__accent'>
222223
<Container>
223224
<Title title='Who we are' />
224-
225-
<Row>
226-
<div className={rowStyles.align__left}>
227-
{whoWeAre.map(_ => {
228-
return (
229-
<Member
230-
key={_?.name}
231-
image={_?.image}
232-
name={_?.name}
233-
title={_?.title}
234-
position={_?.position}
235-
linkedIn={_?.linkedIn}
236-
portfolio={_?.portfolio}
237-
about={_?.about}
238-
/>
239-
);
240-
})}
241-
</div>
225+
<Row customClass='align__left'>
226+
{whoWeAre.map(_ => {
227+
return (
228+
<Member
229+
key={_?.name}
230+
image={_?.image}
231+
name={_?.name}
232+
title={_?.title}
233+
position={_?.position}
234+
linkedIn={_?.linkedIn}
235+
portfolio={_?.portfolio}
236+
about={_?.about}
237+
/>
238+
);
239+
})}
242240
</Row>
243241
</Container>
244-
</section>
242+
</Wrapper>
245243
</RevealContentContainer>
246244
</div>
247245
);

styles/Row.module.scss

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
@use './variables' as *;
22
@use './mixins' as *;
33

4-
.primaryBg {
5-
background-color: $primary-accent-color;
6-
min-width: 100%;
7-
padding: 1rem 0;
8-
}
9-
10-
.align__left {
4+
.row {
115
display: flex;
126
flex-wrap: wrap;
13-
justify-content: left;
7+
8+
&.align__left {
9+
justify-content: left;
10+
}
1411

1512
@include desktop-breakpoint-minus {
1613
justify-content: space-between;

styles/Wrapper.module.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@use './variables' as *;
2+
@use './mixins' as *;
3+
4+
.wrapper {
5+
padding: 1rem 0;
6+
7+
&.primary__accent {
8+
background-color: $primary-accent-color;
9+
}
10+
}

0 commit comments

Comments
 (0)