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
a25e4ed7
Commit
a25e4ed7
authored
Jun 01, 2022
by
Balasuriya D.A.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Group Modal UI
parent
f4716df8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
3 deletions
+110
-3
IT18021080/Telemedicine-Chat-App/frontend/src/components/SingleChat.js
...lemedicine-Chat-App/frontend/src/components/SingleChat.js
+17
-3
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/GroupChatModal.js
...p/frontend/src/components/miscellaneous/GroupChatModal.js
+1
-0
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/UpdateGroupChatModal.js
...tend/src/components/miscellaneous/UpdateGroupChatModal.js
+92
-0
No files found.
IT18021080/Telemedicine-Chat-App/frontend/src/components/SingleChat.js
View file @
a25e4ed7
...
...
@@ -4,6 +4,7 @@ import { ChatState } from "../Context/ChatProvider";
import
{
ArrowBackIcon
}
from
"
@chakra-ui/icons
"
;
import
{
getSender
,
getSenderFull
}
from
"
../config/ChatLogics
"
;
import
ProfileModal
from
"
./miscellaneous/ProfileModal
"
;
import
UpdateGroupChatModal
from
"
./miscellaneous/UpdateGroupChatModal
"
;
const
SingleChat
=
({
fetchAgain
,
setFetchAgain
})
=>
{
...
...
@@ -37,13 +38,26 @@ const SingleChat = ({ fetchAgain, setFetchAgain }) => {
)
:
(
<>
{
selectedChat
.
chatName
.
toUpperCase
()}
{
/*
<UpdateGroupChatModal
<
UpdateGroupChatModal
fetchAgain
=
{
fetchAgain
}
setFetchAgain={set
SelectedChat
}
/>
*/
}
setFetchAgain
=
{
set
FetchAgain
}
/
>
<
/
>
)}
<
/Text
>
<
Box
display
=
"
flex
"
flexDir
=
"
column
"
justifyContent
=
"
flex-end
"
padding
=
{
3
}
bg
=
"
#E8E8E8
"
//#7CB9E8
width
=
"
100%
"
height
=
"
100%
"
borderRadius
=
"
lg
"
overflowY
=
"
hidden
"
>
{
/* Messages Here */
}
<
/Box
>
<
/
>
)
:
(
<
Box
display
=
"
flex
"
alignItems
=
"
center
"
justifyContent
=
"
center
"
height
=
"
100%
"
>
...
...
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/GroupChatModal.js
View file @
a25e4ed7
...
...
@@ -74,6 +74,7 @@ const GroupChatModal = ({ children }) => {
"
/api/chat/group
"
,
{
name
:
groupChatName
,
users
:
JSON
.
stringify
(
selectedUsers
.
map
((
u
)
=>
u
.
_id
)),
},
config
...
...
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/UpdateGroupChatModal.js
0 → 100644
View file @
a25e4ed7
import
React
,
{
useState
}
from
"
react
"
;
import
{
IconButton
,
useDisclosure
,
Modal
,
ModalOverlay
,
ModalContent
,
ModalHeader
,
ModalCloseButton
,
ModalBody
,
ModalFooter
,
Button
,
useToast
,
Box
,
FormControl
,
Input
}
from
"
@chakra-ui/react
"
;
import
{
ViewIcon
}
from
"
@chakra-ui/icons
"
;
import
{
ChatState
}
from
"
../../Context/ChatProvider
"
;
import
UserBadgeItem
from
"
../UserAvatar/UserBadgeItem
"
;
const
UpdateGroupChatModal
=
({
fetchAgain
,
setFetchAgain
})
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
[
groupChatName
,
setGroupChatName
]
=
useState
();
const
[
search
,
setSearch
]
=
useState
(
""
);
const
[
searchResult
,
setSearchResult
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
renameloading
,
setRenameloading
]
=
useState
(
false
);
const
toast
=
useToast
();
const
{
selectedChat
,
setSelectedChat
,
user
}
=
ChatState
();
const
handleRemove
=
()
=>
{
};
const
handleRename
=
()
=>
{
};
const
handleSearch
=
()
=>
{
};
return
(
<>
<
IconButton
display
=
{{
base
:
"
flex
"
}}
icon
=
{
<
ViewIcon
/>
}
onClick
=
{
onOpen
}
/
>
<
Modal
isOpen
=
{
isOpen
}
onClose
=
{
onClose
}
isCentered
>
<
ModalOverlay
/>
<
ModalContent
>
<
ModalHeader
fontSize
=
"
35px
"
fontFamily
=
"
Work sans
"
display
=
"
flex
"
justifyContent
=
"
center
"
>
{
selectedChat
.
chatName
.
toUpperCase
()}
<
/ModalHeader
>
<
ModalCloseButton
/>
<
ModalBody
>
<
Box
width
=
"
100%
"
display
=
"
flex
"
flexWrap
=
"
wrap
"
pb
=
{
3
}
>
{
selectedChat
.
users
.
map
((
u
)
=>
(
<
UserBadgeItem
key
=
{
user
.
_id
}
user
=
{
u
}
handleFunction
=
{()
=>
handleRemove
(
u
)}
/
>
))}
<
/Box
>
<
FormControl
display
=
"
flex
"
>
<
Input
placeholder
=
"
Organization Name
"
//chat name
mb
=
{
3
}
value
=
{
groupChatName
}
onChange
=
{(
e
)
=>
setGroupChatName
(
e
.
target
.
value
)}
/
>
<
Button
variant
=
"
solid
"
colorScheme
=
"
teal
"
ml
=
{
1
}
isLoading
=
{
renameloading
}
onClick
=
{
handleRename
}
>
Update
<
/Button
>
<
/FormControl
>
<
FormControl
>
<
Input
placeholder
=
"
Add User to Organization
"
mb
=
{
1
}
onChange
=
{(
e
)
=>
handleSearch
(
e
.
target
.
value
)}
/
>
<
/FormControl
>
<
/ModalBody
>
<
ModalFooter
>
<
Button
onClick
=
{()
=>
handleRemove
(
user
)}
colorScheme
=
"
red
"
>
Leave
Group
<
/Button
>
<
/ModalFooter
>
<
/ModalContent
>
<
/Modal
>
<
/
>
);
};
export
default
UpdateGroupChatModal
;
\ No newline at end of file
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