From 5c43a69c1395315988fa5643ec56be6fc85e5d47 Mon Sep 17 00:00:00 2001 From: Farber Denis Date: Mon, 20 Mar 2023 12:22:06 +0300 Subject: [PATCH] fix(#in441): stats block empty cell fix --- .../components/PlayersTable/hooks/usePlayers.tsx | 4 +++- .../MatchSidePlaylists/components/PlayersTable/index.tsx | 2 +- .../MatchSidePlaylists/components/TabEvents/styled.tsx | 3 +++ src/hooks/useTooltip.tsx | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx b/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx index 0c3de6d3..f49c06c4 100644 --- a/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx +++ b/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.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) => { diff --git a/src/features/MatchSidePlaylists/components/PlayersTable/index.tsx b/src/features/MatchSidePlaylists/components/PlayersTable/index.tsx index 3a8f9b9c..1061daeb 100644 --- a/src/features/MatchSidePlaylists/components/PlayersTable/index.tsx +++ b/src/features/MatchSidePlaylists/components/PlayersTable/index.tsx @@ -144,9 +144,9 @@ export const PlayersTable = (props: PlayersTableProps) => { {map(players, (player) => { const playerName = getPlayerName(player) + const playerNum = player.num ?? player.club_shirt_num const playerProfileUrl = `/${sportName}/players/${player.id}` - return ( diff --git a/src/features/MatchSidePlaylists/components/TabEvents/styled.tsx b/src/features/MatchSidePlaylists/components/TabEvents/styled.tsx index f5e082d8..552961b3 100644 --- a/src/features/MatchSidePlaylists/components/TabEvents/styled.tsx +++ b/src/features/MatchSidePlaylists/components/TabEvents/styled.tsx @@ -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; diff --git a/src/hooks/useTooltip.tsx b/src/hooks/useTooltip.tsx index e2c236e6..6b6eaa43 100644 --- a/src/hooks/useTooltip.tsx +++ b/src/hooks/useTooltip.tsx @@ -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,