Download react-use/stories/createBreakpoint.story.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 948 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/stories/createBreakpoint.story.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/stories/createBreakpoint.story.tsx
-
curl -L -o createBreakpoint.story.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/stories/createBreakpoint.story.tsx
948 Bytes
| import { withKnobs } from '@storybook/addon-knobs'; | |
| import { storiesOf } from '@storybook/react'; | |
| import React from 'react'; | |
| import { createBreakpoint } from '../src'; | |
| import ShowDocs from './util/ShowDocs'; | |
| const useBreakpointA = createBreakpoint(); | |
| const useBreakpointB = createBreakpoint({ mobileM: 350, laptop: 1024, tablet: 768 }); | |
| const Demo = () => { | |
| const breakpointA = useBreakpointA(); | |
| const breakpointB = useBreakpointB(); | |
| return ( | |
| <div> | |
| <p>{'try resize your window'}</p> | |
| <p>{'createBreakpoint() #default : { laptopL: 1440, laptop: 1024, tablet: 768 }'}</p> | |
| <p>{breakpointA}</p> | |
| <p>{'createBreakpoint({ mobileM: 350, laptop: 1024, tablet: 768 })'}</p> | |
| <p>{breakpointB}</p> | |
| </div> | |
| ); | |
| }; | |
| storiesOf('sensors/createBreakpoint', module) | |
| .addDecorator(withKnobs) | |
| .add('Docs', () => <ShowDocs md={require('../docs/createBreakpoint.md')} />) | |
| .add('Demo', () => { | |
| return <Demo />; | |
| }); | |