Skip to content

Instantly share code, notes, and snippets.

@chriscorcoran
Last active July 9, 2021 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriscorcoran/a307e9d423ea6b90d449da3eabd006f3 to your computer and use it in GitHub Desktop.
Save chriscorcoran/a307e9d423ea6b90d449da3eabd006f3 to your computer and use it in GitHub Desktop.
Creating the UI
import { Container, Form, Button } from "react-bootstrap";
function App() {
return (
<div className="App">
<Container>
<h2>Lets JaaS It Up</h2>
<Form
style={{ display: allowed ? "none" : "block" }}>
<Form.Group>
<Form.Label htmlFor="email">
Email Address
</Form.Label>
<Form.Control
value={email}
onChange={(e) => setEmail(e.target.value)} />
</Form.Group>
<Button variant="primary" type="submit">Join</Button>
</Form>
<div style={{ display: allowed ? "block" : "none" }}>
<div id="jaas-container" style={{height: "700px"}}></div>
</div>
</Container>
</div>
);
}
import React, { useState, useEffect } from "react";
import { Container, Form, Button } from "react-bootstrap";
function App() {
// Setup our Hooks to manage state
const [email, setEmail] = useState("");
const [allowed, setAllowed] = useState(false);
return (
<div className="App">
<Container>
<h2>Lets JaaS It Up</h2>
<Form
style={{ display: allowed ? "none" : "block" }}>
<Form.Group>
<Form.Label htmlFor="email">
Email Address
</Form.Label>
<Form.Control
value={email}
onChange={(e) => setEmail(e.target.value)} />
</Form.Group>
<Button variant="primary" type="submit">Join</Button>
</Form>
<div style={{ display: allowed ? "block" : "none" }}>
<div id="jaas-container" style={{height: "700px"}}></div>
</div>
</Container>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment