diff --git a/cryptide_project/src/App.tsx b/cryptide_project/src/App.tsx index dacb2c0..c61433c 100644 --- a/cryptide_project/src/App.tsx +++ b/cryptide_project/src/App.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { useState } from 'react'; import { IntlProvider } from 'react-intl'; import { GameProvider } from './Contexts/GameContext'; +import { AuthProvider } from './Contexts/AuthContext'; /* Page */ import Home from './Pages/Home'; @@ -63,9 +64,10 @@ function App() { // logo // // + + - - {/*@ts-ignore*/} + {/*@ts-ignore*/} @@ -85,7 +87,7 @@ function App() { - + ); } diff --git a/cryptide_project/src/Components/NavBar.tsx b/cryptide_project/src/Components/NavBar.tsx index f95c155..feb9695 100644 --- a/cryptide_project/src/Components/NavBar.tsx +++ b/cryptide_project/src/Components/NavBar.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, {useEffect, useState} from 'react'; /* Naviagtion */ import { Navbar, Container, Nav, NavDropdown } from 'react-bootstrap'; @@ -7,7 +7,7 @@ import { Navbar, Container, Nav, NavDropdown } from 'react-bootstrap'; import { FormattedMessage } from 'react-intl'; /* Icon */ -import { BiLogInCircle } from 'react-icons/bi'; +import { BiDoorOpen, BiLogInCircle } from 'react-icons/bi'; import { BsFillPersonPlusFill } from 'react-icons/bs'; import { HiLanguage } from 'react-icons/hi2'; @@ -17,16 +17,22 @@ import logo from '../res/img/logo2_preview_rev_1.png'; /* Components */ import ReactCountryFlag from "react-country-flag" +/* Services */ +import SessionService from '../services/SessionService'; +import AuthService from '../services/AuthService'; /* Style */ import './NavBar.css'; /* Style */ import { useTheme } from '../Style/ThemeContext'; +import { useAuth } from '../Contexts/AuthContext'; // @ts-ignore function AppNavbar({changeLocale}) { const theme = useTheme(); + const {isLoggedIn, logout} = useAuth(); + return ( @@ -45,14 +51,26 @@ function AppNavbar({changeLocale}) {