Skip to content

Commit

Permalink
H1, H2, H3 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivraj committed Feb 14, 2017
1 parent 3f7d15a commit 62ab4db
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 12 deletions.
13 changes: 12 additions & 1 deletion dist/src/basic/H1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/basic/H1.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion dist/src/basic/H2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/basic/H2.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion dist/src/basic/H3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/basic/H3.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/src/theme/components/Tab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/theme/components/Tab.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/basic/H1.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ class H1 extends Component {
}
}

const childrenType = function (props, propName, component) {
let error;
const prop = props[propName];
React.Children.forEach(prop, (child) => {
if (typeof child !== 'string') {
error = new Error(`${component} should have only string`);
}
});
return error;
};

H1.propTypes = {
...Text.propTypes,
children: React.PropTypes.oneOfType[React.PropTypes.node, React.PropTypes.string],
children: childrenType,
style: React.PropTypes.object,
};

Expand Down
12 changes: 11 additions & 1 deletion src/basic/H2.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ class H2 extends Component {
);
}
}
const childrenType = function (props, propName, component) {
let error;
const prop = props[propName];
React.Children.forEach(prop, (child) => {
if (typeof child !== 'string') {
error = new Error(`${component} should have only string`);
}
});
return error;
};

H2.propTypes = {
...Text.propTypes,
children: React.PropTypes.oneOfType[React.PropTypes.node, React.PropTypes.string],
children: childrenType,
style: React.PropTypes.object,
};

Expand Down
13 changes: 12 additions & 1 deletion src/basic/H3.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ class H3 extends Component {
}
}

const childrenType = function (props, propName, component) {
let error;
const prop = props[propName];
React.Children.forEach(prop, (child) => {
if (typeof child !== 'string') {
error = new Error(`${component} should have only string`);
}
});
return error;
};

H3.propTypes = {
...Text.propTypes,
children: React.PropTypes.oneOfType[React.PropTypes.node, React.PropTypes.string],
children: childrenType,
style: React.PropTypes.object,
};

Expand Down
5 changes: 4 additions & 1 deletion src/theme/components/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export default (variables = variable) => {
const platformStyle = variables.platformStyle;
const platform = variables.platform;

const tabTheme = { };
const tabTheme = {
flex: 1,
backgroundColor: '#FFF',
};


return tabTheme;
Expand Down

0 comments on commit 62ab4db

Please sign in to comment.