Skip to content

Commit

Permalink
#! added property style to components Link, List, ListItem and Paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
mjancarik committed Aug 3, 2017
1 parent 6ea1665 commit 5de9f98
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/headline/Headline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default class Headline extends React.PureComponent {
text: PropTypes.string,
type: PropTypes.string,
mode: PropTypes.string,
style: PropTypes.object,
"data-e2e": PropTypes.string
};
}
Expand All @@ -33,13 +34,14 @@ export default class Headline extends React.PureComponent {
text: null,
mode: null,
type: 'h1',
style: null,
"data-e2e": null
};
}

render() {
let headline = null;
let { Type, id, mode, text, className, children } = this.props;
let { type: Type, id, mode, text, className, children, style } = this.props;
let helper = this.context.$Utils.$UIComponentHelper;
let computedClassName = helper.cssClasses({
['atm-headline']: true,
Expand All @@ -51,6 +53,7 @@ export default class Headline extends React.PureComponent {
headline = (
<Type
id = { id }
style = { style }
className = { computedClassName }
{...helper.getDataProps(this.props)}>
{ children }
Expand All @@ -60,6 +63,7 @@ export default class Headline extends React.PureComponent {
headline = (
<Type
id = { id }
style = { style }
className = { computedClassName }
{...helper.getDataProps(this.props)}
dangerouslySetInnerHTML = { { __html: text } }/>
Expand Down
5 changes: 4 additions & 1 deletion src/link/Link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class Link extends React.PureComponent {
target: PropTypes.string,
onClick: PropTypes.func,
mode: PropTypes.string,
style: PropTypes.object,
className: PropTypes.string,
"data-e2e": PropTypes.string
};
Expand All @@ -33,20 +34,22 @@ export default class Link extends React.PureComponent {
return {
text: null,
mode: '',
style: null,
className: '',
"data-e2e": null
};
}

render() {
let helper = this.context.$Utils.$UIComponentHelper;
let { href, title, target, mode, className, onClick, children, text } = this.props;
let { href, title, target, mode, className, onClick, children, text, style } = this.props;

return (
<a
href = { href }
title = { title }
target = { target }
style = { style }
className = { helper.cssClasses({
'atm-link': true,
['atm-link-' + mode]: mode
Expand Down
5 changes: 4 additions & 1 deletion src/list/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class List extends React.PureComponent {
className: PropTypes.string,
mode: PropTypes.string,
type: PropTypes.string,
style: PropTypes.object,
"data-e2e": PropTypes.string
};
}
Expand All @@ -30,16 +31,18 @@ export default class List extends React.PureComponent {
className: '',
mode: '',
type: 'ul',
style: null,
"data-e2e": null
};
}

render() {
let helper = this.context.$Utils.$UIComponentHelper;
let { type: Type, mode, id, className, children } = this.props;
let { type: Type, mode, id, className, children, style } = this.props;

return (
<Type
style = { style }
className = { helper.cssClasses({
'atm-list': true,
['atm-list-' + mode]: mode,
Expand Down
6 changes: 5 additions & 1 deletion src/list/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class ListItem extends React.PureComponent {
return {
text: PropTypes.string,
mode: PropTypes.string,
style: PropTypes.object,
className: PropTypes.string,
"data-e2e": PropTypes.string
};
Expand All @@ -29,14 +30,15 @@ export default class ListItem extends React.PureComponent {
return {
text: null,
mode: '',
style: null,
className: '',
"data-e2e": null
};
}

render() {
let helper = this.context.$Utils.$UIComponentHelper;
let { mode, className, children, text } = this.props;
let { mode, className, children, text, style } = this.props;
let listItem = null;
let componentClassName = helper.cssClasses({
'atm-li': true,
Expand All @@ -46,6 +48,7 @@ export default class ListItem extends React.PureComponent {
if (children) {
listItem = (
<li
style = { style }
className = { componentClassName }
{...helper.getDataProps(this.props)}>
{children}
Expand All @@ -54,6 +57,7 @@ export default class ListItem extends React.PureComponent {
} else {
listItem = (
<li
style = { style }
className = { componentClassName}
{...helper.getDataProps(this.props)}
dangerouslySetInnerHTML = { { __html: text } }/>
Expand Down
6 changes: 5 additions & 1 deletion src/paragraph/Paragraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class Paragraph extends React.PureComponent {
className: PropTypes.string,
text: PropTypes.string,
mode: PropTypes.string,
style: PropTypes.object,
"data-e2e": PropTypes.string
};
}
Expand All @@ -30,13 +31,14 @@ export default class Paragraph extends React.PureComponent {
className: '',
text: null,
mode: '',
style: null,
"data-e2e": null
};
}

render() {
let helper = this.context.$Utils.$UIComponentHelper;
let { mode, align, className, children, text } = this.props;
let { mode, align, className, children, text, style } = this.props;
let paragraph = null;
let componentClassName = helper.cssClasses({
'atm-paragraph': true,
Expand All @@ -47,6 +49,7 @@ export default class Paragraph extends React.PureComponent {
if (children) {
paragraph = (
<p
style = { style }
className = { componentClassName }
{...helper.getDataProps(this.props)}>
{ children }
Expand All @@ -55,6 +58,7 @@ export default class Paragraph extends React.PureComponent {
} else {
paragraph = (
<p
style = { style }
className = { componentClassName }
{...helper.getDataProps(this.props)}
dangerouslySetInnerHTML = { { __html: text } }/>
Expand Down

0 comments on commit 5de9f98

Please sign in to comment.