-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from encryptedge/patch/fixes
Patch/fixes
- Loading branch information
Showing
17 changed files
with
156 additions
and
50 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from "react"; | ||
import apiClient from "../../libs/api.client"; | ||
import { useState } from "react"; | ||
import { toast } from "react-toastify"; | ||
|
||
function CreateTeamCard() { | ||
const [teamName, setTeamName] = useState(""); | ||
const [teamCode, setTeamCode] = useState(""); | ||
|
||
async function submitData(evt) { | ||
evt.preventDefault(); | ||
try { | ||
const res = await apiClient.post("/team", { | ||
team_name: teamName, | ||
join_code: teamCode, | ||
}); | ||
window.location.href = "/whoami"; | ||
} catch (err) { | ||
console.error("errr"); | ||
toast.error("Error creating team"); | ||
} | ||
} | ||
return ( | ||
<div className="login-card"> | ||
<h2>Create A Team</h2> | ||
<form onSubmit={submitData}> | ||
<div className="form-control"> | ||
<div className="form-el-container"> | ||
<label htmlFor="team_name">Team Name</label> | ||
</div> | ||
<div className="form-el-container"> | ||
<input | ||
className="forminput" | ||
type="text" | ||
id="team_name" | ||
value={teamName} | ||
onChange={(event) => setTeamName(event.target.value)} | ||
placeholder="Enter your Team Name" | ||
/> | ||
</div> | ||
</div> | ||
<div className="form-control"> | ||
<div className="form-el-container"> | ||
<label htmlFor="team_code">Team Code</label> | ||
</div> | ||
<div className="form-el-container"> | ||
<input | ||
className="forminput" | ||
type="text" | ||
id="team_code" | ||
value={teamCode} | ||
onChange={(event) => setTeamCode(event.target.value)} | ||
placeholder="Enter your Team Code" | ||
/> | ||
</div> | ||
</div> | ||
<button className="btn" type="submit"> | ||
Create Team | ||
</button> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default CreateTeamCard; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import apiClient from "../../libs/api.client"; | ||
import { useState } from "react"; | ||
|
||
function JoinTeamCard() { | ||
const [teamCode, setTeamCode] = useState(""); | ||
|
||
return ( | ||
<div className="signup-card login-card"> | ||
<h2>Join a Team</h2> | ||
<form onSubmit={() => {}}> | ||
<div className="form-control"> | ||
<div className="form-el-container"> | ||
<label htmlFor="team_code">Team Code</label> | ||
</div> | ||
<div className="form-el-container"> | ||
<input | ||
className="forminput" | ||
type="text" | ||
id="team_code" | ||
value={teamCode} | ||
onChange={(event) => setTeamCode(event.target.value)} | ||
placeholder="Enter your Team Code" | ||
/> | ||
</div> | ||
</div> | ||
<button className="btn" type="submit"> | ||
Join Team | ||
</button> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default JoinTeamCard; |
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import "react-toastify/dist/ReactToastify.css"; | ||
|
||
import Navbar from "../components/navbar"; | ||
|
||
function News() { | ||
|
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
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
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
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
Empty file.