vyper UI improvements

pull/5370/head
lianahus 3 years ago committed by Aniket
parent 5212461d0f
commit 7d2ad785b4
  1. 1
      apps/vyper/src/app/app.css
  2. 4
      apps/vyper/src/app/app.tsx
  3. 5
      apps/vyper/src/app/components/CompilerButton.tsx
  4. 23
      apps/vyper/src/app/components/LocalUrl.tsx
  5. 8
      apps/vyper/src/app/components/VyperResult.tsx

@ -60,7 +60,6 @@ html, body, #root, main {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
padding-top: 10px; padding-top: 10px;

@ -68,7 +68,7 @@ const App: React.FC = () => {
return ( return (
<main id="vyper-plugin"> <main id="vyper-plugin">
<header className="bg-light"> <header>
<div className="title"> <div className="title">
<img src={vyperLogo} alt="Vyper logo" /> <img src={vyperLogo} alt="Vyper logo" />
<h4>yper Compiler</h4> <h4>yper Compiler</h4>
@ -110,7 +110,7 @@ const App: React.FC = () => {
} }
/> />
</div> </div>
<article id="result"> <article id="result" className="px-2">
<VyperResult output={contract ? output[contract] : undefined} /> <VyperResult output={contract ? output[contract] : undefined} />
</article> </article>
</section> </section>

@ -103,8 +103,9 @@ function CompilerButton({ contract, setOutput, compilerUrl }: Props) {
} }
return ( return (
<Button data-id="compile" onClick={compileContract} variant="primary"> <Button data-id="compile" onClick={compileContract} variant="primary" title={contract} className="d-flex flex-column">
Compile {contract} <span>Compile</span>
<span className="overflow-hidden text-truncate text-nowrap" >{contract}</span>
</Button> </Button>
) )
} }

@ -18,17 +18,18 @@ function LocalUrlInput({ url, setUrl, environment }: Props) {
} }
return ( return (
<Form id="local-url"> <Form id="local-url">
<Form.Group controlId="localUrl"> <Form.Group controlId="localUrl">
<Form.Label>Local Compiler Url</Form.Label> <label className="text-warning pb-4">Currently we support vyper version > 0.2.16</label>
<Form.Control onBlur={updateUrl} <Form.Label>Local Compiler Url</Form.Label>
defaultValue={url} <Form.Control onBlur={updateUrl}
type="email" defaultValue={url}
placeholder="eg http://localhost:8000/compile" /> type="email"
<Form.Text className="text-muted"> placeholder="eg http://localhost:8000/compile" />
</Form.Text> <Form.Text className="text-muted">
</Form.Group> </Form.Text>
</Form> </Form.Group>
</Form>
) )
} }

@ -27,9 +27,9 @@ function VyperResult({ output }: VyperResultProps) {
if (!output) return ( if (!output) return (
<div id="result"> <div id="result">
<p>No contract compiled yet.</p> <p className="my-3">No contract compiled yet.</p>
<Button data-id="add-repository" variant="info" onClick={() => remixClient.cloneVyperRepo()}> <Button data-id="add-repository" variant="secondary" className="w-100" onClick={() => remixClient.cloneVyperRepo()}>
Clone Vyper repository and play with the contract examples Clone Vyper examples repository
</Button> </Button>
</div> </div>
) )
@ -38,7 +38,7 @@ function VyperResult({ output }: VyperResultProps) {
return ( return (
<div id="result" className="error"> <div id="result" className="error">
<i className="fas fa-exclamation-circle text-danger"></i> <i className="fas fa-exclamation-circle text-danger"></i>
<pre data-id="error-message" className="alert alert-danger">{output.message}</pre> <pre data-id="error-message" className="w-100 alert alert-danger">{output.message}</pre>
</div>) </div>)
} }

Loading…
Cancel
Save