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
650999ad
Commit
650999ad
authored
Jan 26, 2021
by
Soo Hyun Kim
Browse files
0126수현
parent
dc646958
Changes
3
Show whitespace changes
Inline
Side-by-side
client/src/Components/Chat.js
View file @
650999ad
...
...
@@ -94,13 +94,13 @@ function Chat(props) {
<
Row
>
{
props
.
roomCode
}
<
/Row
>
<
/Col
>
<
Col
md
=
"
auto
"
>
<
Button
variant
=
"
light
"
onClick
=
{()
=>
setExit
(
true
)}
>
{
'
=
'
}
<
/Button
>
<
Button
variant
=
"
light
"
onClick
=
{()
=>
setExit
(
!
exit
)}
>
{
'
=
'
}
<
/Button
>
<
/Col
>
<
/Row
>
{
exit
?
<
Row
>
<
Col
>
퇴장하시겠습니까
?
<
/Col
>
<
Col
md
=
"
auto
"
><
Button
variant
=
"
light
"
onClick
=
{
exitAndCloseRoom
}
>
{
"
나가기
"
}
<
/Button></
Col
>
<
Row
style
=
{{
margin
:
"
1%
"
,
backgroundColor
:
"
#F8F9FA
"
,
borderRadius
:
"
30px
"
,
height
:
"
50px
"
}}
>
<
Col
style
=
{{
fontWeight
:
"
bold
"
,
margin
:
"
1%
"
}}
>
퇴장하시겠습니까
?
<
/Col
>
<
Col
md
=
"
auto
"
><
Button
variant
=
"
light
"
onClick
=
{
exitAndCloseRoom
}
style
=
{{
fontWeight
:
"
bold
"
}}
>
{
"
나가기
"
}
<
/Button></
Col
>
<
/Row
>
:
null
}
<
p
>
{
props
.
newUser
}
님이
입장하셨습니다
.
<
/p
>
...
...
client/src/Components/ClosedList.js
View file @
650999ad
...
...
@@ -30,7 +30,7 @@ function ClosedList(props) {
return
(
<
div
>
{
list
.
map
((
item
,
index
)
=>
<
ListGroup
key
=
{
index
}
>
<
ListGroup
key
=
{
index
}
>
<
ListGroup
.
Item
action
onClick
=
{
enterChatRoomCH
}
name
=
{
item
.
roomId
}
value
=
{
item
.
roomName
}
>
{
item
.
roomName
}
<
/ListGroup.Item
>
...
...
client/src/Pages/HomePage.js
View file @
650999ad
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Row
,
Col
,
Button
}
from
'
react-bootstrap
'
;
import
{
Row
,
Col
,
Button
,
Navbar
,
Nav
}
from
'
react-bootstrap
'
;
import
Tabs
from
'
react-bootstrap/Tabs
'
;
import
Tab
from
'
react-bootstrap/Tab
'
;
import
ClosedList
from
'
../Components/ClosedList
'
;
...
...
@@ -105,7 +105,7 @@ function Home() {
useEffect
(()
=>
{
if
(
!
(
singleChat
==
""
)){
if
(
!
(
singleChat
==
""
))
{
socket
.
emit
(
"
chat
"
,
{
roomInfo
:
roomCode
,
sendInfo
:
{
...
...
@@ -133,14 +133,22 @@ function Home() {
<
Menu
/>
<
Row
className
=
"
mr-0
"
>
<
Col
className
=
"
list
"
md
=
{
5
}
>
{
/* <Navbar>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse>
<Nav> */
}
<
Tabs
defaultActiveKey
=
"
closed
"
id
=
"
uncontrolled-tab-example
"
>
<
Tab
eventKey
=
"
closed
"
title
=
"
내 채팅
"
onClick
=
{
handleChato
}
>
<
ClosedList
enterChatRoom
=
{
enterChatRoom
}
setRoomCode
=
{
setRoomCode
}
setRoomName
=
{
setRoomName
}
roomCode
=
{
roomCode
}
closeChatRoom
=
{
closeChatRoom
}
/
>
<
ClosedList
enterChatRoom
=
{
enterChatRoom
}
setRoomCode
=
{
setRoomCode
}
setRoomName
=
{
setRoomName
}
roomCode
=
{
roomCode
}
closeChatRoom
=
{
closeChatRoom
}
/
>
<
/Tab
>
<
Tab
eventKey
=
"
open
"
title
=
"
공개방
"
onClick
=
{
handleChatc
}
>
<
OpenList
enterChatRoom
=
{
enterChatRoom
}
openListroom
=
{
openListroom
}
setRoomCode
=
{
setRoomCode
}
setRoomName
=
{
setRoomName
}
roomCode
=
{
roomCode
}
closeChatRoom
=
{
closeChatRoom
}
/
>
<
OpenList
enterChatRoom
=
{
enterChatRoom
}
openListroom
=
{
openListroom
}
setRoomCode
=
{
setRoomCode
}
setRoomName
=
{
setRoomName
}
roomCode
=
{
roomCode
}
closeChatRoom
=
{
closeChatRoom
}
/
>
<
/Tab
>
<
/Tabs
>
{
/* </Nav>
</Navbar.Collapse>
</Navbar> */
}
<
/Col
>
<
Col
style
=
{{
padding
:
"
0
"
}}
>
<>
...
...
@@ -152,7 +160,7 @@ function Home() {
<
/div
>
}
{
chat
?
<
Chat
handleChatc
=
{
handleChatc
}
sendMsg
=
{
sendMsg
}
singleChat
=
{
singleChat
}
singleUser
=
{
singleUser
}
singleImg
=
{
singleImg
}
recievedMsg
=
{
recievedMsg
}
recievedUser
=
{
recievedUser
}
recievedImg
=
{
recievedImg
}
setSingleChat
=
{
setSingleChat
}
setRecievedMsg
=
{
setRecievedMsg
}
setSingleUser
=
{
setSingleUser
}
setSingleImg
=
{
setSingleImg
}
roomCode
=
{
roomCode
}
roomName
=
{
roomName
}
closeChatRoom
=
{
closeChatRoom
}
exitRoom
=
{
exitRoom
}
/
>
<
Chat
handleChatc
=
{
handleChatc
}
sendMsg
=
{
sendMsg
}
singleChat
=
{
singleChat
}
singleUser
=
{
singleUser
}
singleImg
=
{
singleImg
}
recievedMsg
=
{
recievedMsg
}
recievedUser
=
{
recievedUser
}
recievedImg
=
{
recievedImg
}
setSingleChat
=
{
setSingleChat
}
setRecievedMsg
=
{
setRecievedMsg
}
setSingleUser
=
{
setSingleUser
}
setSingleImg
=
{
setSingleImg
}
roomCode
=
{
roomCode
}
roomName
=
{
roomName
}
closeChatRoom
=
{
closeChatRoom
}
exitRoom
=
{
exitRoom
}
/
>
:
null
}
{
open
?
<
div
className
=
"
vh-90 flex-column align-items-center justify-content-center mt-2
"
variant
=
"
dark
"
>
...
...
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