fix(#1973): fix playernames in playlists events

keep-around/929cae48a7ac38085ad509de47a5da82daa2ff4f
Дектерев Андрей 4 years ago committed by Макситалиев Мирлан
parent d717ed6b85
commit 929cae48a7
  1. 6
      src/features/MatchSidePlaylists/components/EventButton/index.tsx
  2. 6
      src/features/MatchSidePlaylists/components/EventsList/index.tsx
  3. 8
      src/requests/getMatchEvents.tsx

@ -4,7 +4,6 @@ import type { Event, Team } from 'requests'
import { usePageParams } from 'hooks/usePageParams'
import type { PlayerPlaylistOption } from 'features/MatchPage/types'
import { Name } from 'features/Name'
import { T9n } from 'features/T9n'
@ -24,7 +23,6 @@ type Props = {
event: Event,
isHomeTeam: boolean,
onClick: () => void,
player?: PlayerPlaylistOption,
team?: Team,
}
@ -34,7 +32,6 @@ export const EventButton = ({
event,
isHomeTeam,
onClick,
player,
team,
}: Props) => {
const { sportType } = usePageParams()
@ -42,6 +39,7 @@ export const EventButton = ({
c: clearTime,
l: lexica,
p: playerId,
pl: playerName,
sc1: score1,
sc2: score2,
t: teamId,
@ -51,7 +49,7 @@ export const EventButton = ({
const profileType = playerId
? ProfileTypes.PLAYERS
: ProfileTypes.TEAMS
const nameObj = player || team
const nameObj = playerName || team
return (
<Button

@ -1,4 +1,3 @@
import find from 'lodash/find'
import map from 'lodash/map'
import type { Events, MatchInfo } from 'requests'
@ -48,10 +47,6 @@ export const EventsList = ({
const team = isHomeTeam
? profile?.team1
: profile?.team2
const players = isHomeTeam
? playlists.players.team1
: playlists.players.team2
const player = find(players, { id: event.p })
return (
<Event key={event.n}>
@ -60,7 +55,6 @@ export const EventsList = ({
event={event}
isHomeTeam={isHomeTeam}
onClick={() => onSelect(eventPlaylist)}
player={player}
team={team}
/>
</Event>

@ -15,6 +15,11 @@ type Args = {
sportType: SportTypes,
}
type PlayerNames = {
name_eng: string,
name_rus: string,
}
export type Event = Episode & {
/** clear time */
c: string,
@ -28,6 +33,9 @@ export type Event = Episode & {
/** player id */
p?: number,
/** player names */
pl?: PlayerNames,
/** repeat */
rep?: Episodes,

Loading…
Cancel
Save