@@ -3,8 +3,8 @@ import PropTypes from 'prop-types'
3
3
import LinkGroup from '../LinkGroup/LinkGroup'
4
4
import SocialIcon from '../../components/SocialIcon/SocialIcon'
5
5
6
- const Footer = ( { companyName, sections, socials } ) => (
7
- < footer id = 'footer' className = ' container-fluid bg-secondary py-4' >
6
+ const Footer = ( { companyName, sections, socials, color , ... props } ) => (
7
+ < footer id = 'footer' className = { ` container-fluid bg-primary py-4 text- ${ color } ` } >
8
8
< div className = 'container' >
9
9
< div className = 'row' >
10
10
< div className = 'col-12 col-md-3 text-center text-md-start' >
@@ -17,12 +17,24 @@ const Footer = ({ companyName, sections, socials }) => (
17
17
>
18
18
{ sections && sections . map ( ( section ) => {
19
19
const { header, links } = section
20
- return < LinkGroup header = { header } links = { links } key = { header } { ...section } />
20
+ let linkStyle = props . linkStyle || { color }
21
+
22
+ return (
23
+ < LinkGroup
24
+ header = { header }
25
+ links = { links }
26
+ linkStyle = { linkStyle }
27
+ key = { header }
28
+ { ...section }
29
+ />
30
+ )
21
31
} ) }
22
32
</ div >
23
33
< div className = 'col-12 col-md-2 d-flex justify-content-center justify-content-md-end mt-5 mt-md-0' >
24
34
{ socials && socials . map ( ( social ) => {
25
35
const { icon, url } = social
36
+ social . color = social . color || color
37
+
26
38
return < SocialIcon icon = { icon } url = { url } key = { icon } { ...social } />
27
39
} ) }
28
40
</ div >
@@ -32,12 +44,14 @@ const Footer = ({ companyName, sections, socials }) => (
32
44
)
33
45
34
46
Footer . propTypes = {
47
+ color : PropTypes . string ,
35
48
companyName : PropTypes . string . isRequired ,
36
49
sections : PropTypes . arrayOf ( PropTypes . shape ( LinkGroup . propTypes ) ) ,
37
50
socials : PropTypes . arrayOf ( PropTypes . shape ( SocialIcon . propTypes ) ) ,
38
51
}
39
52
40
53
Footer . defaultProps = {
54
+ color : 'dark' ,
41
55
sections : [ ] ,
42
56
socials : [ ] ,
43
57
}
0 commit comments