Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
messenger
Commits
3e091bf2
Commit
3e091bf2
authored
Jan 26, 2021
by
Choi Ga Young
Browse files
안내메시지
parent
7a5a52a5
Changes
3
Show whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
3e091bf2
...
...
@@ -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
>
...
...
client/src/Pages/HomePage.js
View file @
3e091bf2
...
...
@@ -149,7 +149,6 @@ function Home() {
sendInfo
:
{
msg
:
sysmsg
,
sender
:
"
system
"
,
// time: singleTime
}
})
setSysmsg
(
''
)
...
...
uploads/19877e6cdeb6d21139ee57df54bc0ddd
0 → 100644
View file @
3e091bf2
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment