Skip to content

Commit 1ee2fd8

Browse files
committed
use ts for stories
1 parent d88ac14 commit 1ee2fd8

File tree

9 files changed

+27
-34
lines changed

9 files changed

+27
-34
lines changed
File renamed without changes.
File renamed without changes.

stories/Image/Image.js renamed to stories/Image/Image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import styles from './Image.module.scss';
32
import { useController } from '../../src';
3+
import styles from './Image.module.scss';
44

55
export const Image = (props) => {
66
const parallaxController = useController();

stories/ScrollContainer.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

stories/ScrollContainer.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React, { PropsWithChildren } from 'react';
2+
import { ParallaxProvider } from '../src';
3+
4+
export const ScrollContainer = (
5+
props: PropsWithChildren<{
6+
scrollAxis: 'vertical' | 'horizontal';
7+
}>
8+
) => {
9+
const [scrollEl, setScrollElement] = React.useState(null);
10+
const ref = React.useRef();
11+
12+
React.useEffect(() => {
13+
setScrollElement(ref.current);
14+
});
15+
16+
return (
17+
<div className="scroll-container" ref={ref}>
18+
<ParallaxProvider
19+
scrollContainer={scrollEl}
20+
scrollAxis={props.scrollAxis}
21+
>
22+
{props.children}
23+
</ParallaxProvider>
24+
</div>
25+
);
26+
};

0 commit comments

Comments
 (0)