fix(#in441): stats block empty cell fix

pull/131/head
Farber Denis 3 years ago
parent 5a38dfdc57
commit 5c43a69c13
  1. 4
      src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx
  2. 2
      src/features/MatchSidePlaylists/components/PlayersTable/index.tsx
  3. 3
      src/features/MatchSidePlaylists/components/TabEvents/styled.tsx
  4. 2
      src/hooks/useTooltip.tsx

@ -33,7 +33,9 @@ export const usePlayers = ({ sortCondition, teamId }: UsePlayersArgs) => {
)
const getPlayerName = useCallback((player: Player) => (
trim(player[`lastname_${suffix}`] || '')
player[`lastname_${suffix}`] === ''
? player[`firstname_${suffix}`]
: trim(player[`lastname_${suffix}`] || '')
), [suffix])
const getParamValue = useCallback((playerId: number, paramId: number) => {

@ -144,9 +144,9 @@ export const PlayersTable = (props: PlayersTableProps) => {
<tbody>
{map(players, (player) => {
const playerName = getPlayerName(player)
const playerNum = player.num ?? player.club_shirt_num
const playerProfileUrl = `/${sportName}/players/${player.id}`
return (
<Row key={player.id}>
<Cell columnWidth={firstColumnWidth}>

@ -31,6 +31,7 @@ export const Event = styled.li`
width: 100%;
height: 48px;
margin-bottom: 12px;
position: relative;
:first-child {
margin-top: 12px;
@ -119,6 +120,8 @@ export const SubTitle = styled(Title)`
font-weight: normal;
color: rgba(255, 255, 255, 0.7);
margin-top: 2px;
width: 100%;
position: relative;
${NameStyled} {
font-weight: 700;

@ -54,7 +54,7 @@ export const useTooltip = () => {
const tooltipStyle: CSSProperties = {
left: !isUndefined(coords.left) ? `${coords.left}px` : 'auto',
position: 'fixed',
right: !isUndefined(coords.right) ? `${window.screen.width - coords.right}px` : 'auto',
right: !isUndefined(coords.right) ? `${window.innerWidth - coords.right}px` : 'auto',
top: `${coords.top}px`,
zIndex: 999,

Loading…
Cancel
Save