mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-10 22:01:00 +01:00
Fix players page title
This commit is contained in:
parent
56a3be1835
commit
576485d20c
@ -3,7 +3,6 @@ import {useTranslation} from "react-i18next";
|
|||||||
import {Outlet} from "react-router-dom";
|
import {Outlet} from "react-router-dom";
|
||||||
import {useNavigation} from "../../hooks/navigationHook";
|
import {useNavigation} from "../../hooks/navigationHook";
|
||||||
import {faSearch} from "@fortawesome/free-solid-svg-icons";
|
import {faSearch} from "@fortawesome/free-solid-svg-icons";
|
||||||
import {useAuth} from "../../hooks/authenticationHook";
|
|
||||||
import {NightModeCss} from "../../hooks/themeHook";
|
import {NightModeCss} from "../../hooks/themeHook";
|
||||||
import Sidebar from "../../components/navigation/Sidebar";
|
import Sidebar from "../../components/navigation/Sidebar";
|
||||||
import Header from "../../components/navigation/Header";
|
import Header from "../../components/navigation/Header";
|
||||||
@ -18,7 +17,7 @@ const PlayersPage = () => {
|
|||||||
const [error] = useState(undefined);
|
const [error] = useState(undefined);
|
||||||
const [sidebarItems, setSidebarItems] = useState([]);
|
const [sidebarItems, setSidebarItems] = useState([]);
|
||||||
|
|
||||||
const {currentTab} = useNavigation();
|
const {currentTab, setCurrentTab} = useNavigation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const items = [
|
const items = [
|
||||||
@ -28,15 +27,16 @@ const PlayersPage = () => {
|
|||||||
|
|
||||||
setSidebarItems(items);
|
setSidebarItems(items);
|
||||||
window.document.title = `Plan | Player list`;
|
window.document.title = `Plan | Player list`;
|
||||||
}, [t, i18n])
|
setCurrentTab('html.label.players')
|
||||||
|
}, [t, i18n, setCurrentTab])
|
||||||
|
|
||||||
const {authRequired, user} = useAuth();
|
// const {authRequired, user} = useAuth();
|
||||||
const showBackButton = isProxy && (!authRequired || user.permissions.filter(perm => perm !== 'page.network').length);
|
const showBackButton = true; // TODO
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return <>
|
return <>
|
||||||
<NightModeCss/>
|
<NightModeCss/>
|
||||||
<Sidebar items={[]} showBackButton={true}/>
|
<Sidebar items={[]} showBackButton={showBackButton}/>
|
||||||
<div className="d-flex flex-column" id="content-wrapper">
|
<div className="d-flex flex-column" id="content-wrapper">
|
||||||
<Header page={error.title ? error.title : 'Unexpected error occurred'}/>
|
<Header page={error.title ? error.title : 'Unexpected error occurred'}/>
|
||||||
<div id="content" style={{display: 'flex'}}>
|
<div id="content" style={{display: 'flex'}}>
|
||||||
@ -55,7 +55,7 @@ const PlayersPage = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NightModeCss/>
|
<NightModeCss/>
|
||||||
<Sidebar items={sidebarItems} showBackButton={true}/>
|
<Sidebar items={sidebarItems} showBackButton={showBackButton}/>
|
||||||
<div className="d-flex flex-column" id="content-wrapper">
|
<div className="d-flex flex-column" id="content-wrapper">
|
||||||
<Header page={displayedServerName} tab={currentTab}/>
|
<Header page={displayedServerName} tab={currentTab}/>
|
||||||
<div id="content" style={{display: 'flex'}}>
|
<div id="content" style={{display: 'flex'}}>
|
||||||
|
Loading…
Reference in New Issue
Block a user