Commit 7ed274d3 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

에러 수정

parent a47d81b4
......@@ -85,7 +85,6 @@ function Chat(props) {
props.setRecievedMsg('')
props.handleChatc()
setChat([''])
props.setLeaveInfo([...props.leaveInfo, { roomName: props.roomCode, leaveTime: realTime }])
recordEntryLog()
props.setRoomCode('')
}
......
import React from 'react'
import React, { useState, useEffect } from 'react'
import { Badge, ListGroup } from 'react-bootstrap';
import "../Pages/Home.css";
import axios from 'axios'
......@@ -45,7 +45,7 @@ function ClosedList(props) {
useEffect(() => { // 누군가 보내면 다시 개수 셈
console.log('chat 클라이언트 변경!')
props.unreadMessage()
console.log('새 메세지가 도착했습니다.',props.leftInfo)
console.log('새 메세지가 도착했습니다.', props.leftInfo)
}, [props.checknew])
useEffect(() => { //일단 들오면 실행해야지
......@@ -54,7 +54,7 @@ function ClosedList(props) {
let count=[]
let count = []
const [unread, setUnread] = useState([])
useEffect(() => { //unread정보가 들어오면 재정비해서 뿌려주기 위한 작업!
for (let i = 0; i < props.unreadnumber.length; i++) {
......@@ -68,7 +68,7 @@ function ClosedList(props) {
{props.closedlist.map((item, index) =>
<ListGroup key={index}>
<ListGroup.Item action onClick={enterChatRoomCH} name={item.roomId} value={item.roomName}
className='rounded-0'>
className='rounded-0'>
{item.roomName}
{unread[index] ? <Badge className='ml-2' pill variant='danger'>{unread[index]}</Badge> : ''}
</ListGroup.Item>
......
......@@ -236,7 +236,7 @@ function Home() {
</Col>
<Col style={{ padding: "5px", marginLeft: "15px" }}>
{show ? <>
{chat ? <Chat leftInfo={leftInfo} setLeftInfo={setLeftInfo} handleChatc={handleChatc} leaveInfo={leaveInfo} setLeaveInfo={setLeaveInfo} sendMsg={sendMsg} singleChat={singleChat} singleUser={singleUser} singleImg={singleImg} singleTime={singleTime} recievedMsg={recievedMsg} recievedUser={recievedUser} recievedImg={recievedImg} recievedTime={recievedTime} setSingleChat={setSingleChat} setSingleUser={setSingleUser} setSingleImg={setSingleImg} setSingleTime={setSingleTime} setRecievedMsg={setRecievedMsg} roomCode={roomCode} roomName={roomName} closeChatRoom={closeChatRoom} exitRoom={exitRoom} />
{chat ? <Chat leftInfo={leftInfo} setLeftInfo={setLeftInfo} handleChatc={handleChatc} sendMsg={sendMsg} singleChat={singleChat} singleUser={singleUser} singleImg={singleImg} singleTime={singleTime} recievedMsg={recievedMsg} recievedUser={recievedUser} recievedImg={recievedImg} recievedTime={recievedTime} setSingleChat={setSingleChat} setSingleUser={setSingleUser} setSingleImg={setSingleImg} setSingleTime={setSingleTime} setRecievedMsg={setRecievedMsg} roomCode={roomCode} roomName={roomName} closeChatRoom={closeChatRoom} exitRoom={exitRoom} setRoomCode={setRoomCode} />
: <div style={{ position: "fixed", bottom: "20px", right: "30px" }}>
<Button style={{ borderColor: "#9174ad", backgroundColor: "#9174ad", color: 'white' }} onClick={handleShowModal} size="lg" block>생성</Button>
<Button style={{ borderColor: "#9174ad", backgroundColor: "#9174ad", color: 'white' }} onClick={handleShowEnter} size="lg" block>참가</Button>
......
......@@ -137,9 +137,8 @@ function ProfilePage() {
<Row className='m-3 justify-content-center'>
<Form onSubmit={handleSubmit}>
<Button size="sm" className="mr-4" type='submit' variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}>저장</Button>
<Link to='/'>
<Button size="sm" className="ml-4" variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}> 화면으로</Button>
</Link>
<Button href='/' size="sm" className="ml-4" variant="outline" style={{ border: "3px solid", borderColor: "#9174ad", background: 'white' }}> 화면으로</Button>
</Form>
</Row>
</Col>
......
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