Skip to content

Commit

Permalink
Merge branch 'main' into socketio2
Browse files Browse the repository at this point in the history
  • Loading branch information
BhanuArora123 authored Oct 30, 2022
2 parents de1d1f1 + b39205c commit 3807569
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 213 deletions.
133 changes: 38 additions & 95 deletions Frontend/package-lock.json

Large diffs are not rendered by default.

45 changes: 0 additions & 45 deletions Frontend/src/components/CreateRoomModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,48 +55,3 @@ export function CreateRoomModal({ rangeUpperLimit, rangeLowerLimit, numberOfQues

);
}


/*
<div>
<div style={{
backgroundColor: "#171717"
}}>
<div>
<h1>
Set Room Constraits
</h1>
<button onClick={() => showModal(false)}></button>
</div>
<div className="modal-body" style={{
padding: 0
}}>
<div action="" className="homeForm">
<label style={{
display: "block"
}}>
Range <sub>(800 - 3500)</sub> :{" "}
</label>
<input type="number" min="800" max="3500" required="greater than 800" placeholder="lowerBound" ref={rangeLowerLimit} />
{" - "}
<input type="number" min="800" max="3500" required="greater than 800" placeholder="upperBound" ref={rangeUpperLimit} />
<label style={{
display: "block"
}} htmlFor="questionNo">
Number of questions:
</label>
<input name="questionNo" type="number" min="1" max="5" required="greater than 1" placeholder="Questions.." style={{
width: "100%"
}} ref={numberOfQuestions} />
</div>
</div>
<div className="modal-footer">
<button type="submit" className="btn btn-success" // onClick={() => setModalDismiss(true)}
>
Create Room
</button>
</div>
</div>
</div>
*/
2 changes: 0 additions & 2 deletions Frontend/src/components/JoinCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ const JoinCard = ({ roomId, name, room, noOfQuestions, range, password, setUsers

const handleClick = async (roomId) => {
console.log("clicked");
// user.userId = userId;
socket.emit("join_room", roomId, {
...user,
userId
});
// console.log(roomId);

const url = "http://localhost:4000/rooms/joinRoom";
const response = await axios.post(url, {
Expand Down
2 changes: 0 additions & 2 deletions Frontend/src/components/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import "./Player.css";

const Player = ({user,score}) => {
// console.log("user : ", user);
// console.log(score);
return (
<div className="hostBox">
<div style={{ marginBottom: "20px", borderBottom: "1px solid gray" }}>
Expand Down
41 changes: 0 additions & 41 deletions Frontend/src/hooks/useFetch.js

This file was deleted.

21 changes: 0 additions & 21 deletions Frontend/src/pages/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@
height: 100vh;
padding: 80px 20px 20px 10px;
background-color: var(--bg_color);
/* display: grid;
grid-template-columns: 2fr 1fr; */
display: flex;
justify-content:right;
/* align-items: center; */
background-image:url("../assets/background-hoa-la_120720601.webp") ;
background-size: cover;
background-repeat: no-repeat;
margin: auto;

}

/* .home img {
justify-self: center;
align-self: center;
background-blend-mode: normal;
}
.home >img{
width: 95%;
} */
.homeContent{
width: 50%;
align-self: right;
Expand Down Expand Up @@ -108,8 +97,6 @@ input:checked::after {
}

.disabled {
/* background-color: #ddd; */
/* cursor: not-allowed; */
opacity: 0.5;
pointer-events: none;
}
Expand All @@ -122,9 +109,6 @@ input:checked::after {
.arrow {
width: 20px;
height: 20px;
/* border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid var(--head_color); */
margin: 0 auto;
margin-top: 20px;
bottom: 0px;
Expand Down Expand Up @@ -204,8 +188,3 @@ input:checked::after {
left: 25px;
animation-delay: 0.6s;
}


/* new modal-------------------------------------- */


1 change: 0 additions & 1 deletion Frontend/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default function Home() {
};

const privateOnOff = () => {
// setPrivateon(privateOn ? false : true)
if (privateOn) {
setPassword("");
setPrivateon(false);
Expand Down
3 changes: 0 additions & 3 deletions Frontend/src/pages/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import Timer from "../components/Timer";

//

//socket
import { getSocket } from "../utils/io.connection";

Expand Down Expand Up @@ -122,7 +120,6 @@ const Room = ({users, setUsers}) => {
}
users[userIndex].score = data.totalScore;
setUsers(users);
// setUserAdded(true);
})

}, []);
Expand Down
69 changes: 66 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"react-tsparticles": "^2.3.3",
"socket.io": "^4.5.3"
}
}

0 comments on commit 3807569

Please sign in to comment.