Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I_Helmet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 62
I_Helmet
Commits
47d2ae3e
Commit
47d2ae3e
authored
Jun 06, 2022
by
Balasuriya D.A.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send Message UI
parent
a0d39bde
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
IT18021080/Telemedicine-Chat-App/frontend/src/components/SingleChat.js
...lemedicine-Chat-App/frontend/src/components/SingleChat.js
+30
-3
No files found.
IT18021080/Telemedicine-Chat-App/frontend/src/components/SingleChat.js
View file @
47d2ae3e
import
{
Box
,
IconButton
,
Text
}
from
"
@chakra-ui/react
"
;
import
{
Box
,
FormControl
,
IconButton
,
Input
,
Spinner
,
Text
}
from
"
@chakra-ui/react
"
;
import
React
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
ChatState
}
from
"
../Context/ChatProvider
"
;
import
{
ChatState
}
from
"
../Context/ChatProvider
"
;
import
{
ArrowBackIcon
}
from
"
@chakra-ui/icons
"
;
import
{
ArrowBackIcon
}
from
"
@chakra-ui/icons
"
;
import
{
getSender
,
getSenderFull
}
from
"
../config/ChatLogics
"
;
import
{
getSender
,
getSenderFull
}
from
"
../config/ChatLogics
"
;
...
@@ -9,8 +9,15 @@ import UpdateGroupChatModal from "./miscellaneous/UpdateGroupChatModal";
...
@@ -9,8 +9,15 @@ import UpdateGroupChatModal from "./miscellaneous/UpdateGroupChatModal";
const
SingleChat
=
({
fetchAgain
,
setFetchAgain
})
=>
{
const
SingleChat
=
({
fetchAgain
,
setFetchAgain
})
=>
{
const
[
messages
,
setMessages
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
newMessage
,
setNewMessage
]
=
useState
();
const
{
user
,
selectedChat
,
setSelectedChat
}
=
ChatState
();
const
{
user
,
selectedChat
,
setSelectedChat
}
=
ChatState
();
const
sendMessage
=
()
=>
{
};
const
typingHandler
=
()
=>
{
};
return
(
return
(
<>
<>
{
selectedChat
?
(
{
selectedChat
?
(
...
@@ -56,7 +63,27 @@ const SingleChat = ({ fetchAgain, setFetchAgain }) => {
...
@@ -56,7 +63,27 @@ const SingleChat = ({ fetchAgain, setFetchAgain }) => {
borderRadius
=
"
lg
"
borderRadius
=
"
lg
"
overflowY
=
"
hidden
"
overflowY
=
"
hidden
"
>
>
{
/* Messages Here */
}
{
loading
?
(
<
Spinner
size
=
"
xl
"
w
=
{
20
}
h
=
{
20
}
alignSelf
=
"
center
"
margin
=
"
auto
"
/>
)
:
(
<
div
>
{
/* Messages */
}
<
/div
>
)}
<
FormControl
onKeyDown
=
{
sendMessage
}
isRequired
mt
=
{
3
}
>
<
Input
variant
=
"
filled
"
bg
=
"
E0E0E0
"
placeholder
=
"
Enter a message..
"
onChange
=
{
typingHandler
}
value
=
{
newMessage
}
/
>
<
/FormControl
>
<
/Box
>
<
/Box
>
<
/
>
<
/
>
)
:
(
)
:
(
...
...
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