Commit f4bae50f authored by JeongYeonwoo's avatar JeongYeonwoo
Browse files

merge

parent 952a6040
...@@ -3,8 +3,8 @@ import { Form, Button, Row } from 'react-bootstrap'; ...@@ -3,8 +3,8 @@ import { Form, Button, Row } from 'react-bootstrap';
function Chat(props) { function Chat(props) {
let defaultname='' // let defaultname=''
// let defaultname = sessionStorage.getItem('name'); let defaultname = sessionStorage.getItem('name');
const [inner, setInner] = useState(['']) const [inner, setInner] = useState([''])
const [chat, setChat] = useState([inner]) //object로 key는 보낸사람 value는 메세지 const [chat, setChat] = useState([inner]) //object로 key는 보낸사람 value는 메세지
...@@ -32,7 +32,7 @@ function Chat(props) { ...@@ -32,7 +32,7 @@ function Chat(props) {
<h2>현재 {props.roomName} 입니다.</h2> <h2>현재 {props.roomName} 입니다.</h2>
{ chat.map((value, index) => ( { chat.map((value, index) => (
<Row key={index} className='ml-3'> <Row key={index} className='ml-3'>
{props.roomName}에서 {props.namelist}님이 보낸 메세지 : {value} {props.roomName}에서 {defaultname}님이 보낸 메세지 : {value}
</Row> </Row>
))} ))}
<Button variant="light" onClick={props.handleChatc} >{`<`}</Button> <Button variant="light" onClick={props.handleChatc} >{`<`}</Button>
......
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