1import React from 'react';
3import { createContext, useContext } from 'react';
4import useMedia from './useMedia';
6// sync with //indigo/indigo/css/src/lib/_breakpoints.scss
8 '(min-width: 550px)', // ns
9 '(min-width: 750px)', // md
10 '(min-width: 960px)', // lg
13export const MediaQueryContext = createContext(null);
14// provide the index to consumers so they can easily index an array
15export const MediaQueryProvider = ({ children }) => (
16 <MediaQueryContext.Provider value={useMedia(BREAKPOINTS, [0, 1, 2], 0)}>
18 </MediaQueryContext.Provider>
22export function useMediaQuery() {
23 return useContext(MediaQueryContext);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list