Skip to content

Commit de5c96e

Browse files
Merge branch 'next' of https://github.com/cerebral/overmind into next
2 parents af3c2ed + d6269d7 commit de5c96e

File tree

86 files changed

+3142
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3142
-859
lines changed

package-lock.json

Lines changed: 77 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
2828
"@babel/plugin-transform-runtime": "^7.2.0",
2929
"@babel/preset-env": "^7.2.0",
30-
"axios": "0.18.0",
30+
"axios": "0.19.0",
3131
"color": "3.0.0",
3232
"color-hash": "1.0.3",
3333
"electron": "2.0.8",

packages/node_modules/overmind-devtools-client/src/components/ActionPayload/index.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1-
import { createElement, FunctionComponent } from 'react'
2-
import * as styles from './styles'
1+
import { FunctionComponent, createElement, useEffect, useRef } from 'react'
2+
33
import { useOvermind } from '../../overmind'
44
import { isValidJson } from '../../overmind/utils'
55
import { colors } from '../../theme'
6+
import * as styles from './styles'
67

78
const ActionPayload: FunctionComponent = () => {
8-
const { state, actions } = useOvermind()
9+
const { state, actions, reaction } = useOvermind()
10+
const input = useRef(null)
11+
12+
useEffect(() => {
13+
reaction(
14+
() => state.currentApp.selectedActionQuery,
15+
() => setTimeout(() => input.current && input.current.focus())
16+
)
17+
}, [])
18+
919
const payload = state.currentApp.actionQueryPayload
1020

1121
return (
1222
<div className={styles.wrapper}>
1323
<input
24+
ref={input}
1425
style={{
1526
borderColor:
1627
!payload || isValidJson(payload) ? 'transparent' : colors.red,
1728
}}
18-
disabled={!state.currentApp.selectedActionQuery}
29+
disabled={
30+
!state.currentApp.selectedActionQuery || state.isExecutingAction
31+
}
1932
placeholder={
2033
state.currentApp.selectedActionQuery
2134
? 'Add some JSON payload...'
2235
: null
2336
}
37+
onKeyDown={(event) => {
38+
if (event.keyCode === 13) {
39+
actions.executeAction()
40+
}
41+
}}
2442
className={styles.input}
2543
value={payload}
2644
onChange={(event) =>

packages/node_modules/overmind-devtools-client/src/components/ActionsTools/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { createElement, FunctionComponent } from 'react'
2-
import * as styles from './styles'
1+
import { FunctionComponent, createElement } from 'react'
2+
import { FaRocket } from 'react-icons/fa'
3+
34
import { useOvermind } from '../../overmind'
4-
import ActionSelector from '../ActionSelector'
5-
import ActionPayload from '../ActionPayload'
65
import { colors } from '../../theme'
7-
import { FaRocket } from 'react-icons/fa'
6+
import ActionPayload from '../ActionPayload'
7+
import ActionSelector from '../ActionSelector'
8+
import * as styles from './styles'
89

910
const ActionsTools: FunctionComponent = () => {
1011
const { state, actions } = useOvermind()
@@ -21,11 +22,12 @@ const ActionsTools: FunctionComponent = () => {
2122
<ActionPayload />
2223
<div
2324
className={styles.button}
24-
onClick={() => actions.executeAction()}
25+
onClick={state.isExecutingAction ? null : () => actions.executeAction()}
2526
style={{
26-
backgroundColor: state.currentApp.selectedActionQuery
27-
? colors.green
28-
: colors.highlight,
27+
backgroundColor:
28+
!state.isExecutingAction && state.currentApp.selectedActionQuery
29+
? colors.green
30+
: colors.highlight,
2931
}}
3032
>
3133
<FaRocket />

packages/node_modules/overmind-devtools-client/src/components/ActionsTools/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { css } from 'emotion'
2+
23
import { colors } from '../../theme'
34

45
export const wrapper = css({

0 commit comments

Comments
 (0)