Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SUNIL WAT????
import React, { useState, useEffect } from 'react'
import breakpoint from 'styled-components-breakpoint'
import { Col, Row, Grid } from '../grid'
const GridDebugger = () => {
const [showGrid, toggleShowGrid] = useState(false)
const handleKey = ev => {
if (ev.key === 'g' && ev.ctrlKey) {
console.log('lol')
toggleShowGrid(!showGrid)
}
}
useEffect(
() => {
window.addEventListener('keyup', handleKey)
return () => window.removeEventListener('keyup', handleKey)
},
[]
)
return showGrid ? (
<Container>
<Row>
{Array.from(new Array(12)).map((el, idx) => (
<Column key={idx} width={[1, 1, 1, 1, 1 / 12]} block={false}>
<ColumnContent />
</Column>
))}
</Row>
</Container>
) : null
}
export default GridDebugger
import React, { useState, useEffect } from 'react'
import breakpoint from 'styled-components-breakpoint'
import { Col, Row, Grid } from '../grid'
const GridDebugger = () => {
const [showGrid, toggleShowGrid] = useState(false)
const handleKey = ev => {
if (ev.key === 'g' && ev.ctrlKey) {
console.log('lol')
toggleShowGrid(!showGrid)
}
}
useEffect(
() => {
window.addEventListener('keyup', handleKey)
return () => window.removeEventListener('keyup', handleKey)
},
[showGrid]
)
return showGrid ? (
<Container>
<Row>
{Array.from(new Array(12)).map((el, idx) => (
<Column key={idx} width={[1, 1, 1, 1, 1 / 12]} block={false}>
<ColumnContent />
</Column>
))}
</Row>
</Container>
) : null
}
export default GridDebugger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.