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
60db2082
Commit
60db2082
authored
Jan 28, 2021
by
우지원
Browse files
chat
parent
36940a82
Changes
1
Show whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
60db2082
...
@@ -142,7 +142,7 @@ function Chat(props) {
...
@@ -142,7 +142,7 @@ function Chat(props) {
<
a
href
=
"
#;
"
onClick
=
{()
=>
setExit
(
!
exit
)}
><
BsX
size
=
"
1em
"
color
=
"
#F2D788
"
/><
/a
>
<
a
href
=
"
#;
"
onClick
=
{()
=>
setExit
(
!
exit
)}
><
BsX
size
=
"
1em
"
color
=
"
#F2D788
"
/><
/a
>
<
/div
>
<
/div
>
:
null
}
:
null
}
<
div
id
=
"
chat-body
"
style
=
{{
overflow
:
'
auto
'
,
paddingRight
:
'
15px
'
,
width
:
"
100%
"
,
height
:
"
400px
"
,
background
:
''
}}
>
<
div
id
=
"
chat-body
"
style
=
{{
overflow
:
'
auto
'
,
paddingRight
:
'
15px
'
,
width
:
"
100%
"
,
height
:
"
400px
"
,
margin
:
"
1%
"
,
background
:
''
}}
>
{
chat
.
map
((
value
,
index
)
=>
{
{
chat
.
map
((
value
,
index
)
=>
{
if
(
!
(
value
.
msg
===
''
))
{
if
(
!
(
value
.
msg
===
''
))
{
if
(
value
.
sender
===
"
system
"
)
{
if
(
value
.
sender
===
"
system
"
)
{
...
@@ -153,25 +153,25 @@ function Chat(props) {
...
@@ -153,25 +153,25 @@ function Chat(props) {
)
)
}
else
if
(
!
(
value
.
sender
===
user
.
nickname
))
{
}
else
if
(
!
(
value
.
sender
===
user
.
nickname
))
{
return
(
return
(
<
Row
key
=
{
index
}
className
=
'
d-flex flex-wrap-nowrap mt-2
'
style
=
{{
width
:
"
100%
"
}}
>
<
Row
key
=
{
index
}
className
=
'
d-flex flex-wrap-nowrap mt-2
'
style
=
{{
width
:
"
95%
"
,
maxWidth
:
'
95%
'
}}
>
<
Col
xs
=
"
auto
"
>
<
Col
xs
=
"
auto
"
>
<
Image
src
=
{
value
.
img
&&
`/images/
${
value
.
img
}
`
}
style
=
{{
width
:
"
55px
"
,
height
:
"
55px
"
}}
roundedCircle
/>
<
Image
src
=
{
value
.
img
&&
`/images/
${
value
.
img
}
`
}
style
=
{{
width
:
"
55px
"
,
height
:
"
55px
"
}}
roundedCircle
/>
<
/Col
>
<
/Col
>
<
Col
className
=
"
ml-2
ㄱ
"
>
<
Col
className
=
"
ml-2
"
>
<
Row
><
strong
>
{
value
.
sender
}
<
/strong></
Row
>
<
Row
><
strong
>
{
value
.
sender
}
<
/strong></
Row
>
<
Row
className
=
'
d-flex flex-wrap-nowrap
'
>
<
Row
xs
=
"
auto
"
className
=
'
d-flex flex-wrap-nowrap
'
>
<
Col
style
=
{{
width
:
'
max-content
'
,
maxWidth
:
'
300px
'
,
height
:
'
auto
'
,
paddingLeft
:
'
15px
'
,
paddingRight
:
'
15px
'
,
background
:
'
#f1ebf7
'
,
borderRadius
:
'
5px
'
,
fontSize
:
'
x-large
'
}}
>
{
value
.
msg
}
<
/
Col
>
<
Row
style
=
{{
width
:
'
max-content
'
,
maxWidth
:
'
80%
'
,
height
:
'
auto
'
,
paddingLeft
:
'
15px
'
,
paddingRight
:
'
15px
'
,
background
:
'
#f1ebf7
'
,
borderRadius
:
'
5px
'
,
fontSize
:
'
x-large
'
}}
>
{
value
.
msg
}
<
/
Row
>
<
Col
xs
=
"
auto
"
>
{
value
.
time
}
<
/Col
>
<
Col
className
=
"
ml-1
"
>
{
value
.
time
}
<
/Col
>
<
/Row
>
<
/Row
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
)
)
}
else
{
}
else
{
return
(
//내가 보낸 메시지
return
(
//내가 보낸 메시지
<
Row
key
=
{
index
}
className
=
'
mt-2 justify-content-end
'
style
=
{{
width
:
"
100%
"
}}
>
<
Row
key
=
{
index
}
className
=
'
mt-2 justify-content-end
'
style
=
{{
width
:
"
100%
"
}}
>
<
Row
className
=
'
d-flex flex-wrap-nowrap
'
>
<
Row
className
=
'
d-flex flex-wrap-nowrap
'
>
<
Col
xs
=
"
auto
"
className
=
"
ml-3
"
>
{
value
.
time
}
<
/Col
>
<
Col
xs
=
"
auto
"
className
=
"
ml-3
"
>
{
value
.
time
}
<
/Col
>
<
Col
className
=
'
mr-
3
'
name
=
'
msg
'
style
=
{{
width
:
'
max-content
'
,
maxWidth
:
'
300px
'
,
height
:
'
auto
'
,
paddingLeft
:
'
15px
'
,
paddingRight
:
'
15px
'
,
background
:
"
#d6c8e3
"
,
borderRadius
:
'
5px
'
,
fontSize
:
'
x-large
'
}}
>
{
value
.
msg
}
<
/Col
>
<
Col
className
=
'
mr-
1
'
name
=
'
msg
'
style
=
{{
width
:
'
max-content
'
,
maxWidth
:
'
300px
'
,
height
:
'
auto
'
,
paddingLeft
:
'
15px
'
,
paddingRight
:
'
15px
'
,
background
:
"
#d6c8e3
"
,
borderRadius
:
'
5px
'
,
fontSize
:
'
x-large
'
}}
>
{
value
.
msg
}
<
/Col
>
<
/Row
>
<
/Row
>
<
/Row
>
<
/Row
>
)
)
...
...
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