@@ -4,8 +4,11 @@ import {
4
4
Box ,
5
5
Grid ,
6
6
IconButton ,
7
+ Tooltip ,
7
8
Typography ,
8
9
} from "../../../node_modules/@mui/material/index" ;
10
+ import LogoutImg from "../../assets/images/logout.svg" ;
11
+ import { styled } from "@mui/material/styles" ;
9
12
import {
10
13
RoundTick ,
11
14
SelectLanguageButton ,
@@ -41,6 +44,7 @@ import panda from "../../assets/images/panda.svg";
41
44
import cryPanda from "../../assets/images/cryPanda.svg" ;
42
45
import { uniqueId } from "../../services/utilService" ;
43
46
import CircularProgressOverlay from "../CommonComponent/CircularProgressOverlay" ;
47
+ import { end } from "../../services/telementryService" ;
44
48
45
49
export const LanguageModal = ( {
46
50
lang,
@@ -513,6 +517,38 @@ export const ProfileHeader = ({
513
517
514
518
const displayLanguage = selectedLanguage ?. name || "Select Language" ;
515
519
520
+ const handleLogout = ( ) => {
521
+ localStorage . clear ( ) ;
522
+ end ( { } ) ;
523
+ navigate ( "/Login" ) ;
524
+ } ;
525
+
526
+ const CustomIconButton = styled ( IconButton ) ( {
527
+ padding : "6px 20px" ,
528
+ color : "white" ,
529
+ fontSize : "20px" ,
530
+ fontWeight : 500 ,
531
+ borderRadius : "8px" ,
532
+ marginRight : "10px" ,
533
+ fontFamily : '"Lato", "sans-serif"' ,
534
+ position : "relative" ,
535
+ display : "flex" ,
536
+ alignItems : "center" ,
537
+ justifyContent : "center" ,
538
+ "& .logout-img" : {
539
+ display : "block" ,
540
+ filter : "invert(1)" ,
541
+ } ,
542
+ } ) ;
543
+
544
+ const CustomTooltip = styled ( ( { className, ...props } ) => (
545
+ < Tooltip { ...props } classes = { { popper : className } } />
546
+ ) ) ( {
547
+ [ `& .MuiTooltip-tooltip` ] : {
548
+ fontSize : "1.2rem" , // Adjust the font size as needed
549
+ } ,
550
+ } ) ;
551
+
516
552
return (
517
553
< >
518
554
{ ! ! openMessageDialog && (
@@ -645,6 +681,20 @@ export const ProfileHeader = ({
645
681
</ Box >
646
682
</ Box >
647
683
</ Box >
684
+ { process . env . REACT_APP_IS_IN_APP_AUTHORISATION === "true" && (
685
+ < CustomTooltip title = "Logout" >
686
+ < Box >
687
+ < CustomIconButton onClick = { handleLogout } >
688
+ < img
689
+ className = "logout-img"
690
+ style = { { height : 30 , width : 35 } }
691
+ src = { LogoutImg }
692
+ alt = "Logout"
693
+ />
694
+ </ CustomIconButton >
695
+ </ Box >
696
+ </ CustomTooltip >
697
+ ) }
648
698
</ Box >
649
699
</ Box >
650
700
</ >
0 commit comments