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
9f40704e
Commit
9f40704e
authored
Apr 28, 2022
by
Balasuriya D.A.M.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Profile Picture Upload (Cloudianry)
parent
dcd5e09b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
5 deletions
+53
-5
IT18021080/Telemedicine-Chat-App/frontend/src/components/Authentication/Login.js
...-Chat-App/frontend/src/components/Authentication/Login.js
+1
-1
IT18021080/Telemedicine-Chat-App/frontend/src/components/Authentication/Signup.js
...Chat-App/frontend/src/components/Authentication/Signup.js
+52
-4
No files found.
IT18021080/Telemedicine-Chat-App/frontend/src/components/Authentication/Login.js
View file @
9f40704e
IT18021080/Telemedicine-Chat-App/frontend/src/components/Authentication/Signup.js
View file @
9f40704e
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
{
Button
,
FormControl
,
FormLabel
,
Input
,
InputGroup
,
InputRightElement
,
VStack
}
from
"
@chakra-ui/react
"
;
import
{
Button
,
FormControl
,
FormLabel
,
Input
,
InputGroup
,
InputRightElement
,
VStack
}
from
"
@chakra-ui/react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
useToast
}
from
"
@chakra-ui/react
"
;
const
Signup
=
()
=>
{
const
Signup
=
()
=>
{
...
@@ -14,12 +15,58 @@ const Signup = () => {
...
@@ -14,12 +15,58 @@ const Signup = () => {
const
[
confirmpassword
,
setConfirmpassword
]
=
useState
();
const
[
confirmpassword
,
setConfirmpassword
]
=
useState
();
const
[
password
,
setPassword
]
=
useState
();
const
[
password
,
setPassword
]
=
useState
();
const
[
pic
,
setPic
]
=
useState
();
const
[
pic
,
setPic
]
=
useState
();
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
toast
=
useToast
();
const
handleClick
=
()
=>
setShow
(
!
show
);
const
handleClick
=
()
=>
setShow
(
!
show
);
const
postDetails
=
(
pics
)
=>
{
};
const
postDetails
=
(
pics
)
=>
{
setLoading
(
true
);
const
submitHandler
=
()
=>
{
};
if
(
pics
===
undefined
)
{
toast
({
title
:
"
Please Select an Image!
"
,
status
:
"
warning
"
,
duration
:
5000
,
//How long message is displaying
isClosable
:
true
,
position
:
"
bottom
"
,
});
return
;
}
if
(
pics
.
type
===
"
image/jpeg
"
||
pics
.
type
===
"
image/png
"
)
{
const
data
=
new
FormData
();
data
.
append
(
"
file
"
,
pics
);
data
.
append
(
"
upload_preset
"
,
"
chat-app
"
);
data
.
append
(
"
cloud_name
"
,
"
minocode
"
);
//fetch("const data = new FormData();");
fetch
(
"
https://api.cloudinary.com/v1_1/minocode/image/upload
"
,
{
method
:
"
post
"
,
body
:
data
,
}).
then
((
res
)
=>
res
.
json
())
.
then
(
data
=>
{
setPic
(
data
.
url
.
toString
());
setLoading
(
false
);
})
.
catch
((
err
)
=>
{
console
.
log
(
err
);
setLoading
(
false
);
});
}
else
{
toast
({
title
:
"
Please Select an Image!
"
,
status
:
"
warning
"
,
duration
:
5000
,
isClosable
:
true
,
position
:
"
bottom
"
,
});
setLoading
(
false
);
return
;
}
};
const
submitHandler
=
()
=>
{
};
return
(
return
(
//Use vstack to allign verticaly
//Use vstack to allign verticaly
...
@@ -97,6 +144,7 @@ const Signup = () => {
...
@@ -97,6 +144,7 @@ const Signup = () => {
width
=
"
100%
"
width
=
"
100%
"
style
=
{{
marginTop
:
15
}}
style
=
{{
marginTop
:
15
}}
onClick
=
{
submitHandler
}
onClick
=
{
submitHandler
}
isLoading
=
{
loading
}
>
>
Sign
Up
Sign
Up
...
...
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