This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 4 files changed +1599
-1402
lines changed
src/substrate-lib/components
4 files changed +1599
-1402
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ version: 2
17
17
jobs :
18
18
test :
19
19
docker :
20
- - image : cimg/node:16.4
20
+ - image : cimg/node:16.14
21
21
working_directory : ~/repo
22
22
steps :
23
23
- checkout
37
37
- node_modules
38
38
key : v1-dependencies-{{ checksum "package.json" }}
39
39
- run :
40
- name : Prettier check
41
- command : yarn prettier:check
40
+ name : ESLint / Prettier check
41
+ command : yarn eslint:check && yarn prettier:check
42
42
- run :
43
43
name : Test
44
44
command : yarn test
50
50
51
51
deploy :
52
52
docker :
53
- - image : cimg/node:16.4
53
+ - image : cimg/node:16.14
54
54
working_directory : ~/repo
55
55
steps :
56
56
- attach_workspace :
Original file line number Diff line number Diff line change 18
18
"build" : " react-app-rewired build" ,
19
19
"test" : " CI=true react-app-rewired test" ,
20
20
"eject" : " react-scripts eject" ,
21
+ "eslint:check" : " eslint --ext .jsx,.js src/" ,
22
+ "eslint:write" : " eslint --fix --ext .jsx,.js src/" ,
21
23
"prettier:check" : " prettier -c src/*" ,
22
24
"prettier:write" : " prettier -w src/*" ,
23
25
"deploy" : " gh-pages -d build -m '[ci skip] Updates'"
43
45
"stream-browserify" : " ^3.0.0"
44
46
},
45
47
"devDependencies" : {
48
+ "eslint" : " ^8.10.0" ,
46
49
"eslint-config-prettier" : " ^8.4.0" ,
50
+ "eslint-config-react-app" : " ^7.0.0" ,
47
51
"gh-pages" : " ^3.2.3" ,
48
52
"prettier" : " 2.5.1" ,
49
53
"react-app-rewired" : " ^2.2.1" ,
55
59
"eslintConfig" : {
56
60
"extends" : [
57
61
" react-app" ,
62
+ " eslint:recommended" ,
58
63
" prettier"
59
64
]
60
65
},
Original file line number Diff line number Diff line change @@ -7,13 +7,14 @@ import { useSubstrateState } from '../'
7
7
import utils from '../utils'
8
8
9
9
function TxButton ( {
10
+ attrs = null ,
11
+ color = 'blue' ,
12
+ disabled = false ,
10
13
label,
11
14
setStatus,
12
- color = 'blue' ,
13
15
style = null ,
14
16
type = 'QUERY' ,
15
- attrs = null ,
16
- disabled = false ,
17
+ txOnClickHandler = null ,
17
18
} ) {
18
19
// Hooks
19
20
const { api, currentAccount } = useSubstrateState ( )
@@ -158,13 +159,21 @@ function TxButton({
158
159
}
159
160
160
161
setStatus ( 'Sending...' )
161
- ; ( isSudo ( ) && sudoTx ( ) ) ||
162
- ( isUncheckedSudo ( ) && uncheckedSudoTx ( ) ) ||
163
- ( isSigned ( ) && signedTx ( ) ) ||
164
- ( isUnsigned ( ) && unsignedTx ( ) ) ||
165
- ( isQuery ( ) && query ( ) ) ||
166
- ( isRpc ( ) && rpc ( ) ) ||
167
- ( isConstant ( ) && constant ( ) )
162
+
163
+ const asyncFunc =
164
+ ( isSudo ( ) && sudoTx ) ||
165
+ ( isUncheckedSudo ( ) && uncheckedSudoTx ) ||
166
+ ( isSigned ( ) && signedTx ) ||
167
+ ( isUnsigned ( ) && unsignedTx ) ||
168
+ ( isQuery ( ) && query ) ||
169
+ ( isRpc ( ) && rpc ) ||
170
+ ( isConstant ( ) && constant )
171
+
172
+ await asyncFunc ( )
173
+
174
+ return txOnClickHandler && typeof txOnClickHandler === 'function'
175
+ ? txOnClickHandler ( unsub )
176
+ : null
168
177
}
169
178
170
179
const transformParams = (
You can’t perform that action at this time.
0 commit comments