mirror of
https://github.com/kremalicious/blowfish.git
synced 2024-12-28 23:57:52 +01:00
parent
097ad33477
commit
62cd61e10b
@ -1,6 +1,12 @@
|
|||||||
import React, { PureComponent } from 'react'
|
import React, { PureComponent } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Router, Location, navigate } from '@reach/router'
|
import {
|
||||||
|
Router,
|
||||||
|
createMemorySource,
|
||||||
|
createHistory,
|
||||||
|
LocationProvider,
|
||||||
|
navigate
|
||||||
|
} from '@reach/router'
|
||||||
import { webFrame, ipcRenderer } from 'electron'
|
import { webFrame, ipcRenderer } from 'electron'
|
||||||
import posed, { PoseGroup } from 'react-pose'
|
import posed, { PoseGroup } from 'react-pose'
|
||||||
import Titlebar from './components/Titlebar'
|
import Titlebar from './components/Titlebar'
|
||||||
@ -17,8 +23,13 @@ webFrame.setLayoutZoomLevelLimits(0, 0)
|
|||||||
|
|
||||||
const Animation = posed.div(defaultAnimation)
|
const Animation = posed.div(defaultAnimation)
|
||||||
|
|
||||||
|
// Fix reach-router in packaged Electron
|
||||||
|
// https://github.com/reach/router/issues/25#issuecomment-394003652
|
||||||
|
let source = createMemorySource('/')
|
||||||
|
let history = createHistory(source)
|
||||||
|
|
||||||
const PosedRouter = ({ children }) => (
|
const PosedRouter = ({ children }) => (
|
||||||
<Location>
|
<LocationProvider history={history}>
|
||||||
{({ location }) => (
|
{({ location }) => (
|
||||||
<PoseGroup animateOnMount>
|
<PoseGroup animateOnMount>
|
||||||
<Animation key={location.key}>
|
<Animation key={location.key}>
|
||||||
@ -26,7 +37,7 @@ const PosedRouter = ({ children }) => (
|
|||||||
</Animation>
|
</Animation>
|
||||||
</PoseGroup>
|
</PoseGroup>
|
||||||
)}
|
)}
|
||||||
</Location>
|
</LocationProvider>
|
||||||
)
|
)
|
||||||
|
|
||||||
PosedRouter.propTypes = {
|
PosedRouter.propTypes = {
|
||||||
|
Loading…
Reference in New Issue
Block a user