|
|
|
@ -25,11 +25,11 @@ import { |
|
|
|
Description, |
|
|
|
Description, |
|
|
|
DescriptionInnerBlock, |
|
|
|
DescriptionInnerBlock, |
|
|
|
MatchDate, |
|
|
|
MatchDate, |
|
|
|
StyledLink, |
|
|
|
|
|
|
|
Score, |
|
|
|
Score, |
|
|
|
|
|
|
|
StyledLink, |
|
|
|
|
|
|
|
Time, |
|
|
|
Title, |
|
|
|
Title, |
|
|
|
Views, |
|
|
|
Views, |
|
|
|
Time, |
|
|
|
|
|
|
|
} from './styled' |
|
|
|
} from './styled' |
|
|
|
|
|
|
|
|
|
|
|
export const MatchDescription = () => { |
|
|
|
export const MatchDescription = () => { |
|
|
|
@ -39,17 +39,11 @@ export const MatchDescription = () => { |
|
|
|
const { suffix } = useLexicsStore() |
|
|
|
const { suffix } = useLexicsStore() |
|
|
|
const { profile, profileCardShown } = useMatchPageStore() |
|
|
|
const { profile, profileCardShown } = useMatchPageStore() |
|
|
|
|
|
|
|
|
|
|
|
const getTeamName = useCallback((team: Team) => { |
|
|
|
const getTeamName = useCallback((team: Team) => ( |
|
|
|
if (isMobileDevice) { |
|
|
|
isMobileDevice |
|
|
|
const teamNameLimit = 14 |
|
|
|
? getName({ nameObj: team, suffix }) |
|
|
|
let name = getName({ nameObj: team, suffix }) |
|
|
|
: <Name nameObj={team} /> |
|
|
|
if (name.length > teamNameLimit) { |
|
|
|
), [suffix]) |
|
|
|
name = `${name.substring(0, teamNameLimit)}...` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return name |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return <Name nameObj={team} /> |
|
|
|
|
|
|
|
}, [suffix]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!profile) return <Description /> |
|
|
|
if (!profile) return <Description /> |
|
|
|
|
|
|
|
|
|
|
|
@ -95,12 +89,18 @@ export const MatchDescription = () => { |
|
|
|
<TournamentSubtitle |
|
|
|
<TournamentSubtitle |
|
|
|
countryId={country_id} |
|
|
|
countryId={country_id} |
|
|
|
tournament={tournament} |
|
|
|
tournament={tournament} |
|
|
|
|
|
|
|
time={isMobileDevice ? changedTimeFormat : null} |
|
|
|
|
|
|
|
date={isMobileDevice ? localDate : null} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</DescriptionInnerBlock> |
|
|
|
</DescriptionInnerBlock> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
!isMobileDevice && ( |
|
|
|
<Views> |
|
|
|
<Views> |
|
|
|
<Time>{changedTimeFormat}</Time> |
|
|
|
<Time>{changedTimeFormat}</Time> |
|
|
|
<MatchDate>{localDate}</MatchDate> |
|
|
|
<MatchDate>{localDate}</MatchDate> |
|
|
|
</Views> |
|
|
|
</Views> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
</Description> |
|
|
|
</Description> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|