Fix network sessions showing wrong table header

This commit is contained in:
Aurora Lahtela 2022-09-10 09:52:51 +03:00
parent adc4162217
commit ab2dfbbbcf
3 changed files with 9 additions and 5 deletions

View File

@ -84,7 +84,8 @@ const SessionBody = ({i, session}) => {
const SessionAccordion = (
{
sessions,
isPlayer
isPlayer,
isNetwork
}
) => {
const {t} = useTranslation();
@ -99,7 +100,10 @@ const SessionAccordion = (
firstColumn,
<><Fa icon={faClock}/> {t('html.label.sessionStart')}</>,
<><Fa icon={faClock}/> {t('html.label.length')}</>,
<><Fa icon={faMap}/> {t('html.label.mostPlayedWorld')}</>
<>
{!isNetwork && <><Fa icon={faMap}/> {t('html.label.mostPlayedWorld')}</>}
{isNetwork && <><Fa icon={faServer}/> {t('html.label.server')}</>}
</>
]} slices={sessions.map(session => {
return {
body: <SessionBody session={session}/>,

View File

@ -6,7 +6,7 @@ import Scrollable from "../../Scrollable";
import SessionAccordion from "../../accordion/SessionAccordion";
import React from "react";
const RecentSessionsCard = ({sessions, isPlayer}) => {
const RecentSessionsCard = ({sessions, isPlayer, isNetwork}) => {
const {t} = useTranslation();
return (
<Card>
@ -19,7 +19,7 @@ const RecentSessionsCard = ({sessions, isPlayer}) => {
</h6>
</Card.Header>
<Scrollable>
<SessionAccordion sessions={sessions} isPlayer={isPlayer}/>
<SessionAccordion sessions={sessions} isPlayer={isPlayer} isNetwork={isNetwork}/>
</Scrollable>
</Card>
)

View File

@ -10,7 +10,7 @@ const ServerRecentSessionsCard = ({identifier}) => {
if (loadingError) return <ErrorViewCard error={loadingError}/>
return (
<RecentSessionsCard sessions={data?.sessions} isPlayer={true}/>
<RecentSessionsCard sessions={data?.sessions} isPlayer={true} isNetwork={!identifier}/>
)
}