-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
76 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import React, { Suspense, lazy } from 'react' | ||
import { HashRouter, Route } from 'react-router-dom' | ||
import { BrowserRouter, HashRouter, Route } from 'react-router-dom' | ||
|
||
import { LoadingScreen } from '@obsidians/ui-components' | ||
|
||
const Router = window.require ? HashRouter : BrowserRouter | ||
const ReduxApp = lazy(() => import('./ReduxApp' /* webpackChunkName: "components" */)) | ||
|
||
export default function App () { | ||
return ( | ||
<HashRouter> | ||
<Router> | ||
<Suspense fallback={<LoadingScreen />}> | ||
<Route component={ReduxApp} /> | ||
</Suspense> | ||
</HashRouter> | ||
</Router> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import get from 'lodash/get' | ||
|
||
import { globalModalManager } from '@obsidians/welcome' | ||
import { globalModalManager } from '@obsidians/global' | ||
|
||
const { ipcRenderer } = window.require('electron') | ||
const handlers = {} | ||
if (window.require) { | ||
const { ipcRenderer } = window.require('electron') | ||
|
||
const handlers = { | ||
about: () => globalModalManager.openAboutModal(), | ||
handlers.about = () => globalModalManager.openAboutModal() | ||
|
||
ipcRenderer.on('menu-click', (event, action) => { | ||
const handler = get(handlers, action) | ||
if (handler) { | ||
handler() | ||
} else { | ||
console.warn(new Error(`No handler for menu click: ${action}`)) | ||
} | ||
}) | ||
} | ||
|
||
ipcRenderer.on('menu-click', (event, action) => { | ||
const handler = get(handlers, action) | ||
if (handler) { | ||
handler() | ||
} else { | ||
console.warn(new Error(`No handler for menu click: ${action}`)) | ||
} | ||
}) | ||
|
||
export default handlers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters