Skip to content

Commit 6ec687e

Browse files
AWolf81Rokt33r
authored andcommitted
add React & Redux devtools
1 parent b6212f4 commit 6ec687e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

browser/main/DevTools/index.dev.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react'
2+
import { createDevTools } from 'redux-devtools'
3+
import LogMonitor from 'redux-devtools-log-monitor'
4+
import DockMonitor from 'redux-devtools-dock-monitor'
5+
6+
const DevTools = createDevTools(
7+
<DockMonitor
8+
toggleVisibilityKey='ctrl-h'
9+
changePositionKey='ctrl-q'
10+
defaultIsVisible={false}
11+
>
12+
<LogMonitor theme='tomorrow' />
13+
</DockMonitor>
14+
)
15+
16+
export default DevTools

browser/main/DevTools/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-disable no-undef */
2+
if (process.env.NODE_ENV === 'production') {
3+
// eslint-disable-next-line global-require
4+
module.exports = require('./index.prod').default
5+
} else {
6+
// eslint-disable-next-line global-require
7+
module.exports = require('./index.dev').default
8+
}

browser/main/DevTools/index.prod.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react'
2+
3+
const DevTools = () => <div />
4+
DevTools.instrument = () => {}
5+
6+
export default DevTools

0 commit comments

Comments
 (0)