Add style to Join.js
co-authored-by: mitchemmmc <mitchemmc@gmail.com>
This commit is contained in:
parent
c1e72766c5
commit
e52f3cbdaf
@ -1,11 +1,27 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import { A } from "hookrouter";
|
import { navigate } from "hookrouter";
|
||||||
|
import { Container, Box, Label, Input, Button } from "theme-ui";
|
||||||
|
|
||||||
function Join() {
|
function Join() {
|
||||||
|
const [id, setId] = useState("");
|
||||||
|
|
||||||
|
function handleChange(event) {
|
||||||
|
setId(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSubmit(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
navigate("/game");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<Container p={4} sx={{ maxWidth: "300px" }}>
|
||||||
<A href="/game">GO TO GAME</A>JOIN!
|
<Box as="form" onSubmit={handleSubmit}>
|
||||||
</div>
|
<Label htmlFor="id">Shove an ID in me</Label>
|
||||||
|
<Input my={4} id="id" name="id" value={id} onChange={handleChange} />
|
||||||
|
<Button>Go ʕ•ᴥ•ʔ</Button>
|
||||||
|
</Box>
|
||||||
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user