Remove "Sign in" button from header
Some checks failed
Running Code Coverage / build (16.x) (push) Failing after 18s
Some checks failed
Running Code Coverage / build (16.x) (push) Failing after 18s
Because we don't have a login page
This commit is contained in:
parent
6b7cecd27b
commit
d5cdf50dbd
@ -2,12 +2,9 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
import { isAuthenticated, isAuthenticationEnabled, logoutUser } from '../../utilities/authUtilities';
|
|
||||||
|
|
||||||
// components
|
// components
|
||||||
import { AppBar, Toolbar, Grid, Button } from '@mui/material';
|
import { AppBar, Toolbar, Grid } from '@mui/material';
|
||||||
import SearchSuggestion from './SearchSuggestion';
|
import SearchSuggestion from './SearchSuggestion';
|
||||||
import UserAccountMenu from './UserAccountMenu';
|
|
||||||
// styling
|
// styling
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
import makeStyles from '@mui/styles/makeStyles';
|
||||||
import logo from '!file-loader!../../assets/Alt_Linux_Team.svg';
|
import logo from '!file-loader!../../assets/Alt_Linux_Team.svg';
|
||||||
@ -137,10 +134,6 @@ function Header({ setSearchCurrentValue = () => {} }) {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const path = useLocation().pathname;
|
const path = useLocation().pathname;
|
||||||
|
|
||||||
const handleSignInClick = () => {
|
|
||||||
logoutUser();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppBar position={show ? 'fixed' : 'absolute'} sx={{ height: '5rem' }}>
|
<AppBar position={show ? 'fixed' : 'absolute'} sx={{ height: '5rem' }}>
|
||||||
<Toolbar className={classes.header}>
|
<Toolbar className={classes.header}>
|
||||||
@ -179,18 +172,6 @@ function Header({ setSearchCurrentValue = () => {} }) {
|
|||||||
<img alt="github repository" src={githubLogo} className={classes.ghlogo} />
|
<img alt="github repository" src={githubLogo} className={classes.ghlogo} />
|
||||||
</a>
|
</a>
|
||||||
</Grid>
|
</Grid>
|
||||||
{isAuthenticated() && isAuthenticationEnabled() && (
|
|
||||||
<Grid item>
|
|
||||||
<UserAccountMenu />
|
|
||||||
</Grid>
|
|
||||||
)}
|
|
||||||
{!isAuthenticated() && isAuthenticationEnabled() && (
|
|
||||||
<Grid item>
|
|
||||||
<Button className={classes.signInBtn} onClick={handleSignInClick}>
|
|
||||||
Sign in
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
)}
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
Loading…
Reference in New Issue
Block a user