From 5c43a69c1395315988fa5643ec56be6fc85e5d47 Mon Sep 17 00:00:00 2001 From: Farber Denis Date: Mon, 20 Mar 2023 12:22:06 +0300 Subject: [PATCH 1/5] 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, -- 2.30.2 From b80ced0877504663def8d708aefe78d68dd81bf1 Mon Sep 17 00:00:00 2001 From: Farber Denis Date: Tue, 21 Mar 2023 17:08:26 +0300 Subject: [PATCH 2/5] fix(#in441): comment fix --- .../components/PlayersTable/hooks/usePlayers.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx b/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx index f49c06c4..08643dff 100644 --- a/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx +++ b/src/features/MatchSidePlaylists/components/PlayersTable/hooks/usePlayers.tsx @@ -33,9 +33,7 @@ export const usePlayers = ({ sortCondition, teamId }: UsePlayersArgs) => { ) const getPlayerName = useCallback((player: Player) => ( - player[`lastname_${suffix}`] === '' - ? player[`firstname_${suffix}`] - : trim(player[`lastname_${suffix}`] || '') + trim(player[`lastname_${suffix}`]) || player[`firstname_${suffix}`] ), [suffix]) const getParamValue = useCallback((playerId: number, paramId: number) => { -- 2.30.2 From e50e3c1d8ce36bf5420decb549692907dc20049a Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Tue, 21 Mar 2023 17:00:34 +0700 Subject: [PATCH 3/5] fix(check device): return check device --- src/features/AuthStore/hooks/useAuth.tsx | 28 +++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/features/AuthStore/hooks/useAuth.tsx b/src/features/AuthStore/hooks/useAuth.tsx index 3014348f..54e701bf 100644 --- a/src/features/AuthStore/hooks/useAuth.tsx +++ b/src/features/AuthStore/hooks/useAuth.tsx @@ -42,7 +42,6 @@ import { } from 'requests' import { userManager } from '../config' -// eslint-disable-next-line import { needCheckNewDeviсe } from '../helpers' export const useAuth = () => { @@ -220,7 +219,6 @@ export const useAuth = () => { }) }, [logout]) - // eslint-disable-next-line const checkNewDevice = useCallback(async () => { const loadedUser = await userManager.getUser() if (!loadedUser) return @@ -230,18 +228,18 @@ export const useAuth = () => { }) }, [reChekNewDevice]) - // useEffect(() => { - // if (!needCheckNewDeviсe && !user) return undefined - // const startCheckDevice = setInterval(checkNewDevice, 20000) - // isNewDeviceLogin && clearInterval(startCheckDevice) - // return () => clearInterval(startCheckDevice) - // - // // eslint-disable-next-line react-hooks/exhaustive-deps - // }, [ - // checkNewDevice, - // isNewDeviceLogin, - // setIsNewDeviceLogin, - // ]) + useEffect(() => { + if (!needCheckNewDeviсe && !user) return undefined + const startCheckDevice = setInterval(checkNewDevice, 20000) + isNewDeviceLogin && clearInterval(startCheckDevice) + return () => clearInterval(startCheckDevice) + + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ + checkNewDevice, + isNewDeviceLogin, + setIsNewDeviceLogin, + ]) useEffect(() => { // попытаемся обновить токен используя refresh_token @@ -290,7 +288,7 @@ export const useAuth = () => { }, [changeLang]) useEffect(() => { - fetchUserInfo() + readToken() && fetchUserInfo() }, [fetchUserInfo, user]) const auth = useMemo(() => ({ -- 2.30.2 From 7feed32c37c4ea94920bae1e1190a0463b4a596a Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Wed, 22 Mar 2023 16:44:07 +0700 Subject: [PATCH 4/5] fix(favouriteteampopup): cancel request for unpayment matches --- src/features/MatchPage/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/MatchPage/index.tsx b/src/features/MatchPage/index.tsx index 61904796..72066bb6 100644 --- a/src/features/MatchPage/index.tsx +++ b/src/features/MatchPage/index.tsx @@ -107,7 +107,9 @@ const MatchPageComponent = () => { { - user && (profile?.tournament.id === 131 || profile?.tournament.id === 2032) + user + && profile?.sub + && (profile?.tournament.id === 131 || profile?.tournament.id === 2032) && } -- 2.30.2 From c4b304b031083b836cf165589af3c109e390e09e Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Wed, 22 Mar 2023 22:16:56 +0700 Subject: [PATCH 5/5] fix(#44): add softball --- src/components/SportIcon/SportIcon.tsx | 4 ++++ src/config/sportTypes.tsx | 4 +++- src/features/Icon/index.tsx | 2 +- src/libs/index.ts | 1 + src/libs/objects/Softball.tsx | 20 ++++++++++++++++++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/libs/objects/Softball.tsx diff --git a/src/components/SportIcon/SportIcon.tsx b/src/components/SportIcon/SportIcon.tsx index 86bfdb07..45a19e73 100644 --- a/src/components/SportIcon/SportIcon.tsx +++ b/src/components/SportIcon/SportIcon.tsx @@ -77,6 +77,10 @@ const sportIcons = { color: '#ffffff', icon: 'CRICKET', }, + softball: { + color: '#ffffff', + icon: 'Softball', + }, } export const SportIcon = ({ diff --git a/src/config/sportTypes.tsx b/src/config/sportTypes.tsx index b8f642f6..45e5fa0b 100644 --- a/src/config/sportTypes.tsx +++ b/src/config/sportTypes.tsx @@ -13,7 +13,8 @@ export enum SportTypes { FUTSAL = 17, FLOORBALL = 18, CRICKET = 19, - BASEBALL = 20 + BASEBALL = 20, + SOFTBALL = 21 } export const SPORT_NAMES = { @@ -32,4 +33,5 @@ export const SPORT_NAMES = { [SportTypes.FUTSAL]: 'futsal', [SportTypes.FLOORBALL]: 'floorball', [SportTypes.CRICKET]: 'cricket', + [SportTypes.SOFTBALL]: 'softball', } as const diff --git a/src/features/Icon/index.tsx b/src/features/Icon/index.tsx index d6fd2300..38b32bd7 100644 --- a/src/features/Icon/index.tsx +++ b/src/features/Icon/index.tsx @@ -36,7 +36,7 @@ export const Icon: React.FC = ({ > { // @ts-ignore - React.createElement(icons[refIcon], {}) + icons[refIcon] && React.createElement(icons[refIcon], {}) } ) diff --git a/src/libs/index.ts b/src/libs/index.ts index a39144fa..f3795343 100644 --- a/src/libs/index.ts +++ b/src/libs/index.ts @@ -22,3 +22,4 @@ export { PoweredByInsports } from './objects/PoweredByInsports' export { Info } from './objects/Info' export { Streetball } from './objects/Streetball' export { Baseball } from './objects/Baseball' +export { Softball } from './objects/Softball' diff --git a/src/libs/objects/Softball.tsx b/src/libs/objects/Softball.tsx new file mode 100644 index 00000000..6f44de7f --- /dev/null +++ b/src/libs/objects/Softball.tsx @@ -0,0 +1,20 @@ +export const Softball = () => ( + + + + + + + + + + + + +) -- 2.30.2