Commit 801c203d authored by Choi Ga Young's avatar Choi Ga Young
Browse files

리스트

parent 825a1d84
...@@ -128,18 +128,18 @@ function Chat(props) { ...@@ -128,18 +128,18 @@ function Chat(props) {
return ( return (
<div id="chat" style={{ display: "flex", flexDirection: "column", borderStyle: "solid", borderRadius: "5px", borderColor: "#4A5D7E", backgroundColor: "#FFFFFF", padding: '15px', width: "100%", height: "580px", position: "relative" }}> <div id="chat" style={{ display: "flex", flexDirection: "column", borderStyle: "solid", borderRadius: "5px", borderColor: "#4A5D7E", backgroundColor: "#FFFFFF", padding: '15px', width: "100%", height: "580px", position: "relative" }}>
<div id="chat-head" style={{ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", height: "80px" }}> <div id="chat-head" style={{ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", height: "80px" }}>
<a onClick={handleClick} style={{ margin: "0px 0px 0px 15px" }}><BsCaretLeftFill size="20" color="#333333" /></a> <a href="#;" onClick={handleClick} style={{ margin: "0px 0px 0px 15px" }}><BsCaretLeftFill size="20" color="#333333" /></a>
<div style={{ justifyContent: "center" }}> <div style={{ justifyContent: "center" }}>
<p style={{ color: "#333333", fontWeight: "bold", fontSize: "1.6em", textAlign: "center", margin: "0px 0px 0.5px 0px" }}> {props.roomName} </p> <p style={{ color: "#333333", fontWeight: "bold", fontSize: "1.6em", textAlign: "center", margin: "0px 0px 0.5px 0px" }}> {props.roomName} </p>
<p style={{ color: "#333333", fontSize: "0.8em", textAlign: "center", margin: "0.5px 0px 0px 0px" }}> {props.roomCode} </p> <p style={{ color: "#333333", fontSize: "0.8em", textAlign: "center", margin: "0.5px 0px 0px 0px" }}> {props.roomCode} </p>
</div> </div>
<a onClick={() => setExit(!exit)} style={{ margin: "0px 15px 0px 0px" }}><BsList size="20" color="#333333" /></a> <a href="#;" onClick={() => setExit(!exit)} style={{ margin: "0px 15px 0px 0px" }}><BsList size="20" color="#333333" /></a>
</div> </div>
{exit ? {exit ?
<div id="chat-exit-check" style={{ display: "flex", flexDirection: "row", justifyContent: "space-evenly", alignItems: "center", margin: "1%", backgroundColor: "#30284D", borderRadius: "5px", height: "50px" }}> <div id="chat-exit-check" style={{ display: "flex", flexDirection: "row", justifyContent: "space-evenly", alignItems: "center", margin: "1%", backgroundColor: "#30284D", borderRadius: "5px", height: "50px" }}>
<p style={{ width: "70%", color: "#FAFAFA", fontSize: "1em", margin: "0px 10px 0px 20px" }}><BsExclamationCircleFill size="1em" color="#F2D788" /> 퇴장하시겠습니까?</p> <p style={{ width: "70%", color: "#FAFAFA", fontSize: "1em", margin: "0px 10px 0px 20px" }}><BsExclamationCircleFill size="1em" color="#F2D788" /> 퇴장하시겠습니까?</p>
<a onClick={exitAndCloseRoom}><BsCheck size="1em" color="#F2D788" /></a> <a href="#;" onClick={exitAndCloseRoom}><BsCheck size="1em" color="#F2D788" /></a>
<a onClick={() => setExit(!exit)}><BsX size="1em" color="#F2D788" /></a> <a href="#;" onClick={() => setExit(!exit)}><BsX size="1em" color="#F2D788" /></a>
</div> </div>
: null} : null}
<div id="chat-body" style={{ overflow: 'auto', padding: '15px', width: "100%", height: "400px", margin: "1%", background: '' }}> <div id="chat-body" style={{ overflow: 'auto', padding: '15px', width: "100%", height: "400px", margin: "1%", background: '' }}>
...@@ -147,7 +147,7 @@ function Chat(props) { ...@@ -147,7 +147,7 @@ function Chat(props) {
if (!(value.msg === '')) { if (!(value.msg === '')) {
if (value.sender === "system") { if (value.sender === "system") {
return ( return (
<Row style={{ background: "#F5F5F5", border:"none" }}> <Row style={{ background: "#F5F5F5", border: "none", justifyContent: "center" }}>
{value.msg} {value.msg}
</Row> </Row>
) )
......
...@@ -7,13 +7,9 @@ function OpenList(props) { ...@@ -7,13 +7,9 @@ function OpenList(props) {
if (props.roomCode){ if (props.roomCode){
props.closeChatRoom(props.roomCode) props.closeChatRoom(props.roomCode)
} }
console.log('e확인', e.target)
const roomCode = e.target.name const roomCode = e.target.name
// props.enterChatRoom(roomCode) // 각각의 room으로 들어가도록 설정해야 함
props.openListroom(roomCode) props.openListroom(roomCode)
props.setRoomCode(roomCode) props.setRoomCode(roomCode)
// props.clearChat()
} }
return ( return (
......
...@@ -28,7 +28,6 @@ function RoomMake(props) { ...@@ -28,7 +28,6 @@ function RoomMake(props) {
const Id = res.data.roomId const Id = res.data.roomId
alert(`방암호는 ${Id}입니다`) alert(`방암호는 ${Id}입니다`)
props.handleCloseModal() props.handleCloseModal()
props.handleChato()
setRoom(INIT_ROOM) setRoom(INIT_ROOM)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
...@@ -62,7 +61,6 @@ function RoomMake(props) { ...@@ -62,7 +61,6 @@ function RoomMake(props) {
<option>언어</option> <option>언어</option>
<option>취미</option> <option>취미</option>
</Form.Control> </Form.Control>
{/* <Form.Control type="text" /> */}
</Col> </Col>
</Form.Group> </Form.Group>
<Form.Group as={Row} controlId="chatIsOpen"> <Form.Group as={Row} controlId="chatIsOpen">
......
...@@ -54,7 +54,12 @@ function Home() { ...@@ -54,7 +54,12 @@ function Home() {
const [recievedTime, setRecievedTime] = useState('') const [recievedTime, setRecievedTime] = useState('')
const [leaveInfo, setLeaveInfo] = useState([{ roomName: "", leaveTime: "" }]) const [leaveInfo, setLeaveInfo] = useState([{ roomName: "", leaveTime: "" }])
const handleCloseModal = () => setShowModal(false); const handleCloseModal = () => {
setShowModal(false);
getClosedList()
getOpenList()
}
const handleShowModal = () => setShowModal(true); const handleShowModal = () => setShowModal(true);
const handleCloseEnter = () => setShowEnter(false); const handleCloseEnter = () => setShowEnter(false);
const handleShowEnter = () => setShowEnter(true); const handleShowEnter = () => setShowEnter(true);
...@@ -81,7 +86,6 @@ function Home() { ...@@ -81,7 +86,6 @@ function Home() {
const userNick = response.data.nickname; const userNick = response.data.nickname;
await axios.put('/room/deleteMem', { userId: userId, roomId: roomId }) await axios.put('/room/deleteMem', { userId: userId, roomId: roomId })
setSysmsg(`${userNick}님이 나갔습니다.`) setSysmsg(`${userNick}님이 나갔습니다.`)
console.log(`${roomId}${userId} 탈퇴`)
setRoomCode("") setRoomCode("")
} }
...@@ -93,19 +97,16 @@ function Home() { ...@@ -93,19 +97,16 @@ function Home() {
async function getOpenList() { async function getOpenList() {
let res = await axios.get('/room/openlist') let res = await axios.get('/room/openlist')
console.log('getOpenlist', res.data)
setOpenlist(res.data) setOpenlist(res.data)
} }
//오픈채팅방에서 참가하기
async function openListroom(roomId) { async function openListroom(roomId) {
console.log(roomId)
const roomInf = await axios.get('/room/changeMem', { params: { 'roomId': roomId } }) const roomInf = await axios.get('/room/changeMem', { params: { 'roomId': roomId } })
setRoom(roomInf.data[0]) setRoom(roomInf.data[0])
setOpen(true) setOpen(true)
setShow(false) setShow(false)
} }
//오픈채팅방에서 참가하기
async function attendListRoom() { async function attendListRoom() {
const roomId = room.roomId const roomId = room.roomId
const tf = await axios.put('/room/changeMem', { userId: userId, roomId: roomId }) const tf = await axios.put('/room/changeMem', { userId: userId, roomId: roomId })
...@@ -114,6 +115,7 @@ function Home() { ...@@ -114,6 +115,7 @@ function Home() {
if (tf.data) { if (tf.data) {
alert('참가되었습니다.') alert('참가되었습니다.')
setSysmsg(`${userNick}님이 들어왔습니다.`) setSysmsg(`${userNick}님이 들어왔습니다.`)
getClosedList()
} else { } else {
alert('이미 참가된 방입니다.') alert('이미 참가된 방입니다.')
} }
...@@ -173,11 +175,7 @@ function Home() { ...@@ -173,11 +175,7 @@ function Home() {
<> <>
<Menu /> <Menu />
<Row className="mr-0"> <Row className="mr-0">
<Col className="list" md={5}> <Col className="list" md={5} style={{ overflow: 'auto', height: "80%" }}>
{/* <Navbar>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse>
<Nav> */}
<Sdiv chat={chat}> <Sdiv chat={chat}>
<Tabs defaultActiveKey="closed" id="uncontrolled-tab-example" > <Tabs defaultActiveKey="closed" id="uncontrolled-tab-example" >
<Tab eventKey="closed" title="내 채팅" onClick={handleChato} > <Tab eventKey="closed" title="내 채팅" onClick={handleChato} >
...@@ -188,9 +186,6 @@ function Home() { ...@@ -188,9 +186,6 @@ function Home() {
</Tab> </Tab>
</Tabs> </Tabs>
</Sdiv> </Sdiv>
{/* </Nav>
</Navbar.Collapse>
</Navbar> */}
</Col> </Col>
<Col style={{ padding: "5px", marginLeft: "15px" }}> <Col style={{ padding: "5px", marginLeft: "15px" }}>
<> <>
...@@ -232,8 +227,8 @@ function Home() { ...@@ -232,8 +227,8 @@ function Home() {
const Sdiv = styled.div` const Sdiv = styled.div`
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
display: ${({ chat }) => { display: ${({ chat }) => {
return chat === false ? 'block' : 'none' return chat === false ? 'block' : 'none'
}} }}
} }
` `
......
...@@ -38,8 +38,6 @@ function LogIn() { ...@@ -38,8 +38,6 @@ function LogIn() {
setSucces(true) setSucces(true)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
//setError(error.response.data)
//error객체가 들어감.
} finally { } finally {
setLoading(false) setLoading(false)
} }
......
...@@ -123,9 +123,9 @@ function ProfilePage() { ...@@ -123,9 +123,9 @@ function ProfilePage() {
</Row> </Row>
<Row className='m-3 justify-content-center'> <Row className='m-3 justify-content-center'>
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit}>
<Button variant="outline-success" size="sm" className="mr-4" type='submit' variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}>저장</Button> <Button size="sm" className="mr-4" type='submit' variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}>저장</Button>
<Link to='/'> <Link to='/'>
<Button variant="outline-success" size="sm" className="ml-4" variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}> 화면으로</Button> <Button size="sm" className="ml-4" variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}> 화면으로</Button>
</Link> </Link>
</Form> </Form>
</Row> </Row>
......
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