File tree Expand file tree Collapse file tree 7 files changed +172
-111
lines changed
CadenceEditor/ControlPanel Expand file tree Collapse file tree 7 files changed +172
-111
lines changed Original file line number Diff line number Diff line change @@ -244,18 +244,20 @@ export const ActionButton: React.FC<InteractionButtonProps> = ({
244
244
active = true ,
245
245
onClick,
246
246
} ) => {
247
- const { project, active : activeEditor , getActiveCode } = useProject ( ) ;
247
+ const {
248
+ project,
249
+ active : activeEditor ,
250
+ getActiveCode,
251
+ showSavingMessage,
252
+ } = useProject ( ) ;
248
253
const label = getLabel ( type , project , activeEditor ) ;
249
- const { isSavingCode } = useProject ( ) ;
250
- const sendingTransaction = false ;
251
254
const code = getActiveCode ( ) [ 0 ] . trim ( ) ;
252
255
return (
253
256
< Controls >
254
257
< Button
255
258
onClick = { onClick }
256
259
Icon = { FaArrowCircleRight }
257
- disabled = { isSavingCode || ! active || code . length === 0 }
258
- isLoading = { sendingTransaction }
260
+ disabled = { showSavingMessage || ! active || code . length === 0 }
259
261
>
260
262
{ label }
261
263
</ Button >
Original file line number Diff line number Diff line change @@ -141,15 +141,15 @@ type ProcessingArgs = {
141
141
} ;
142
142
143
143
const useTemplateType = ( ) : ProcessingArgs => {
144
- const { isSavingCode } = useProject ( ) ;
144
+ const { showSavingMessage } = useProject ( ) ;
145
145
const {
146
146
createScriptExecution,
147
147
createTransactionExecution,
148
148
updateAccountDeployedCode,
149
149
} = useProject ( ) ;
150
150
151
151
return {
152
- disabled : isSavingCode ,
152
+ disabled : showSavingMessage ,
153
153
scriptFactory : createScriptExecution ,
154
154
transactionFactory : createTransactionExecution ,
155
155
contractDeployment : updateAccountDeployedCode ,
@@ -218,7 +218,7 @@ const Arguments: React.FC<ArgumentsProps> = (props) => {
218
218
const {
219
219
project,
220
220
active,
221
- isSavingCode ,
221
+ showSavingMessage ,
222
222
lastSigners,
223
223
// updateAccountDeployedCode
224
224
} = useProject ( ) ;
@@ -356,7 +356,7 @@ const Arguments: React.FC<ArgumentsProps> = (props) => {
356
356
let statusIcon = isOk ? < FaRegCheckCircle /> : < FaRegTimesCircle /> ;
357
357
let statusMessage = isOk ? 'Ready' : 'Fix errors' ;
358
358
359
- const progress = isSavingCode || processingStatus ;
359
+ const progress = showSavingMessage || processingStatus ;
360
360
361
361
if ( progress ) {
362
362
statusIcon = < FaSpinner className = "spin" /> ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const ControlPanel: React.FC<ControlPanelProps> = (props) => {
65
65
// ===========================================================================
66
66
// GLOBAL HOOKS
67
67
const { languageClient } = useContext ( CadenceCheckerContext ) ;
68
- const { project, active, isSavingCode } = useProject ( ) ;
68
+ const { project, active, showSavingMessage } = useProject ( ) ;
69
69
70
70
// HOOKS -------------------------------------------------------------------
71
71
const [ executionArguments , setExecutionArguments ] = useState ( { } ) ;
@@ -366,7 +366,7 @@ const ControlPanel: React.FC<ControlPanelProps> = (props) => {
366
366
break ;
367
367
}
368
368
369
- const progress = isSavingCode || processingStatus ;
369
+ const progress = showSavingMessage || processingStatus ;
370
370
if ( progress ) {
371
371
statusIcon = < FaSpinner className = "spin" /> ;
372
372
statusMessage = 'Please, wait...' ;
Original file line number Diff line number Diff line change @@ -98,15 +98,15 @@ export const getLabel = (
98
98
} ;
99
99
100
100
export const useTemplateType = ( ) : ProcessingArgs => {
101
- const { isSavingCode } = useProject ( ) ;
101
+ const { showSavingMessage } = useProject ( ) ;
102
102
const {
103
103
createScriptExecution,
104
104
createTransactionExecution,
105
105
updateAccountDeployedCode,
106
106
} = useProject ( ) ;
107
107
108
108
return {
109
- disabled : isSavingCode ,
109
+ disabled : showSavingMessage ,
110
110
scriptFactory : createScriptExecution ,
111
111
transactionFactory : createTransactionExecution ,
112
112
contractDeployment : updateAccountDeployedCode ,
Original file line number Diff line number Diff line change @@ -121,15 +121,15 @@ const ShareSaveButton = ({
121
121
onSave,
122
122
icon,
123
123
} : ShareSaveButtonProps ) => {
124
- const { isSavingCode } = useProject ( ) ;
124
+ const { showSavingMessage } = useProject ( ) ;
125
125
return (
126
126
< Box sx = { { marginRight : '0.5rem' } } >
127
127
{ showShare ? (
128
128
< ShareButton url = { url } />
129
129
) : (
130
130
< FlowButton
131
131
onClick = { ( ) => onSave ( ) }
132
- disabled = { isSavingCode }
132
+ disabled = { showSavingMessage }
133
133
Icon = { icon }
134
134
>
135
135
{ saveText }
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ const EditorLayout: React.FC = () => {
49
49
const {
50
50
project,
51
51
updateProject,
52
- isSavingCode ,
52
+ showSavingMessage ,
53
53
isLoading,
54
54
active,
55
55
setSelectedResourceAccount,
@@ -197,7 +197,7 @@ const EditorLayout: React.FC = () => {
197
197
} }
198
198
>
199
199
< AnimatePresence exitBeforeEnter >
200
- { project && project . persist && isSavingCode && (
200
+ { project && project . persist && showSavingMessage && (
201
201
< motion . div
202
202
initial = { { opacity : 0 } }
203
203
animate = { { opacity : 1 } }
@@ -209,7 +209,7 @@ const EditorLayout: React.FC = () => {
209
209
Autosaving...
210
210
</ motion . div >
211
211
) }
212
- { project && project . persist && ! isSavingCode && (
212
+ { project && project . persist && ! showSavingMessage && (
213
213
< motion . div
214
214
initial = { { opacity : 0 } }
215
215
animate = { { opacity : 1 } }
You can’t perform that action at this time.
0 commit comments