mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
add React & Redux devtools
This commit is contained in:
16
browser/main/DevTools/index.dev.js
Normal file
16
browser/main/DevTools/index.dev.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { createDevTools } from 'redux-devtools'
|
||||||
|
import LogMonitor from 'redux-devtools-log-monitor'
|
||||||
|
import DockMonitor from 'redux-devtools-dock-monitor'
|
||||||
|
|
||||||
|
const DevTools = createDevTools(
|
||||||
|
<DockMonitor
|
||||||
|
toggleVisibilityKey='ctrl-h'
|
||||||
|
changePositionKey='ctrl-q'
|
||||||
|
defaultIsVisible={false}
|
||||||
|
>
|
||||||
|
<LogMonitor theme='tomorrow' />
|
||||||
|
</DockMonitor>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default DevTools
|
||||||
8
browser/main/DevTools/index.js
Normal file
8
browser/main/DevTools/index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/* eslint-disable no-undef */
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
// eslint-disable-next-line global-require
|
||||||
|
module.exports = require('./index.prod').default
|
||||||
|
} else {
|
||||||
|
// eslint-disable-next-line global-require
|
||||||
|
module.exports = require('./index.dev').default
|
||||||
|
}
|
||||||
6
browser/main/DevTools/index.prod.js
Normal file
6
browser/main/DevTools/index.prod.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
const DevTools = () => <div />
|
||||||
|
DevTools.instrument = () => {}
|
||||||
|
|
||||||
|
export default DevTools
|
||||||
Reference in New Issue
Block a user