Skip to content

Commit 8add361

Browse files
authored
Merge pull request #11 from ron0115/dev
Dev
2 parents 72100ce + 38b931a commit 8add361

16 files changed

+16450
-15315
lines changed

.github/workflows/release.yml

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,60 @@
1-
name: Release
2-
on:
3-
push:
4-
branches:
5-
- master
6-
paths:
7-
- 'src/**'
8-
9-
pull_request:
10-
branches:
11-
- master
12-
paths:
13-
- 'src/**'
14-
15-
jobs:
16-
build:
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- name: Begin CI...
21-
uses: actions/checkout@v2
22-
23-
- name: Use Node 12
24-
uses: actions/setup-node@v1
25-
with:
26-
node-version: 12.x
27-
28-
- name: Use cached node_modules
29-
uses: actions/cache@v1
30-
with:
31-
path: node_modules
32-
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
33-
restore-keys: |
34-
nodeModules-
35-
36-
- name: Install dependencies
37-
run: yarn install --frozen-lockfile
38-
env:
39-
CI: true
40-
41-
# - name: Lint
42-
# run: yarn lint
43-
# env:
44-
# CI: true
45-
46-
# - name: Test
47-
# run: yarn test --ci --coverage --maxWorkers=2
48-
# env:
49-
# CI: true
50-
51-
- name: Release
52-
run: |
53-
yarn build
54-
npm run release
55-
npm run deploy-storybook -- --ci
56-
env:
57-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
58-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- 'src/**'
8+
9+
pull_request:
10+
branches:
11+
- master
12+
paths:
13+
- 'src/**'
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Begin CI...
21+
uses: actions/checkout@v2
22+
23+
- name: Use Node 12
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: 12.x
27+
28+
- name: Use cached node_modules
29+
uses: actions/cache@v1
30+
with:
31+
path: node_modules
32+
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
nodeModules-
35+
36+
- name: Install dependencies
37+
run: yarn install --frozen-lockfile
38+
env:
39+
CI: true
40+
41+
# - name: Lint
42+
# run: yarn lint
43+
# env:
44+
# CI: true
45+
46+
- name: Test
47+
run: |
48+
yarn test --ci --coverage --maxWorkers=2
49+
yarn test:e2e --ci --coverage --maxWorkers=2
50+
env:
51+
CI: true
52+
53+
- name: Release
54+
run: |
55+
yarn build
56+
npm run release
57+
npm run deploy-storybook -- --ci
58+
env:
59+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
node_modules
44
.cache
55
dist
6+
.history
7+
coverage

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path');
22
const basePath = path.resolve(__dirname, '../', 'src');
33

44
module.exports = {
5-
stories: ['../@(stories|example)/*.stories.@(ts|tsx)'],
5+
stories: ['../stories/**/*.stories.@(jsx|tsx)'],
66
addons: [
77
'@storybook/addon-actions',
88
'@storybook/addon-links',

example/Demo.stories.tsx

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
import useSmoothScroll from 'react-smooth-scroll-hook';
2-
import React, { useRef } from 'react';
3-
4-
export const Demo = () => {
5-
const ref = useRef<HTMLDivElement>(null);
6-
const { scrollTo } = useSmoothScroll({
7-
ref,
8-
});
9-
10-
return (
11-
<>
12-
<button onClick={() => scrollTo('#y-item-20')}>
13-
scrollTo('#y-item-20')
14-
</button>
15-
<button onClick={() => scrollTo(400)}>scrollTo(400)</button>
16-
<br />
17-
<div
18-
ref={ref}
19-
style={{
20-
overflowY: 'scroll',
21-
maxHeight: '200px',
22-
padding: '10px',
23-
}}
24-
>
25-
{Array(100)
26-
.fill(null)
27-
.map((_item, i) => (
28-
<div key={i} id={`y-item-${i}`}>
29-
y-item-{i}
30-
</div>
31-
))}
32-
</div>
33-
</>
34-
);
35-
};
1+
import useSmoothScroll from 'react-smooth-scroll-hook';
2+
import React, { useRef } from 'react';
3+
4+
export const Demo = () => {
5+
const ref = useRef<HTMLDivElement>(null);
6+
const { scrollTo } = useSmoothScroll({
7+
ref,
8+
});
9+
10+
return (
11+
<>
12+
<button onClick={() => scrollTo('#y-item-20')}>
13+
scrollTo('#y-item-20')
14+
</button>
15+
<button onClick={() => scrollTo(400)}>scrollTo(400)</button>
16+
<br />
17+
<div
18+
id={'demo-stories'}
19+
ref={ref}
20+
style={{
21+
overflowY: 'scroll',
22+
maxHeight: '200px',
23+
padding: '10px',
24+
}}
25+
>
26+
{Array(100)
27+
.fill(null)
28+
.map((_item, i) => (
29+
<div key={i} id={`y-item-${i}`}>
30+
y-item-{i}
31+
</div>
32+
))}
33+
</div>
34+
</>
35+
);
36+
};

0 commit comments

Comments
 (0)