Skip to content

Commit ecaff7c

Browse files
committed
chore: Update Docs and deps
- update dumi package - fix "Edit this doc on GitHub" btn - add Demo block on main page - hide Codesandbox exmples
1 parent 6a99420 commit ecaff7c

File tree

5 files changed

+2091
-3272
lines changed

5 files changed

+2091
-3272
lines changed

docs/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ React scrollbars component.
99

1010
`rc-scrollbars` is rejuvenated project of <a href="https://github.com/malte-wessel/react-custom-scrollbars" target="_blank">react-custom-scrollbars</a>
1111

12-
[![npm](https://img.shields.io/badge/npm-rc--scrollbars-brightgreen.svg?style=flat-square)](https://www.npmjs.com/package/rc-scrollbars)
13-
[![npm version](https://img.shields.io/npm/v/rc-scrollbars.svg?style=flat-square)](https://www.npmjs.com/package/rc-scrollbars)
12+
[![npm](https://img.shields.io/badge/npm-rc--scrollbars-brightgreen.svg?style=flat-square)](https://www.npmjs.com/package/rc-scrollbars)
13+
[![npm version](https://img.shields.io/npm/v/rc-scrollbars.svg?style=flat-square)](https://www.npmjs.com/package/rc-scrollbars)
1414
[![npm downloads](https://img.shields.io/npm/dm/rc-scrollbars.svg?style=flat-square)](https://www.npmjs.com/package/rc-scrollbars)
1515

1616
* frictionless native browser scrolling
@@ -25,6 +25,22 @@ React scrollbars component.
2525

2626
#### **[Demos](/demo) · [API](/api) · [GitHub](https://github.com/sakhnyuk/rc-scrollbars)**
2727

28+
```jsx
29+
/**
30+
* title: Basic DEMO of scrollbar
31+
* hideActions: ['CSB', 'EXTERNAL']
32+
*/
33+
import React from 'react';
34+
import { Scrollbars } from 'rc-scrollbars';
35+
import { Lorem } from './components/Lorem';
36+
37+
export default () => (
38+
<Scrollbars style={{ maxWidth: 600, height: 300 }}>
39+
<Lorem />
40+
</Scrollbars>
41+
);
42+
```
43+
2844
## Installation
2945
```bash
3046
npm install rc-scrollbars --save

docs/demo.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ order: 5
1111
/**
1212
* title: Default vertical content
1313
* desc: Default usage of rc-scrollbars with vertical scroll
14+
* hideActions: ['CSB']
1415
*/
1516
import React from 'react';
1617
import { Scrollbars } from 'rc-scrollbars';
@@ -27,6 +28,7 @@ export default () => (
2728
/**
2829
* title: Default hozintal content
2930
* desc: Default usage of rc-scrollbars with horizontal and vertical scroll
31+
* hideActions: ['CSB']
3032
*/
3133
import React from 'react';
3234
import { Scrollbars } from 'rc-scrollbars';
@@ -44,6 +46,9 @@ export default () => (
4446
## Auto-hide
4547

4648
```jsx
49+
/**
50+
* hideActions: ['CSB']
51+
*/
4752
import React from 'react';
4853
import { Scrollbars } from 'rc-scrollbars';
4954
import { Lorem } from './components/Lorem';
@@ -67,6 +72,7 @@ export default class App extends React.Component {
6772
/**
6873
* title: Colored Scrollbar
6974
* desc: Example type customization of scrollbar and view
75+
* hideActions: ['CSB']
7076
*/
7177
import React from 'react';
7278
import ColoredScrollbars from './components/ColoredScrollbars';
@@ -84,6 +90,7 @@ export default () => (
8490
```jsx
8591
/**
8692
* title: Shadow view
93+
* hideActions: ['CSB']
8794
*/
8895
import React from 'react';
8996
import { Scrollbars } from 'rc-scrollbars';
@@ -106,6 +113,7 @@ export default class App extends React.Component {
106113
```tsx
107114
/**
108115
* title: Styled scrollbar
116+
* hideActions: ['CSB']
109117
*/
110118
import React from 'react';
111119
import { Scrollbars } from 'rc-scrollbars';
@@ -153,6 +161,7 @@ export default class App extends React.Component {
153161
```jsx
154162
/**
155163
* title: Spring Scrollbar
164+
* hideActions: ['CSB']
156165
*/
157166
import React from 'react';
158167
import SpringScrollbarsExample from './components/SpringScrollbars/SpringScrollbarsExample';

docs/usage.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Also don't forget to set the `viewport` meta tag, if you want to **support mobil
3434

3535
There are several events you can listen to:
3636

37-
```javascript
37+
```jsx | pure
3838
import { Scrollbars } from 'rc-scrollbars';
3939

4040
class App extends Component {
@@ -65,7 +65,7 @@ You can activate auto-hide by setting the `autoHide` property.
6565

6666
Check out [demo](/demo#auto-hide)
6767

68-
```javascript
68+
```jsx | pure
6969
import { Scrollbars } from 'rc-scrollbars';
7070

7171
class App extends Component {
@@ -90,7 +90,7 @@ class App extends Component {
9090

9191
You can activate auto-height by setting the `autoHeight` property.
9292

93-
```jsx pure
93+
```jsx | pure
9494
import React from 'react';
9595
import { Scrollbars } from 'rc-scrollbars';
9696
import { Lorem } from './components/Lorem';
@@ -108,17 +108,14 @@ export default () => {
108108

109109
If your app runs on both client and server, activate the `universal` mode. This will ensure that the initial markup on client and server are the same:
110110

111-
```javascript
111+
```jsx | pure
112112
import { Scrollbars } from 'rc-scrollbars';
113113

114-
class App extends Component {
115-
render() {
116-
return (
117-
// This will activate universal mode
118-
<Scrollbars universal>
119-
<p>Some great content...</p>
120-
</Scrollbars>
121-
);
122-
}
123-
}
114+
export const Component = () => {
115+
return (
116+
<Scrollbars universal>
117+
<p>Some great content...</p>
118+
</Scrollbars>
119+
);
120+
};
124121
```

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "https://github.com/sakhnyuk/rc-scrollbars.git"
21+
"url": "https://github.com/sakhnyuk/rc-scrollbars.git",
22+
"branch": "main"
2223
},
2324
"keywords": [
2425
"scroll",
@@ -43,7 +44,7 @@
4344
"@typescript-eslint/parser": "^4.9.1",
4445
"concurrently": "^5.3.0",
4546
"cross-env": "^7.0.3",
46-
"dumi": "^1.0.38",
47+
"dumi": "^1.1.4",
4748
"eslint": "^7.15.0",
4849
"eslint-config-prettier": "^7.0.0",
4950
"eslint-config-react-app": "^6.0.0",

0 commit comments

Comments
 (0)