Created
July 12, 2020 22:37
-
-
Save jetaggart/d9a2388c31e224e3f003061dd9de373d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// frontend/src/App.js:7 | |
function App() { | |
const [firstName, setFirstName] = useState(''); | |
const [lastName, setLastName] = useState(''); | |
const [email, setEmail] = useState(''); | |
// We'll get to these in a bit | |
const [chatClient, setChatClient] = useState(null); | |
const [channel, setChannel] = useState(null); | |
async function register() { | |
// ... | |
} | |
if (chatClient && channel) { | |
// ... | |
} else { | |
return ( | |
<div className="app"> | |
<div className="app-input"> | |
<label htmlFor="firstName">First Name</label> | |
<input type="text" name="firstName" | |
value={firstName} | |
onChange={(e) => setFirstName(e.target.value)} | |
/> | |
</div> | |
<div className="app-input"> | |
<label htmlFor="lastName">Last Name</label> | |
<input type="text" name="lastName" | |
value={lastName} | |
onChange={(e) => setLastName(e.target.value)} | |
/> | |
</div> | |
<div className="app-input"> | |
<label htmlFor="email">Email</label> | |
<input type="text" name="email" | |
value={email} | |
onChange={(e) => setEmail(e.target.value)} | |
/> | |
</div> | |
<button onClick={() => register()}>Start Chat</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment