Commit 72226334 authored by Chunchi Che's avatar Chunchi Che

centered align

parent 98220543
import React, { useState, ChangeEvent } from "react"; import React, { useState, ChangeEvent } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import "./css/WaitRoom.css";
export default function JoinRoom() { export default function JoinRoom() {
const [player, setPlayer] = useState(""); const [player, setPlayer] = useState("");
...@@ -19,6 +20,7 @@ export default function JoinRoom() { ...@@ -19,6 +20,7 @@ export default function JoinRoom() {
return ( return (
<div> <div>
<p> <p>
<label>player: </label>
<input <input
type="text" type="text"
title="player" title="player"
...@@ -27,6 +29,7 @@ export default function JoinRoom() { ...@@ -27,6 +29,7 @@ export default function JoinRoom() {
></input> ></input>
</p> </p>
<p> <p>
<label>addr: </label>
<input <input
type="text" type="text"
title="ip" title="ip"
...@@ -35,6 +38,7 @@ export default function JoinRoom() { ...@@ -35,6 +38,7 @@ export default function JoinRoom() {
></input> ></input>
</p> </p>
<p> <p>
<label>passwd: </label>
<input <input
type="text" type="text"
title="passwd" title="passwd"
...@@ -42,9 +46,11 @@ export default function JoinRoom() { ...@@ -42,9 +46,11 @@ export default function JoinRoom() {
onChange={handlePasswdChange} onChange={handlePasswdChange}
></input> ></input>
</p> </p>
<button> <p>
<Link to={{ pathname: `/${player}/${passWd}/${ip}` }}>join</Link> <button>
</button> <Link to={{ pathname: `/${player}/${passWd}/${ip}` }}>join</Link>
</button>
</p>
</div> </div>
); );
} }
body {
margin: 0;
}
div {
margin: auto;
}
p {
text-align: center;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment