Add verified badge and page on the front

This commit is contained in:
2023-09-13 17:25:01 +02:00
parent 3b2ca9963b
commit 5c83235cba
7 changed files with 100 additions and 17 deletions
+35
View File
@@ -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;