Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit 91ba469

Browse files
authored
Merge pull request #25 from Oliphaunte/develop
Updated components to use children as opposed to props
2 parents bff848d + 71283e0 commit 91ba469

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ before_install:
1010
npm install
1111
npm --version
1212
script:
13-
- npm run js-lint -s
13+
- npm run js-lint -s
14+
- npm run sass-lint -s

app/components/atoms/Button/Button.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React from 'react';
22

33
const Button = (props) => {
44
return (
5-
<button className="a__button">{props.text}</button>
5+
<button className="a__button">{props.children}</button>
66
);
77
};
88

99
Button.propTypes = {
10-
text: React.PropTypes.string.isRequired
10+
children: React.PropTypes.string.isRequired
1111
};
1212

13-
export default Button;
13+
export default Button;

app/components/atoms/Paragraph/Paragraph.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React from 'react';
22

33
const Paragraph = (props) => {
44
return (
5-
<p className="a__paragraph">{props.text}</p>
5+
<p className="a__paragraph">{props.children}</p>
66
);
77
};
88

99
Paragraph.propTypes = {
10-
text: React.PropTypes.string.isRequired
10+
children: React.PropTypes.string.isRequired
1111
};
1212

13-
export default Paragraph;
13+
export default Paragraph;

app/components/atoms/Title/Title.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React from 'react';
22

33
const Title = (props) => {
44
return (
5-
<h1 className="a__title">{props.text}</h1>
5+
<h1 className="a__title">{props.children}</h1>
66
);
77
};
88

99
Title.propTypes = {
10-
text: React.PropTypes.string.isRequired
10+
children: React.PropTypes.string.isRequired
1111
};
1212

13-
export default Title;
13+
export default Title;

app/components/molecules/Content/Content.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Paragraph from '../../atoms/Paragraph/Paragraph';
55
const Content = (props) => {
66
return (
77
<div className="m__content">
8-
<Title text={props.title}/>
9-
<Paragraph text={props.text}/>
8+
<Title>{props.title}</Title>
9+
<Paragraph>{props.text}</Paragraph>
1010
</div>
1111
);
1212
};
@@ -16,4 +16,4 @@ Content.propTypes = {
1616
text: React.PropTypes.string
1717
};
1818

19-
export default Content;
19+
export default Content;

app/components/organisms/Form/Form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Form = (props) => {
1212
);
1313
})
1414
}
15-
<Button text={props.buttonText}/>
15+
<Button>{props.buttonText}</Button>
1616
</form>
1717
);
1818
};

app/components/templates/About/About.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Title from '../../atoms/Title/Title';
33

44
const About = () => {
55
return (
6-
<Title text="This is an example About page"/>
6+
<Title>"This is an example About page"</Title>
77
);
88
};
99

10-
export default About;
10+
export default About;

app/components/templates/Home/Home.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Form from '../../organisms/Form/Form';
66
const Home = (props) => {
77
return (
88
<div>
9-
<Title text="Basic React App"/>
10-
<Title text="Example of an atomic Blog"/>
9+
<Title>Basic React App</Title>
10+
<Title>Example of an atomic Blog</Title>
1111
<Article
1212
title="This is an article"
1313
image={{src: 'http://placehold.it/300x200', alt: 'Placehold'}}
@@ -24,7 +24,7 @@ const Home = (props) => {
2424

2525
<hr/>
2626

27-
<Title text="Example of an Atomic Form"/>
27+
<Title>Example of an Atomic Form</Title>
2828
<Form fields={props.form} buttonText="Submit"/>
2929
</div>
3030
);
@@ -47,4 +47,4 @@ Home.defaultProps = {
4747
]
4848
};
4949

50-
export default Home;
50+
export default Home;

0 commit comments

Comments
 (0)