react-use/stories/useScrollbarWidth.story.tsx
xobotyi b6993a6f95
feat(prettier): make prettier a part of eslint.
Also reduce max line width to 100. And remove `lint:types` step for
commit sequence, it bothers when committing incomplete (wip) changes.
2021-02-01 18:58:55 +03:00

21 lines
544 B
TypeScript

import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { useScrollbarWidth } from '../src';
import ShowDocs from './util/ShowDocs';
const Demo = () => {
const sbw = useScrollbarWidth();
return (
<div>
{sbw === undefined
? `DOM is not ready yet, SBW detection delayed`
: `Browser's scrollbar width is ${sbw}px`}
</div>
);
};
storiesOf('Sensors/useScrollbarWidth', module)
.add('Docs', () => <ShowDocs md={require('../docs/useScroll.md')} />)
.add('Demo', () => <Demo />);