import * as React from 'react'; import styled from 'styled-components'; import { onDesktop, onTablet } from './Breakpoints'; import { useBreakpointContext } from './Context'; const DebuggerPosition = styled.div` position: fixed; top: 0; left: 0; font-family: monospace; & > div { display: flex; } `; const OnSmallScreen = styled.div` display: block; `; const OnTablet = styled.div` display: none; ${onTablet(`display: block;`)} `; const OnDesktop = styled.div` display: none; ${onDesktop`display: block;`} `; const CSSBreakpointDebugger = () => (
S T D
); const JSBreakpointDebugger = () => { const { screenSize: { onTablet, onDesktop, onSmallScreen }, } = useBreakpointContext(); return (
{onSmallScreen &&
S
} {onTablet &&
T
} {onDesktop &&
D
}
); }; export const BreakpointDebugTool = () => ( );