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

리스트

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