Skip to content

Commit b10cc9c

Browse files
authored
Merge pull request #18 from whyjay17/text_color_props
Text color props
2 parents 769a35d + 19d882a commit b10cc9c

File tree

3 files changed

+381
-38
lines changed

3 files changed

+381
-38
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ For each `Content` you need `ContentYear` since with this component you mark the
4747

4848
For each `Content` you need `ContentBody`, because with this component you describe the events that occurred in that year using `Description` component.
4949

50-
| Name | Type | Required | Description |
51-
| -------- | ------ | -------- | ------------------------------------------------- |
52-
| Title | String | True | Show the title for the events |
53-
| Children | Node | True | It is necessary to use the description component. |
50+
| Name | Type | Required | Description |
51+
| --------- | --------- | --------- | ------------------------------------------------- |
52+
| Title | String | True | Show the title for the events |
53+
| Children | Node | True | It is necessary to use the description component. |
54+
| TextColor | String | False | Change the color of the text in the ContentBody. |
5455

5556
### Description
5657

build/index.js

Lines changed: 361 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/content_body/index.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ const BodyComponent = styled.div`
2525
}
2626
`;
2727

28-
const BodyComponentTitle = styled.p`
29-
color: #002a3a;
30-
font-weight: bold;
31-
margin-bottom: 10px;
32-
font-size: 18px;
33-
margin-top: 0;
34-
text-align: left;
35-
`;
36-
3728
const ContentBody = (props) => {
38-
const { title, children } = props;
29+
const { title, children, textColor } = props;
30+
31+
const BodyComponentTitle = styled.p`
32+
color: ${textColor};
33+
font-weight: bold;
34+
margin-bottom: 10px;
35+
font-size: 18px;
36+
margin-top: 0;
37+
text-align: left;
38+
`;
3939

4040
return (
4141
<BodyComponent className='body-component'>
@@ -50,6 +50,11 @@ const ContentBody = (props) => {
5050
ContentBody.propTypes = {
5151
title: PropTypes.string.isRequired,
5252
children: PropTypes.node.isRequired,
53+
textColor: PropTypes.string,
54+
};
55+
56+
ContentBody.defaultProps = {
57+
textColor: '#002a3a',
5358
};
5459

5560
export default ContentBody;

0 commit comments

Comments
 (0)