-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from Rubix982/verification-feature
Verification feature
- Loading branch information
Showing
18 changed files
with
232 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import { useParams } from 'react-router-dom'; | ||
import { CenterAlign } from '../FlexAlignment'; | ||
import Logo from '../../assets/img/icon/Logo.svg'; | ||
import ComponentStyling from '../../style/Error/MainContent.module.css'; | ||
import { verifyUser } from '../../services/verify'; | ||
|
||
const MainContent = () => { | ||
const { hash } = useParams(); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(async () => { | ||
try { | ||
const status = await verifyUser(hash); | ||
setLoading(!status); | ||
} catch (error) { | ||
alert(error.message); | ||
} | ||
}, []) | ||
|
||
if(loading) { | ||
return ( | ||
<> | ||
</> | ||
) | ||
} | ||
|
||
return ( | ||
<div className={ComponentStyling.container}> | ||
<div className={ComponentStyling.content}> | ||
<CenterAlign> | ||
<div className={ComponentStyling.logo}> | ||
<img src={Logo} alt="" /> | ||
</div> | ||
</CenterAlign> | ||
<div className={ComponentStyling.title}> | ||
<div className={ComponentStyling.heading}> | ||
<h1> | ||
<a href="/">Terrabuzz</a> | ||
</h1> | ||
</div> | ||
<div className={ComponentStyling.description}> | ||
<p> | ||
Your account is succesfully verified. Please Login to use Terrabuzz. | ||
<br /> | ||
<a className={ComponentStyling.textStyling} href="/login"> | ||
Login | ||
</a> | ||
<a className={ComponentStyling.textStyling} href="/register"> | ||
Register | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
; | ||
</div> | ||
); | ||
}; | ||
|
||
export default MainContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import MainContent from '../components/Verify/MainContent'; | ||
|
||
const Verify = () => <MainContent />; | ||
|
||
export default Verify; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import API from '../API/API'; | ||
|
||
export const verifyUser = async (__hash) => { | ||
try { | ||
const { status } = await API.postRequest(`${process.env.REACT_APP_API_URL}/verify`, | ||
{ hash: __hash } | ||
); | ||
return (status); | ||
} catch (error) { | ||
throw new Error(error.message); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
550b15f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: