Skip to content

Commit c157030

Browse files
committed
add styleInner and styleOuter props to the Parallax component
1 parent b828e85 commit c157030

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/components/Parallax.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default class Parallax extends Component {
2323
offsetYMax: offsetMax,
2424
offsetYMin: offsetMin,
2525
slowerScrollRate: PropTypes.bool.isRequired,
26+
styleOuter: PropTypes.object,
27+
styleInner: PropTypes.object,
2628
tag: PropTypes.string.isRequired,
2729
};
2830

@@ -103,13 +105,27 @@ export default class Parallax extends Component {
103105
};
104106

105107
render() {
106-
const { children, className, tag: Tag } = this.props;
108+
const {
109+
children,
110+
className,
111+
tag: Tag,
112+
styleOuter,
113+
styleInner,
114+
} = this.props;
107115

108116
const rootClass = 'parallax-outer' + (className ? ` ${className}` : '');
109117

110118
return (
111-
<Tag className={rootClass} ref={this.mapRefOuter}>
112-
<div className="parallax-inner" ref={this.mapRefInner}>
119+
<Tag
120+
className={rootClass}
121+
ref={this.mapRefOuter}
122+
style={styleOuter}
123+
>
124+
<div
125+
className="parallax-inner"
126+
ref={this.mapRefInner}
127+
style={styleInner}
128+
>
113129
{children}
114130
</div>
115131
</Tag>

0 commit comments

Comments
 (0)