Skip to content

Commit cbd7ef9

Browse files
authored
Merge pull request #96 from ganderzz/release/v2.0.5
Increment Version v2.0.5
2 parents 52fffed + b1e6635 commit cbd7ef9

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.storybook/webpack.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const path = require("path");
2+
3+
module.exports = (baseConfig, env, config) => {
4+
config.module.rules.push({
5+
test: /\.(ts|tsx)$/,
6+
use: [
7+
{
8+
loader: require.resolve("ts-loader"),
9+
options: {
10+
configFile: "../config/tsconfig.json"
11+
}
12+
}
13+
]
14+
});
15+
config.resolve.extensions.push(".ts", ".tsx");
16+
return config;
17+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scroll-to",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "Scroll to a position using react",
55
"main": "./dist/react-scroll-to.js",
66
"types": "./dist/definitions",

stories/Default.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as React from "react";
2+
import { ScrollStory } from ".";
3+
import { ScrollTo } from "../src";
4+
5+
ScrollStory.add("Default", () => (
6+
<div
7+
style={{
8+
height: "150vh",
9+
position: "relative",
10+
padding: 20,
11+
backgroundImage: "linear-gradient(#FFF, #111)"
12+
}}
13+
>
14+
<ScrollTo>
15+
{({ scrollTo }) => (
16+
<React.Fragment>
17+
<button
18+
type="button"
19+
onClick={() => scrollTo({ y: 500, smooth: true })}
20+
>
21+
Scroll Down!
22+
</button>
23+
24+
<button
25+
type="button"
26+
style={{ position: "absolute", left: 20, bottom: 20 }}
27+
onClick={() => scrollTo({ y: 0, smooth: true })}
28+
>
29+
Scroll Up!
30+
</button>
31+
</React.Fragment>
32+
)}
33+
</ScrollTo>
34+
</div>
35+
));

0 commit comments

Comments
 (0)