diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index 4b7a69c2e0..474d1c95e6 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -1,4 +1,4 @@ -import React, {useState, useEffect} from 'react' +import React, {useState, useEffect, useRef} from 'react' import {remixClient} from './utils' import {CompilationResult} from '@remixproject/plugin-api' @@ -16,7 +16,7 @@ import Card from 'react-bootstrap/Card' import './app.css' import {CustomTooltip} from '@remix-ui/helper' -import { Form} from 'react-bootstrap' +import {Form} from 'react-bootstrap' import {CompileErrorCard} from './components/CompileErrorCard' import CustomAccordionToggle from './components/CustomAccordionToggle' @@ -40,6 +40,8 @@ const App = () => { localUrl: 'http://localhost:8000/', }) + const spinnerIcon = useRef(null) + useEffect(() => { async function start() { try { @@ -101,8 +103,14 @@ const App = () => { setOutput(remixClient.compilerOutput) } - const [toggleAccordion, setToggleAccordion] = useState(false) + const startingCompilation = () => { + if (!spinnerIcon.current) return + spinnerIcon.current.setAttribute('title', 'compiling...') + spinnerIcon.current.classList.remove('remixui_bouncingIcon') + spinnerIcon.current.classList.add('remixui_spinningIcon') + } + const [toggleAccordion, setToggleAccordion] = useState(false) return (
@@ -117,39 +125,46 @@ const App = () => {
-
+
Advanced Compiler Settings - {/* */}
- setEnvironment('remote')} label="Remote Compiler" className={`${state.environment === 'remote' ? 'd-flex mr-4' : 'd-flex mr-4 cursor-status'}`} - /> - setEnvironment('local')} label="Local Compiler" - className={`${state.environment === 'local' ? '' : `cursor-status`}`}/> + setEnvironment('remote')} label="Remote Compiler" className={`${state.environment === 'remote' ? 'd-flex mr-4' : 'd-flex mr-4 cursor-status'}`} /> + setEnvironment('local')} label="Local Compiler" className={`${state.environment === 'local' ? '' : `cursor-status`}`} />
- Specify the compiler version & EVM version in the .vy file. + + Specify the{' '} + + compiler version + {' '} + &{' '} + + EVM version + {' '} + in the .vy file. +
setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} />
-
+
{output && Object.keys(output).length > 0 && output.status !== 'failed' ? ( <> ) : output.status === 'failed' ? ( - + ) : null}