Skip to content

Commit b49fbd4

Browse files
committed
correct prop names for innerStyle and innerTag
1 parent 2640a8a commit b49fbd4

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/components/Parallax/index.test.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { ParallaxProvider } from '../ParallaxProvider';
1111
import { MockProvider } from '../../testUtils/MockProvider';
1212
import expectRenderError from '../../testUtils/expectRenderError';
1313

14-
const consoleLog = global.console.log;
15-
1614
describe('Expect the <Parallax> component', () => {
1715
const preventError = (e: ErrorEvent) => e.preventDefault();
1816

@@ -21,11 +19,6 @@ describe('Expect the <Parallax> component', () => {
2119
});
2220

2321
afterEach(() => {
24-
global.console.log = consoleLog;
25-
// NOTE: this can probably be removed now
26-
// @ts-ignore
27-
global.ParallaxController = undefined;
28-
2922
window.removeEventListener('error', preventError);
3023
});
3124

@@ -34,22 +27,24 @@ describe('Expect the <Parallax> component', () => {
3427
<ParallaxProvider>
3528
<Parallax
3629
className="class-foo"
30+
innerClassName="class-foo"
3731
disabled={false}
3832
translateX={[-100, 100]}
3933
translateY={['-100%', '100%']}
4034
style={{
4135
border: 'solid red 2px',
4236
}}
43-
styleInner={{
44-
border: 'solid blue 2px',
37+
innerStyle={{
38+
border: 'solid blue 23px',
4539
}}
4640
tag="figure"
47-
tagInner="div"
41+
innerTag="div"
4842
>
4943
<div className="foo" />
5044
</Parallax>
5145
</ParallaxProvider>
5246
);
47+
5348
expect(asFragment()).toMatchSnapshot();
5449
});
5550

src/components/Parallax/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
113113
]);
114114

115115
const Outer = props.tag;
116-
const Inner = props.tagInner;
116+
const Inner = props.innerTag;
117117

118118
return (
119119
<Outer className={props.className} ref={refOuter} style={props.style}>
120120
<Inner
121121
className={props.innerClassName}
122122
ref={refInner}
123-
style={props.styleInner}
123+
style={props.innerStyle}
124124
>
125125
{props.children}
126126
</Inner>
@@ -130,6 +130,6 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
130130

131131
Parallax.defaultProps = {
132132
disabled: false,
133-
tagInner: 'div',
133+
innerTag: 'div',
134134
tag: 'div',
135135
};

src/components/Parallax/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export interface ParallaxProps extends ParallaxElementConfig {
2121
/**
2222
* Style object to be added to the innermost parallax element.
2323
*/
24-
styleInner?: any;
24+
innerStyle?: any;
2525
/**
2626
* Style object to be added to the outermost parallax element.
2727
*/
2828
style?: any;
2929
/**
3030
* HTML element tag name to be applied to the innermost parallax element.
3131
*/
32-
tagInner?: any;
32+
innerTag?: any;
3333
/**
3434
* HTML element tag name to be applied to the outermost parallax element.
3535
*/

src/components/ParallaxBanner/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const ParallaxBanner = ({
7373
<Parallax
7474
key={`layer-${i}`}
7575
speed={speed}
76-
styleInner={absoluteStyle}
76+
innerStyle={absoluteStyle}
7777
style={absoluteStyle}
7878
disabled={disabled}
7979
>

0 commit comments

Comments
 (0)