1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-29 13:58:02 +03:00

Adjust styles for print

This commit is contained in:
Brent Jackson 2019-04-20 16:30:31 -04:00
parent 111e5f2755
commit 6c2efe83d2

View File

@ -1,8 +1,17 @@
import React from 'react' import React from 'react'
import { globalHistory } from '@reach/router'
import { Global } from '@emotion/core' import { Global } from '@emotion/core'
const isPrintPath = () => {
const { pathname } = globalHistory.location
const parts = pathname.split('/')
const path = parts[parts.length - 1]
return path === 'print'
}
export default ({ mode, modes }) => { export default ({ mode, modes }) => {
if (mode === modes.PRINT) return false if (mode === modes.PRINT) return false
if (isPrintPath()) return false
return ( return (
<Global <Global
styles={{ styles={{