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
Hide 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
{
Box
}
from
"
@chakra-ui/react
"
;
import
axios
from
"
axios
"
;
import
{
ChatState
}
from
"
../Context/ChatProvider
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
SideDrawer
from
"
../components/miscellaneous/SideDrawer
"
;
import
MyChats
from
"
../components/MyChats
"
;
import
ChatBox
from
"
../components/ChatBox
"
;
const
ChatPage
=
()
=>
{
const
ChatPage
=
()
=>
{
const
[
chats
,
setsChats
]
=
useState
([])
const
fetchChats
=
async
()
=>
{
const
{
data
}
=
await
axios
.
get
(
"
/api/chat
"
);
setsChats
(
data
);
};
useEffect
(()
=>
{
fetchChats
();
},
[]);
const
{
user
}
=
ChatState
();
return
(
return
(
<
div
>
<
div
style
=
{{
width
:
"
100%
"
}}
>
{
chats
.
map
((
chat
)
=>
(
{
user
&&
<
SideDrawer
/>
}
<
div
key
=
{
chat
.
_id
}
>
{
chat
.
chatName
}
<
/div>
))
}
<
Box
d
=
"
flex
"
justifyContent
=
"
space-between
"
w
=
"
100%
"
h
=
"
91.5vh
"
p
=
"
10px
"
>
{
user
&&
<
MyChats
/>
}
{
user
&&
<
ChatBox
/>
}
<
/Box
>
<
/div
>
<
/div
>
);
);
}
};
export
default
ChatPage
export
default
ChatPage
;
\ No newline at end of file
\ No newline at end of file
IT18021080/Telemedicine-Chat-App/frontend/src/Pages/Homepage.js
View file @
8af1e1fa
...
@@ -18,10 +18,10 @@ const Homepage = () => {
...
@@ -18,10 +18,10 @@ const Homepage = () => {
const
history
=
useHistory
();
const
history
=
useHistory
();
useEffect
(()
=>
{
useEffect
(()
=>
{
const
user
=
JSON
.
parse
(
localStorage
.
getItem
(
"
userInfo
"
));
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
"
);
if
(
user
)
history
.
push
(
"
/chats
"
);
...
@@ -51,23 +51,23 @@ const Homepage = () => {
...
@@ -51,23 +51,23 @@ const Homepage = () => {
borderWidth
=
"
1px
"
borderWidth
=
"
1px
"
>
>
<
Tabs
variant
=
'
soft-rounded
'
colorScheme
=
'
green
'
>
<
Tabs
variant
=
'
soft-rounded
'
colorScheme
=
'
green
'
>
<
TabList
mb
=
"
1em
"
>
<
TabList
mb
=
"
1em
"
>
<
Tab
width
=
"
50%
"
>
Login
<
/Tab
>
<
Tab
width
=
"
50%
"
>
Login
<
/Tab
>
<
Tab
width
=
"
50%
"
>
Sign
Up
<
/Tab
>
<
Tab
width
=
"
50%
"
>
Sign
Up
<
/Tab
>
<
/TabList
>
<
/TabList
>
<
TabPanels
>
<
TabPanels
>
<
TabPanel
>
<
TabPanel
>
<
Login
/>
<
Login
/>
<
/TabPanel
>
<
/TabPanel
>
<
TabPanel
>
<
TabPanel
>
<
Signup
/>
<
Signup
/>
<
/TabPanel
>
<
/TabPanel
>
<
/TabPanels
>
<
/TabPanels
>
<
/Tabs
>
<
/Tabs
>
<
/Box
>
<
/Box
>
<
/Container
>
<
/Container
>
);
);
}
}
;
export
default
Homepage
;
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