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
8af1e1fa
Commit
8af1e1fa
authored
May 08, 2022
by
Balasuriya D.A.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chats Page Side Drawer Frontend 1st step
parent
9c42371e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
34 deletions
+62
-34
IT18021080/Telemedicine-Chat-App/frontend/src/Pages/ChatPage.js
...1080/Telemedicine-Chat-App/frontend/src/Pages/ChatPage.js
+24
-23
IT18021080/Telemedicine-Chat-App/frontend/src/Pages/Homepage.js
...1080/Telemedicine-Chat-App/frontend/src/Pages/Homepage.js
+11
-11
IT18021080/Telemedicine-Chat-App/frontend/src/components/ChatBox.js
.../Telemedicine-Chat-App/frontend/src/components/ChatBox.js
+9
-0
IT18021080/Telemedicine-Chat-App/frontend/src/components/MyChats.js
.../Telemedicine-Chat-App/frontend/src/components/MyChats.js
+9
-0
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/SideDrawer.js
...t-App/frontend/src/components/miscellaneous/SideDrawer.js
+9
-0
No files found.
IT18021080/Telemedicine-Chat-App/frontend/src/Pages/ChatPage.js
View file @
8af1e1fa
import
React
from
"
react
"
;
import
axios
from
"
axios
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Box
}
from
"
@chakra-ui/react
"
;
import
{
ChatState
}
from
"
../Context/ChatProvider
"
;
import
SideDrawer
from
"
../components/miscellaneous/SideDrawer
"
;
import
MyChats
from
"
../components/MyChats
"
;
import
ChatBox
from
"
../components/ChatBox
"
;
const
ChatPage
=
()
=>
{
const
[
chats
,
setsChats
]
=
useState
([])
const
fetchChats
=
async
()
=>
{
const
{
data
}
=
await
axios
.
get
(
"
/api/chat
"
);
setsChats
(
data
);
};
useEffect
(()
=>
{
fetchChats
();
},
[]);
const
{
user
}
=
ChatState
();
return
(
<
div
style
=
{{
width
:
"
100%
"
}}
>
{
user
&&
<
SideDrawer
/>
}
<
Box
d
=
"
flex
"
justifyContent
=
"
space-between
"
w
=
"
100%
"
h
=
"
91.5vh
"
p
=
"
10px
"
>
{
user
&&
<
MyChats
/>
}
{
user
&&
<
ChatBox
/>
}
return
(
<
div
>
{
chats
.
map
((
chat
)
=>
(
<
div
key
=
{
chat
.
_id
}
>
{
chat
.
chatName
}
<
/div>
))
}
<
/Box
>
<
/div
>
);
}
export
default
ChatPage
\ No newline at end of file
};
export
default
ChatPage
;
\ No newline at end of file
IT18021080/Telemedicine-Chat-App/frontend/src/Pages/Homepage.js
View file @
8af1e1fa
...
...
@@ -21,7 +21,7 @@ const Homepage = () => {
useEffect
(()
=>
{
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
"
userInfo
"
));
//check if user is loged in
//check if user is loged in
push back to the chat page
if
(
user
)
history
.
push
(
"
/chats
"
);
...
...
@@ -68,6 +68,6 @@ const Homepage = () => {
<
/Box
>
<
/Container
>
);
}
}
;
export
default
Homepage
;
\ No newline at end of file
IT18021080/Telemedicine-Chat-App/frontend/src/components/ChatBox.js
0 → 100644
View file @
8af1e1fa
import
React
from
"
react
"
;
const
ChatBox
=
()
=>
{
return
(
<
div
>
ChatBox
<
/div
>
);
};
export
default
ChatBox
;
\ No newline at end of file
IT18021080/Telemedicine-Chat-App/frontend/src/components/MyChats.js
0 → 100644
View file @
8af1e1fa
import
React
from
"
react
"
;
const
MyChats
=
()
=>
{
return
(
<
div
>
MyChats
<
/div
>
);
};
export
default
MyChats
;
\ No newline at end of file
IT18021080/Telemedicine-Chat-App/frontend/src/components/miscellaneous/SideDrawer.js
0 → 100644
View file @
8af1e1fa
import
React
from
"
react
"
;
const
SideDrawer
=
()
=>
{
return
(
<
div
>
SideDrawer
<
/div
>
);
};
export
default
SideDrawer
;
\ 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