diff --git a/src/components/flags/FlagsApi.js b/src/components/flags/FlagsApi.js
index 3b769d6..056a9b7 100644
--- a/src/components/flags/FlagsApi.js
+++ b/src/components/flags/FlagsApi.js
@@ -320,11 +320,11 @@ class FlagsApi extends React.Component {
+
-
@@ -333,12 +333,13 @@ class FlagsApi extends React.Component {
redirect = () => {
this.gameOver();
this.props.dispatch({type : 'reset'});
- this.props.history.push('/main');
+ this.props.history.push('/');
}
- redirectToProfile = () => {
+ exitGame = () => {
this.gameOver();
- this.props.history.push('/profile');
+ this.props.dispatch({type : 'reset'});
+ this.props.history.push('/');
}
}
diff --git a/src/components/flags/Profile.js b/src/components/flags/Profile.js
index 4d825bc..d6e21d2 100644
--- a/src/components/flags/Profile.js
+++ b/src/components/flags/Profile.js
@@ -8,8 +8,10 @@ import ListGroupItem from "react-bootstrap/ListGroupItem";
import Tab from "react-bootstrap/Tab";
import Tabs from "react-bootstrap/Tabs";
import Alert from "react-bootstrap/Alert";
+import { useHistory } from 'react-router-dom';
const Profile = () => {
+ const history = useHistory();
const [key, setKey] = useState('learn');
const [user, setUser] = useState(null);
const [statsData, setStatsData] = useState([]);
@@ -90,10 +92,30 @@ const Profile = () => {
);
+ const handleClose = () => {
+ history.push('/');
+ };
+
return (
-
+
+
{
🏁 Flags Quiz
Test your geography knowledge and compete for the top spot!
{isLoggedIn ? (
-
+ <>
+
+ {' '}
+
+ >
) : (