Add verified badge and page on the front
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import API from '../API';
|
||||
import { Text } from 'native-base';
|
||||
import { useNavigation } from '../Navigation';
|
||||
import { useRoute } from '@react-navigation/native';
|
||||
|
||||
const VerifiedView = () => {
|
||||
const navigation = useNavigation();
|
||||
const route = useRoute();
|
||||
const [failed, setFailed] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
async function run() {
|
||||
try {
|
||||
await API.fetch({
|
||||
route: `/auth/verify?token=${(route.params as any).token}`,
|
||||
method: 'PUT',
|
||||
});
|
||||
navigation.navigate('Home');
|
||||
} catch {
|
||||
setFailed(true);
|
||||
}
|
||||
}
|
||||
run();
|
||||
}, []);
|
||||
|
||||
return failed ? (
|
||||
<Text>Email verification failed. The token has expired or is invalid.</Text>
|
||||
) : (
|
||||
<Text>Loading please wait</Text>
|
||||
);
|
||||
};
|
||||
|
||||
export default VerifiedView;
|
||||
Reference in New Issue
Block a user