Skip to content

Commit 8d2bdfa

Browse files
committed
fix: correct typo
1 parent d920a2c commit 8d2bdfa

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# useBreakpoints
22

3-
> React Hook to map value/breakpoint the styled-component way.
4-
53
[![CircleCI](https://circleci.com/gh/thebiltheory/useBreakpoints/tree/master.svg?style=svg)](https://circleci.com/gh/thebiltheory/useBreakpoints/tree/master) [![NPM](https://img.shields.io/npm/v/usebreakpoints.svg)](https://www.npmjs.com/package/@thebiltheory/usebreakpoints) ![npm](https://img.shields.io/npm/v/@thebiltheory/usebreakpoints?color=%236820FE) ![npm](https://img.shields.io/npm/dm/@thebiltheory/usebreakpoints)
64

5+
React Hook to map value/breakpoint the styled-component way.
6+
77
## Example/ Demo
88

99
[![Edit useBreakpoints](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/amazing-edison-x9g17?fontsize=14&hidenavigation=1&theme=dark)
@@ -24,14 +24,20 @@ yarn add @thebiltheory/usebreakpoints
2424

2525
```tsx
2626
const [value, currentBreakpoint] = useBreakpoints(
27-
['sad', 'neutral', 'happy', 'rocket'],
28-
[576, 768, 992, 1200]
27+
['mobile', 'tablet', 'desktop', 'huge screen'],
28+
[576, 768, 992, 1600]
2929
)
3030

3131
const [value, currentBreakpoint] = useBreakpoints(
3232
[1, 2, 3, 4],
3333
[576, 768, 992, 1200]
3434
)
35+
36+
import theme from 'src/theme'
37+
const [value, currentBreakpoint] = useBreakpoints(
38+
[1, 2, 3, 4],
39+
theme.breakpoints
40+
)
3541
```
3642

3743
## License

src/utils/makeMediaQueryList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function getMediaQueriyList(breakpoints: number[]) {
1+
export default function makeMediaQueryList(breakpoints: number[]) {
22
return breakpoints.map((breakpoint: number, index: number) => {
33
const maxWidth = breakpoints[index + 1]
44
return window.matchMedia(

0 commit comments

Comments
 (0)