Commit 98350914 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

Merge remote-tracking branch 'origin/sooModalTest' into young

parents 5de58303 e4f87946
......@@ -87,7 +87,7 @@ function Chat(props) {
return (
<>
<Container id="chat" style={{ overflow: 'auto', padding: '20px', border: "2px solid", height: "500px", margin: "1%", borderColor: "#BDBDBD", background: '' }}>
<Row class="d-flex justify-content-center" style={{ border: "2px solid", borderWidth: "medium", borderColor: "#FFD75F", height: "80px", margin: "1%" }}>
<Row className="d-flex justify-content-center" style={{ border: "2px solid", borderWidth: "medium", borderColor: "#FFD75F", height: "80px", margin: "1%" }}>
<Col md="auto">
<Button variant="light" onClick={props.handleChatc} >{`<`}</Button>
</Col>
......
......@@ -24,6 +24,7 @@ function EnterRoom(props) {
let res = await axios.post('/room/enterRoom', { enterCode })
await axios.put('/room/member', { userId: userId, roomId: enterCode })
props.setRoomName(res.data)
props.setRoomCode(enterCode)
props.enterChatRoom(enterCode)
props.handleCloseEnter()
props.handleChato()
......
......@@ -28,7 +28,7 @@ function Home() {
const [chat, setChat] = useState(false);
const [open, setOpen] = useState(false);
const [room, setRoom] = useState(INIT_ROOM)
const [show, setShow] = useState(true)
const [show, setShow] = useState(false)
//소켓
const [singleChat, setSingleChat] = useState('')
......@@ -53,8 +53,8 @@ function Home() {
const handleCloseModal = () => setShowModal(false);
const handleShowModal = () => setShowModal(true);
const handleCloseEnter = () => setEnter(false);
const handleShowEnter = () => setEnter(true);
const handleCloseEnter = () => setShowEnter(false);
const handleShowEnter = () => setShowEnter(true);
const handleChato = () => setChat(true);
const handleChatc = () => setChat(false);
......@@ -70,6 +70,7 @@ function Home() {
console.log(roomInf.data)
console.log(roomInf.data[0])
setRoom(roomInf.data[0])
setOpen(true)
setShow(false)
}
......@@ -130,14 +131,17 @@ function Home() {
</Tabs>
</Col>
<Col style={{ padding: "0" }}>
{show ? <>
{chat ?
<Chat handleChatc={handleChatc} sendMsg={sendMsg} singleChat={singleChat} recievedMsg={recievedMsg} newUser={newUser} setSingleChat={setSingleChat} roomCode={roomCode} singleImg={singleImg} setSingleImg={setSingleImg} recievedImg={recievedImg} singleUser={singleUser} setSingleUser={setSingleUser} recievedUser={recievedUser} />
<>
{(show || chat) ?
null
: <div style={{ position: "fixed", bottom: "20px", right: "30px" }}>
<Button variant="primary" onClick={handleShowModal} size="lg" block>생성</Button>
<Button variant="secondary" onClick={handleShowEnter} size="lg" block>참가</Button>
</div>}
</> : <>
</div>
}
{chat ?
<Chat handleChatc={handleChatc} sendMsg={sendMsg} singleChat={singleChat} recievedMsg={recievedMsg} setSingleChat={setSingleChat} roomCode={roomCode} roomName={roomName} />
: null}
{open ?
<div className="vh-90 flex-column align-items-center justify-content-center mt-2" variant="dark">
<div className="d-flex justify-content-center">
......@@ -152,12 +156,9 @@ function Home() {
</Row>
</div>
</div>
</div> :
<div style={{ position: "fixed", bottom: "20px", right: "30px" }}>
<Button variant="primary" onClick={handleShowModal} size="lg" block>생성</Button>
<Button variant="secondary" onClick={handleShowEnter} size="lg" block>참가</Button>
</div>}
</>}
</div>
: null}
</>
</Col>
</Row>
<RoomMake showModal={showModal} handleCloseModal={handleCloseModal} />
......
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