1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-12-01 21:42:08 +03:00

Merge pull request #331 from jxnblk/fix-embed-styles

Move global styles to MDXDeck component
This commit is contained in:
Brent Jackson 2019-04-15 13:35:38 -04:00 committed by GitHub
commit ecb913267c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Router, globalHistory, navigate } from '@reach/router'
import { Global } from '@emotion/core'
import { Swipeable } from 'react-swipeable'
import querystring from 'querystring'
import Provider from './Provider'
@ -258,8 +259,20 @@ export class MDXDeck extends React.Component {
break
}
const style =
mode !== modes.PRINT ? (
<Global
styles={{
body: {
overflow: 'hidden',
},
}}
/>
) : null
return (
<Provider {...this.props} {...this.state} mode={mode} index={index}>
{style}
<Catch>
<GoogleFonts />
<Wrapper {...this.props} {...this.state} modes={modes} index={index}>

View File

@ -1,5 +1,4 @@
import React from 'react'
import { Global } from '@emotion/core'
import { ThemeProvider } from 'emotion-theming'
import merge from 'lodash.merge'
import { HeadProvider } from './Head'
@ -28,20 +27,9 @@ export const Provider = props => {
...mdxComponents,
...themeComponents,
}
const style =
props.mode !== 'print' ? (
<Global
styles={{
body: {
overflow: 'hidden',
},
}}
/>
) : null
return (
<HeadProvider tags={headTags}>
{style}
<ThemeProvider theme={theme}>
<MDXProvider components={allComponents}>
<UserProvider {...props} />