Commit 3e091bf2 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

안내메시지

parent 7a5a52a5
......@@ -12,7 +12,7 @@ const INIT_CHAT = {
time: ''
}
function Chat(props) {
const [sender, setSender] = useState([])
//const [sender, setSender] = useState([])
//const [roomName, setRoomName] = useState('')
const [inner, setInner] = useState([''])
......@@ -148,7 +148,13 @@ function Chat(props) {
: null}
{chat.map((value, index) => {
if (!(value.msg === '')) {
if (!(value.sender === user.nickname)) {
if (value.sender === "system") {
return (
<Row className='border' style={{ background: "#FFFAFA"}}>
{value.msg}
</Row>
)
} else if (!(value.sender === user.nickname)) {
return (
<Row key={index} className='m-1' >
<Col xs={2}>
......@@ -163,10 +169,6 @@ function Chat(props) {
</Col>
</Row>
)
} else if (sender[index] === "") {
return (
{ value }
)
} else {
return ( //내가 보낸 메시지
<Row key={index} className='m-1 justify-content-end'>
......@@ -186,7 +188,7 @@ function Chat(props) {
</Container >
<Form onSubmit={sendMsgCH} fluid>
<Form.Group className='d-flex flex-wrap-nowrap justify-content-center m-3'>
<Form.Control className='border border-warning' name='chat' type="text" value={inner} onChange={handleChange} style={{ width: '85%'}} />
<Form.Control className='border border-warning' name='chat' type="text" value={inner} onChange={handleChange} style={{ width: '85%' }} />
<Button variant="warning" type="submit" disabled={disabled} style={{ width: '10%' }}>
전송
</Button>
......
......@@ -149,7 +149,6 @@ function Home() {
sendInfo: {
msg: sysmsg,
sender: "system",
// time: singleTime
}
})
setSysmsg('')
......
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