Skip to content

Commit

Permalink
Merge branch 'develop' into feature/#3
Browse files Browse the repository at this point in the history
  • Loading branch information
suehub committed Nov 9, 2023
2 parents b1d6505 + a9146d8 commit 3ff17ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/components/Main/CreateGameModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Button, Input } from "@chakra-ui/react";
import { serverTimestamp } from "firebase/firestore";
import { ChangeEvent, useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { io } from "socket.io-client";
import styled from "styled-components";
import useFetch from "../../../hooks/useFetch";
import useFireFetch from "../../../hooks/useFireFetch";
import useInput from "../../../hooks/useInput";
import UserCard from "../../common/UserCard";
import useFireFetch from "../../../hooks/useFireFetch";
import { useNavigate } from "react-router-dom";

const Container = styled.div`
position: absolute;
top: 0;
Expand Down Expand Up @@ -201,6 +203,7 @@ const CreateGameModal = ({ setModal }: Props) => {
...roomData,
id: createGame.result.id,
host: token.id,
createdAt: serverTimestamp(),
};

fireFetch.usePostData("game", createGame.result.id, {
Expand Down Expand Up @@ -328,7 +331,7 @@ const CreateGameModal = ({ setModal }: Props) => {
</div>
</Section>
<Section>
<div>
<div style={{ overflow: "auto" }}>
<Input
border="1px solid #c6c6c6"
placeholder="검색"
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/UserCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "styled-components";
import { Button } from "@chakra-ui/react";
import { useState } from "react";
import styled from "styled-components";

const Profile = styled.div`
border: 1px solid #c6c6c6;
Expand Down Expand Up @@ -74,6 +74,7 @@ const UserCard = ({ id, name, picture, roomData, setRoomData }: Props) => {
height="1.3rem"
fontSize=".8rem"
onClick={handleInvite}
colorScheme="red"
>
취소
</Button>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/Game/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import useFireFetch from "../../hooks/useFireFetch";

const Game = () => {
const queryString = window.location.search;
const searchParams = new URLSearchParams(queryString);
const gameId = searchParams.get("gameId");

const fireFetch = useFireFetch();

const gameData = fireFetch.useGetSome("game", "id", gameId as string);

console.log(gameData.data);
return <div>game page</div>;
};

Expand Down

0 comments on commit 3ff17ba

Please sign in to comment.