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 = ( const SessionAccordion = (
{ {
sessions, sessions,
isPlayer isPlayer,
isNetwork
} }
) => { ) => {
const {t} = useTranslation(); const {t} = useTranslation();
@ -99,7 +100,10 @@ const SessionAccordion = (
firstColumn, firstColumn,
<><Fa icon={faClock}/> {t('html.label.sessionStart')}</>, <><Fa icon={faClock}/> {t('html.label.sessionStart')}</>,
<><Fa icon={faClock}/> {t('html.label.length')}</>, <><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 => { ]} slices={sessions.map(session => {
return { return {
body: <SessionBody session={session}/>, body: <SessionBody session={session}/>,

View File

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

View File

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