refactor(#444): remove type SportTypes and add all sports to localstorage

pull/139/head
Andrei Dekterev 3 years ago
parent 355f9fab5d
commit f335295dae
  1. 4
      src/components/ItemInfo/ItemInfo.tsx
  2. 125
      src/components/SportIcon/SportIcon.tsx
  3. 1
      src/config/index.tsx
  4. 2
      src/config/lexics/indexLexics.tsx
  5. 1
      src/config/queries.tsx
  6. 37
      src/config/sportTypes.tsx
  7. 4
      src/features/App/AuthenticatedApp.tsx
  8. 41
      src/features/App/hooks.tsx
  9. 4
      src/features/Common/SportName/index.tsx
  10. 4
      src/features/Common/SportName/styled.tsx
  11. 2
      src/features/FavoritesMobilePopup/components/GroupBlock/index.tsx
  12. 9
      src/features/HeaderFilters/store/hooks/index.tsx
  13. 7
      src/features/ItemsList/index.tsx
  14. 4
      src/features/JoinMatchPage/styled.tsx
  15. 6
      src/features/MatchPage/components/FavouriteTeam/index.tsx
  16. 4
      src/features/MatchPage/helpers/prepareMatchProfile.tsx
  17. 4
      src/features/MatchPage/store/hooks/useMatchPlaylists.tsx
  18. 4
      src/features/MatchPopup/store/hooks/index.tsx
  19. 4
      src/features/MatchPopup/store/hooks/useSettingsState.tsx
  20. 4
      src/features/MatchPopup/store/hooks/useSportActions.tsx
  21. 3
      src/features/MatchPopup/types.tsx
  22. 5
      src/features/Matches/helpers/addSportType.tsx
  23. 2
      src/features/PreferencesPopup/components/TournamentInfo/index.tsx
  24. 5
      src/features/PreferencesPopup/store/helpers.tsx
  25. 3
      src/features/PreferencesPopup/store/hooks/useSearch.tsx
  26. 5
      src/features/PreferencesPopup/store/hooks/useSports.tsx
  27. 4
      src/features/PreferencesPopup/store/hooks/useTournaments.tsx
  28. 4
      src/features/PreferencesPopup/store/hooks/useTournamentsBySports.tsx
  29. 3
      src/features/ProfileHeader/hooks.tsx
  30. 3
      src/features/ProfileHeader/index.tsx
  31. 42
      src/features/ProfileLink/helpers/__tests__/index.tsx
  32. 16
      src/features/ProfileLink/helpers/index.tsx
  33. 4
      src/features/ProfileLink/index.tsx
  34. 4
      src/features/ProfileLogo/index.tsx
  35. 27
      src/features/SportIcon/index.tsx
  36. 13
      src/features/SportsFilter/components/SelectSport/index.tsx
  37. 10
      src/features/SportsFilter/components/SelectSportPopup/index.tsx
  38. 14
      src/features/SportsFilter/index.tsx
  39. 4
      src/features/StreamPlayer/components/ProgressBar/helpers/calculateChapterStyles/__tests__/index.tsx
  40. 4
      src/features/TournamentList/components/CollapseTournament/index.tsx
  41. 4
      src/features/TournamentList/components/TournamentMobile/index.tsx
  42. 4
      src/features/TournamentList/hooks.tsx
  43. 14
      src/features/TournamentSubtitle/index.tsx
  44. 6
      src/features/TournamentSubtitle/styled.tsx
  45. 6
      src/features/TournamentsPopup/index.tsx
  46. 4
      src/features/UserAccount/components/UserSubscriptionsList/index.tsx
  47. 4
      src/features/UserFavorites/hooks/index.tsx
  48. 10
      src/helpers/getLocalStorage/index.tsx
  49. 8
      src/helpers/getProfileLogo/__tests__/index.tsx
  50. 4
      src/helpers/getProfileLogo/index.tsx
  51. 38
      src/helpers/getSportLexic/index.tsx
  52. 3
      src/helpers/isPermittedTournament/index.tsx
  53. 6
      src/hooks/usePageParams.tsx
  54. 9
      src/libs/index.ts
  55. 20
      src/libs/objects/Baseball.tsx
  56. 17
      src/libs/objects/Basketball.tsx
  57. 17
      src/libs/objects/Boxing.tsx
  58. 17
      src/libs/objects/Football.tsx
  59. 17
      src/libs/objects/Handball.tsx
  60. 17
      src/libs/objects/Hockey.tsx
  61. 20
      src/libs/objects/Softball.tsx
  62. 18
      src/libs/objects/Streetball.tsx
  63. 17
      src/libs/objects/Volleyball.tsx
  64. 5
      src/pages/HighlightsPage/components/MatchesHighlights/index.tsx
  65. 4
      src/requests/getLandingStatus.tsx
  66. 4
      src/requests/getMatchEvents.tsx
  67. 4
      src/requests/getMatchInfo.tsx
  68. 4
      src/requests/getMatchLastWatchSeconds.tsx
  69. 4
      src/requests/getMatchParticipants.tsx
  70. 4
      src/requests/getMatchPlaylists.tsx
  71. 4
      src/requests/getMatches/getPlayerMatches.tsx
  72. 4
      src/requests/getMatches/getTeamMatches.tsx
  73. 4
      src/requests/getMatches/getTournamentMatches.tsx
  74. 6
      src/requests/getMatches/types.tsx
  75. 6
      src/requests/getMatchesPreviewImages.tsx
  76. 4
      src/requests/getPlayerInfo.tsx
  77. 4
      src/requests/getPlayerPlaylists.tsx
  78. 4
      src/requests/getProfileColor.tsx
  79. 8
      src/requests/getSearchItems.tsx
  80. 4
      src/requests/getSportActions.tsx
  81. 9
      src/requests/getSportList.tsx
  82. 10
      src/requests/getSportTournaments.tsx
  83. 4
      src/requests/getStatsEvents.tsx
  84. 3
      src/requests/getSubscriptions.tsx
  85. 3
      src/requests/getUnauthenticatedMatch.tsx
  86. 3
      src/requests/getUserPreferences.tsx
  87. 3
      src/requests/getUserSportFavs.tsx
  88. 4
      src/requests/getVideos.tsx
  89. 3
      src/requests/getViewMatchDuration.tsx
  90. 3
      src/requests/logUserAction.tsx
  91. 3
      src/requests/modifyUserSportFavs.tsx
  92. 3
      src/requests/reportPlayerProgress.tsx
  93. 4
      src/requests/saveMatchStats.tsx
  94. 4
      src/requests/saveUserCustomSubscription.tsx
  95. 7
      src/requests/search.tsx

@ -2,7 +2,7 @@
import {
ProfileTypes,
PROFILE_NAMES,
SportTypes,
URL_AWS,
} from 'config'
@ -17,7 +17,7 @@ type ItemInfoType = {
id: number,
name: string,
onClick: (val: any) => void,
sportId: SportTypes,
sportId: number,
type: ProfileTypes,
}
export const ItemInfo = ({

@ -1,111 +1,36 @@
/* eslint sort-keys: 0 */
import styled from 'styled-components/macro'
import styled, { css } from 'styled-components/macro'
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
import {
isMobileDevice,
querieKeys,
URL_AWS,
} from 'config'
import { Icon } from 'features/Icon'
const IconWrap = styled.div`
color: white;
export const Icon = styled.img`
${isMobileDevice
? css`
width: 10px;
height: 10px;
`
: css`
width: 0.65rem;
height: 0.65rem;
`};
`
type Props = {
fill?: string,
size?: number | string,
sport: SportTypes,
}
const sportIcons = {
basketball: {
color: '#f1903b',
icon: 'Basketball',
},
boxing: {
color: '#ffffff',
icon: 'Boxing',
},
football: {
color: '#5CDD86',
icon: 'Football',
},
handball: {
color: '#F6BE4F',
icon: 'Handball',
},
hockey: {
color: '#5eb2ff',
icon: 'Hockey',
},
streetball: {
color: '#f1903b',
icon: 'Streetball',
},
volleyball: {
color: '#2D8B8A',
icon: 'Volleyball',
},
baseball: {
color: '#ffffff',
icon: 'Baseball',
},
tennis: {
color: '#ffffff',
icon: 'Tennis',
},
field_hockey: {
color: '#ffffff',
icon: 'FIELD_HOCKEY',
},
figure_skating: {
color: '#ffffff',
icon: 'FIGURE_SKATING',
},
american_football: {
color: '#ffffff',
icon: 'AMERICAN_FOOTBALL',
},
futsal: {
color: '#ffffff',
icon: 'FUTSAL',
},
floorball: {
color: '#ffffff',
icon: 'FLOORBALL',
},
cricket: {
color: '#ffffff',
icon: 'CRICKET',
},
softball: {
color: '#ffffff',
icon: 'Softball',
},
sportType?: number,
}
export const SportIcon = ({
fill,
size,
sport,
}: Props) => {
const sportType = getSportLexic(sport)
const IconSport = sportIcons[sportType]?.icon
export const SportIcon = ({ sportType }: Props) => {
const sportList = localStorage.getItem(querieKeys.sportsList)
const isHasSport = sportType && sportList && JSON.parse(sportList)[sportType]
return (
<IconWrap>
{IconSport && (
isHasSport
? (
<Icon
refIcon={IconSport}
color={fill || sportIcons[sportType]?.color}
size={size}
styles={{
alignItems: 'center',
display: 'flex',
// height: '100%', // пока не удалять
justifyContent: 'center',
}}
src={`${URL_AWS}/media/sports/${sportType}/icon24.png`}
/>
)}
</IconWrap>
) : null
)
}

@ -2,7 +2,6 @@ export * from './routes'
export * from './pages'
export * from './authKeys'
export * from './procedures'
export * from './sportTypes'
export * from './profileTypes'
export * from './history'
export * from './devices'

@ -112,6 +112,7 @@ const preferencesPopupLexics = {
}
const sportsPopup = {
all_sports: 13824,
football_popup: 12980,
hockey_popup: 15217,
}
@ -128,7 +129,6 @@ export const indexLexics = {
add_to_favorites_error: 12943,
all_competitions: 17926,
all_matches_shown: 13386,
all_sports: 13824,
and: 17878,
available_matches_shown: 13385,
basketball: 6960,

@ -1,4 +1,5 @@
export const querieKeys = {
liveMatchScores: 'liveMatchScores',
matchScore: 'matchScore',
sportsList: 'sportsList',
}

@ -1,37 +0,0 @@
export enum SportTypes {
FOOTBALL = 1,
HOCKEY = 2,
BASKETBALL = 3,
TENNIS = 4,
VOLLEYBALL = 6,
HANDBALL = 7,
STREETBALL = 9,
BOXING = 12,
FIELD_HOCKEY = 14,
FIGURE_SKATING = 15,
AMERICAN_FOOTBALL = 16,
FUTSAL = 17,
FLOORBALL = 18,
CRICKET = 19,
BASEBALL = 20,
SOFTBALL = 21
}
export const SPORT_NAMES = {
[SportTypes.BASKETBALL]: 'basketball',
[SportTypes.FOOTBALL]: 'football',
[SportTypes.TENNIS]: 'tennis',
[SportTypes.HANDBALL]: 'handball',
[SportTypes.HOCKEY]: 'hockey',
[SportTypes.VOLLEYBALL]: 'volleyball',
[SportTypes.STREETBALL]: 'streetball',
[SportTypes.BOXING]: 'boxing',
[SportTypes.BASEBALL]: 'baseball',
[SportTypes.FIELD_HOCKEY]: 'field_hockey',
[SportTypes.FIGURE_SKATING]: 'figure_skating',
[SportTypes.AMERICAN_FOOTBALL]: 'american_football',
[SportTypes.FUTSAL]: 'futsal',
[SportTypes.FLOORBALL]: 'floorball',
[SportTypes.CRICKET]: 'cricket',
[SportTypes.SOFTBALL]: 'softball',
} as const

@ -14,9 +14,7 @@ import { PAGES } from 'config/pages'
import { client } from 'config/clients'
import { StripeElements } from 'features/StripeElements'
import { useLexicsConfig } from 'features/LexicsStore'
import { ExtendedSearchStore } from 'features/ExtendedSearchPage'
import { MatchSwitchesStore } from 'features/MatchSwitches'
import { UserFavoritesStore } from 'features/UserFavorites/store'
@ -28,6 +26,7 @@ import { TournamentPopupStore } from 'features/TournamentsPopup/store'
import { CardsStore } from 'features/CardsStore'
import { NoNetworkPopup, NoNetworkPopupStore } from 'features/NoNetworkPopup'
import { NewDevicePopup } from 'features/NewDevicePopup'
import { useSportList } from 'features/App/hooks'
const HomePage = lazy(() => import('features/HomePage'))
const UserAccount = lazy(() => import('features/UserAccount'))
@ -45,6 +44,7 @@ const FailedPaymeePage = lazy(() => import('pages/FailedPaymeePage'))
export const AuthenticatedApp = () => {
useLexicsConfig(indexLexics)
useSportList()
return (
<StripeElements>
<NewDevicePopup />

@ -0,0 +1,41 @@
import { useQuery } from 'react-query'
import { getSportList } from 'requests/getSportList'
import type { Sport } from 'requests/getSportList'
import { useLocalStore } from 'hooks'
import { querieKeys } from 'config'
export type SportsType = {
[key: number]: Sport,
}
export const useSportList = () => {
const [sportsList, setSportsList] = useLocalStore<SportsType>({
defaultValue: {} as Sport,
key: querieKeys.sportsList,
validator: (val) => !!val,
})
useQuery({
queryFn: async () => {
const sports = await getSportList()
if (sports?.length && sports?.length !== Object.keys(sportsList)?.length) {
const sportsObject = sports.reduce((prev: Sport, newSport: Sport) => ({
...prev,
[newSport.id]: {
...newSport,
name_eng: newSport.name_eng.toLowerCase(),
name_rus: newSport.name_rus.toLowerCase(),
},
}), {} as Sport)
setSportsList(sportsObject)
}
},
queryKey: querieKeys.sportsList,
})
return { sportsList }
}

@ -1,12 +1,10 @@
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
import { Text } from './styled'
type SportNameProps = {
className?: string,
sport: SportTypes,
sport: number,
}
export const SportName = ({ className, sport }: SportNameProps) => (

@ -1,11 +1,11 @@
import styled from 'styled-components/macro'
import { devices, SportTypes } from 'config'
import { devices } from 'config'
import { T9n } from 'features/T9n'
type Props = {
sport: SportTypes,
sport: number,
}
export const Text = styled(T9n)<Props>`

@ -70,7 +70,7 @@ export const GroupBlock = ({ groupBlock }: Props) => {
<EmptyDiv>
<Name>{name}</Name>
<CountryAndTeamInfo>
<SportIcon sport={item.sport} size={10} />
<SportIcon sportType={item.sport} />
<Flag src={`${URL_AWS}/media/flags/${item.info.country?.id}.png`} />
<EmptySpan>{countryOrTeam}</EmptySpan>
</CountryAndTeamInfo>

@ -14,7 +14,7 @@ import { useQueryParamStore } from 'hooks'
import { getSportLexic } from 'helpers'
import { SPORT_NAMES, SportTypes } from 'config'
import { querieKeys } from 'config'
import { filterKeys } from '../config'
import { isValidDate } from '../helpers/isValidDate'
@ -28,6 +28,7 @@ export const useFilters = () => {
key: filterKeys.DATE,
validator: isValidDate,
})
const sportList = JSON.parse(localStorage.getItem(querieKeys.sportsList)!)
const [selectedSport, setSelectedSport] = useState(['all_sports'])
const [selectedLeague, setSelectedLeague] = useState<Array<string | number>>(['all_competitions'])
@ -52,11 +53,13 @@ export const useFilters = () => {
})
setSportIds(Array.from(sportTypeIds))
if (!Array.from(sportTypeIds)?.some((id: SportTypes) => SPORT_NAMES[id] === selectedSport[0])
if (!Array
.from(sportTypeIds)
?.some((id: number) => sportList && (sportList[id]?.name_eng === selectedSport[0]))
) {
setSelectedSport(['all_sports'])
}
}, [selectedSport])
}, [selectedSport, sportList])
const resetFilters = useCallback(() => {
setIsShowTournament(true)

@ -3,11 +3,10 @@ import { Fragment } from 'react'
import map from 'lodash/map'
import {
SportTypes,
ProfileTypes,
URL_AWS,
} from 'config'
import { isMobileDevice } from 'config/userAgent'
import { Gender } from 'requests'
@ -36,7 +35,7 @@ type SearchItemsListProps = {
name_eng: string,
name_rus: string,
profileType: ProfileTypes,
sport: SportTypes,
sport: number,
}>,
}
@ -56,7 +55,7 @@ export const ItemsList = ({
>
<Name nameObj={item} />
<ItemInfo>
<SportIcon size={isMobileDevice ? 10 : '0.65rem'} sport={item.sport} />
<SportIcon sportType={item.sport} />
{item.additionalInfo && (
<Fragment>
<Flag src={`${URL_AWS}/media/flags/${item.additionalInfo.id}.png`} />

@ -1,13 +1,13 @@
import styled, { css } from 'styled-components/macro'
import { devices, SportTypes } from 'config'
import { devices } from 'config'
import { isMobileDevice } from 'config/userAgent'
import { ButtonSolid } from 'features/Common'
import { Logo } from 'features/Logo'
type Props = {
sportType: SportTypes,
sportType: number,
}
export const Wrapper = styled.div`

@ -5,8 +5,6 @@ import { ItemInfo } from 'components/ItemInfo/ItemInfo'
import type { FavouriteTeams } from 'requests/getFavouriteTeam'
import { SportTypes } from 'config'
import { useFavouriteTeam } from './hooks'
import {
@ -50,7 +48,7 @@ export const FavouriteTeamPopup = () => {
key={team.id}
id={team.id}
name={team.name_en}
sportId={SportTypes.FOOTBALL}
sportId={1} // football
type={2}
onClick={() => changeActive(team)}
/>
@ -68,7 +66,7 @@ export const FavouriteTeamPopup = () => {
key={team.id}
id={team.id}
name={team.name_en}
sportId={SportTypes.FOOTBALL}
sportId={1} // football
type={2}
onClick={() => changeActive(team)}
/>

@ -1,13 +1,11 @@
import type { MatchInfo } from 'requests'
import type { SportTypes } from 'config'
import type { Match } from 'features/BuyMatchPopup/types'
type Args = {
matchId: number,
profile: NonNullable<MatchInfo>,
sportType: SportTypes,
sportType: number,
}
export const prepareMatchProfile = ({

@ -6,8 +6,6 @@ import {
import isEmpty from 'lodash/isEmpty'
import type { SportTypes } from 'config/sportTypes'
import { MatchInfo } from 'requests/getMatchInfo'
import { getMatchPlaylists } from 'requests/getMatchPlaylists'
@ -22,7 +20,7 @@ import { initialPlaylist, useSelectedPlaylist } from './useSelectedPlaylist'
type ArgsFetchMatchPlaylists = {
fullMatchDuration: number,
id: number,
sportType: SportTypes,
sportType: number,
}
const initialPlaylists = buildPlaylists(null)

@ -7,8 +7,6 @@ import { useLocation } from 'react-router-dom'
import isEmpty from 'lodash/isEmpty'
import type { SportTypes } from 'config'
import { getMatchPlaylists } from 'requests'
import { useToggle } from 'hooks'
@ -28,7 +26,7 @@ import { usePlaylistLexics } from './usePlaylistLexics'
type ArgsFetchMatchPlaylists = {
id: number,
sportType: SportTypes,
sportType: number,
withFullMatchDuration?: boolean,
}

@ -2,8 +2,6 @@ import { useCallback, useMemo } from 'react'
import isObject from 'lodash/isObject'
import { SportTypes } from 'config'
import { useLocalStore } from 'hooks'
import type {
@ -17,7 +15,7 @@ import { PlayerPlaylistFormats, defaultSettings } from '../../types'
const selectedActionsKey = 'playlist_settings'
const validator = (value: unknown) => Boolean(value) && isObject(value)
export const useSettingsState = (sportType?: SportTypes) => {
export const useSettingsState = (sportType?: number) => {
const [settingsObj, setSettingsObj] = useLocalStore<SettingsBySport>({
defaultValue: {},
key: selectedActionsKey,

@ -2,14 +2,12 @@ import { useCallback, useState } from 'react'
import map from 'lodash/map'
import { SportTypes } from 'config'
import type { Actions } from 'requests'
import { getSportActions } from 'requests'
import { useLexicsStore } from 'features/LexicsStore'
export const useSportActions = (sportType?: SportTypes) => {
export const useSportActions = (sportType?: number) => {
const [actions, setActions] = useState<Actions>([])
const { addLexicsConfig } = useLexicsStore()

@ -1,4 +1,3 @@
import { SportTypes } from 'config'
import type { Match } from 'features/Matches/hooks'
@ -34,7 +33,7 @@ export type Settings = {
selectedFormat: PlayerPlaylistFormats,
}
export type SettingsBySport = Partial<Record<SportTypes, Settings>>
export type SettingsBySport = Partial<Record<number, Settings>>
export const defaultSettings: Settings = {
episodeDuration: {

@ -1,13 +1,12 @@
import map from 'lodash/map'
import type { MatchesBySection, Matches } from 'requests'
import { SportTypes } from 'config'
const addSportTypeToMatches = (matches: Matches, sport: SportTypes) => (
const addSportTypeToMatches = (matches: Matches, sport: number) => (
map(matches, (match) => ({ ...match, sport }))
)
export const addSportType = (matches: MatchesBySection, sport: SportTypes) => ({
export const addSportType = (matches: MatchesBySection, sport: number) => ({
...matches,
broadcast: addSportTypeToMatches(matches.broadcast, sport),
features: addSportTypeToMatches(matches.features, sport),

@ -51,7 +51,7 @@ export const TournamentInfo = ({
<Wrapper>
<StyledName nameObj={tournament} className='title' prefix={prefix} />
<ItemInfo>
{isIcon && <SportIcon size={isMobileDevice ? 10 : '0.65rem'} sport={tournament.sport} />}
{isIcon && <SportIcon sportType={tournament.sport} />}
<Flag src={`${URL_AWS}/media/flags/${tournament.country.id}.png`} />
<TeamOrCountry nameObj={tournament.country} />
</ItemInfo>

@ -3,12 +3,11 @@ import toLower from 'lodash/toLower'
import reduce from 'lodash/reduce'
import filter from 'lodash/filter'
import type { SportTypes } from 'config'
import type { TournamentsBySports, Tournaments } from 'requests/getSportTournaments'
const getFlatTournaments = (
tournamentsBySports: TournamentsBySports,
selectedSports: Array<SportTypes>,
selectedSports: Array<number>,
) => (
reduce(
selectedSports,
@ -27,7 +26,7 @@ type NameKey = 'name_eng' | 'name_rus'
type SearchProps = {
query: string,
selectedSports: Array<SportTypes>,
selectedSports: Array<number>,
suffix: string,
tournamentsBySports: TournamentsBySports,
}

@ -7,7 +7,6 @@ import {
import debounce from 'lodash/debounce'
import type { SportTypes } from 'config'
import type { Tournaments, TournamentsBySports } from 'requests/getSportTournaments'
import { useLexicsStore } from 'features/LexicsStore'
@ -18,7 +17,7 @@ type SearchArgs = Parameters<typeof search>[0]
export const useSearch = (
tournamentsBySports: TournamentsBySports,
selectedSports: Array<SportTypes>,
selectedSports: Array<number>,
) => {
const { suffix } = useLexicsStore()

@ -4,13 +4,12 @@ import includes from 'lodash/includes'
import without from 'lodash/without'
import isEmpty from 'lodash/isEmpty'
import type { SportTypes } from 'config'
import type { SportList } from 'requests/getSportList'
import { getSportList } from 'requests/getSportList'
export const useSports = () => {
const [sports, setSports] = useState<SportList>([])
const [selectedSports, setSelectedSports] = useState<Array<SportTypes>>([])
const [selectedSports, setSelectedSports] = useState<Array<number>>([])
const fetchInitialSports = useCallback(() => {
if (isEmpty(sports)) {
@ -18,7 +17,7 @@ export const useSports = () => {
}
}, [sports])
const onSportSelect = (sport: SportTypes) => {
const onSportSelect = (sport: number) => {
const newSports = includes(selectedSports, sport)
? without(selectedSports, sport)
: [sport, ...selectedSports]

@ -13,13 +13,11 @@ import every from 'lodash/every'
import find from 'lodash/find'
import map from 'lodash/map'
import type { SportTypes } from 'config'
import type { Tournament, Tournaments } from 'requests/getSportTournaments'
import type { UserPreferences } from 'requests/getUserPreferences'
export const useSelectedTournaments = (
selectedSports: Array<SportTypes>,
selectedSports: Array<number>,
tournaments: Tournaments,
) => {
const [selectedTournaments, setSelectedTournaments] = useState<UserPreferences>([])

@ -3,14 +3,12 @@ import { useState, useEffect } from 'react'
import isEmpty from 'lodash/isEmpty'
import filter from 'lodash/filter'
import type { SportTypes } from 'config'
import type { TournamentsBySports } from 'requests/getSportTournaments'
import { getTournamentsBySports } from 'requests/getSportTournaments'
import { useRequest } from 'hooks'
export const useTournamentsBySports = (selectedSports: Array<SportTypes>) => {
export const useTournamentsBySports = (selectedSports: Array<number>) => {
const [tournamentsBySports, setTournamentsBySports] = useState<TournamentsBySports>({})
const {

@ -5,7 +5,6 @@ import { getProfileColor } from 'requests/getProfileColor'
import { usePageParams } from 'hooks/usePageParams'
import { getColor } from 'helpers/getColor'
import { SportTypes } from 'config'
import { client } from 'config/clients'
import { DEFAULT_HEADER_COLOR } from './styled'
@ -36,7 +35,7 @@ export const useProfileColor = (profileId?: number) => {
]
if (
client.name === 'facr'
&& sportType === SportTypes.FOOTBALL && profileId && prifileWithConfifColor.includes(profileId)
&& sportType === 1 && profileId && prifileWithConfifColor.includes(profileId)
) {
return getColor(profileId)
}

@ -4,7 +4,6 @@ import { Link } from 'react-router-dom'
import {
PAGES,
SportTypes,
ProfileTypes,
} from 'config'
@ -53,7 +52,7 @@ export const ProfileHeader = ({
const color = useProfileColor(profileId)
// @ts-ignore
const imageHeader = Boolean(profileWithImage[profileId])
&& sportType === SportTypes.FOOTBALL
&& sportType === 1
&& profileType === ProfileTypes.TOURNAMENTS ? `/images/${profileId}` : headerImage
return (

@ -1,28 +1,54 @@
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes, querieKeys } from 'config'
import { getProfileUrl } from '..'
it('returns correct profile urls', () => {
localStorage.setItem(querieKeys.sportsList, JSON.stringify({
1: {
id: 1,
lexic: 12980,
name_eng: 'football',
name_rus: 'футбол',
},
2: {
id: 2,
lexic: 6959,
name_eng: 'hockey',
name_rus: 'хоккей',
},
3: {
id: 3,
lexic: 3556,
name_eng: 'basketball',
name_rus: 'баскетбол',
},
4: {
id: 4,
lexic: 20000,
name_eng: 'tennis',
name_rus: 'теннис',
},
}))
expect(getProfileUrl({
id: 1,
profileType: ProfileTypes.PLAYERS,
sportType: SportTypes.FOOTBALL,
sportType: 1,
})).toBe('/football/players/1')
expect(getProfileUrl({
id: 2,
profileType: ProfileTypes.TEAMS,
sportType: SportTypes.BASKETBALL,
})).toBe('/basketball/teams/2')
sportType: 2,
})).toBe('/hockey/teams/2')
expect(getProfileUrl({
id: 3,
profileType: ProfileTypes.TOURNAMENTS,
sportType: SportTypes.HOCKEY,
})).toBe('/hockey/tournaments/3')
sportType: 3,
})).toBe('/basketball/tournaments/3')
expect(getProfileUrl({
id: 4,
profileType: ProfileTypes.TOURNAMENTS,
sportType: SportTypes.HANDBALL,
})).toBe('/handball/tournaments/4')
sportType: 4,
})).toBe('/tennis/tournaments/4')
})

@ -1,20 +1,24 @@
import {
SportTypes,
ProfileTypes,
SPORT_NAMES,
PROFILE_NAMES,
querieKeys,
} from 'config'
type Args = {
id: number,
profileType: ProfileTypes,
sportType: SportTypes,
sportType: number,
}
export const getProfileUrl = ({
id,
profileType,
sportType,
}: Args) => (
`/${SPORT_NAMES[sportType]}/${PROFILE_NAMES[profileType]}/${id}`
)
}: Args) => {
const sportList = JSON.parse(localStorage.getItem(querieKeys.sportsList)!)
return (
sportList && `/${sportList[sportType]?.name_eng}/${PROFILE_NAMES[profileType]}/${id}`
)
}

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
import styled, { css } from 'styled-components'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import { getProfileUrl } from './helpers'
@ -14,7 +14,7 @@ type Props = {
id: number,
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void,
profileType: ProfileTypes,
sportType: SportTypes,
sportType: number,
target?: string,
}

@ -4,7 +4,7 @@ import {
useState,
} from 'react'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import {
getProfileFallbackLogo,
@ -25,7 +25,7 @@ type ProfileImageProps = {
onLoad?: () => void,
prefix?: string,
profileType: ProfileTypes,
sportType: SportTypes,
sportType: number,
title?: string,
}

@ -1,27 +0,0 @@
import styled from 'styled-components/macro'
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
type IconProps = {
src: string,
}
const Icon = styled.span<IconProps>`
display: inline-block;
height: 10px;
min-width: 10px;
background-image: url(/images/${({ src }) => `${src}-icon`}.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
`
type Props = {
sport: SportTypes,
}
export const SportIcon = ({ sport }: Props) => (
<Icon src={getSportLexic(sport)} />
)

@ -1,6 +1,6 @@
import { T9n } from 'features/T9n'
import type { SportsType } from 'features/SportsFilter'
import { getSport } from 'helpers'
import {
Arrows,
ScSportsFilter,
@ -11,20 +11,23 @@ type SportsFilterProps = {
onModalOpen: () => void,
open: boolean,
sport: Array<string>,
sports: SportsType,
}
export const SelectSport = ({
onModalOpen,
open,
sport,
sports,
}: SportsFilterProps) => (
<ScSportsFilter onClick={onModalOpen}>
<ScFilterTitle opacity={sport[0] === 'all_sports' ? 0.5 : 1}>
<T9n t={sports[sport[0] as keyof typeof sports]} />
<T9n t={
sport[0] === 'all_sports'
? 'all_sports'
: getSport({ sportName: sport[0] }).lexic
}
/>
</ScFilterTitle>
&nbsp;
&nbsp;
{sport.length > 1 ? `+ ${sport.length - 1}` : ''}
<Arrows active={open} />
</ScSportsFilter>

@ -1,9 +1,8 @@
import { T9n } from 'features/T9n'
import type { SportsType } from 'features/SportsFilter'
import { isMobileDevice } from 'config/userAgent'
import { getSportLexic } from 'helpers/getSportLexic'
import { getSport, getSportLexic } from 'helpers/getSportLexic'
import {
ScBody,
@ -20,19 +19,18 @@ type Props = {
onSportClick: (sport: string) => void,
selectedSport: Array<string>,
sportIds: Array<number>,
sports: SportsType,
}
export const SelectSportPopup = ({
isOpen,
onModalClose,
onSportClick,
selectedSport,
sportIds,
sports,
}: Props) => {
const sportNames = sportIds?.map((id) => String(getSportLexic(Number(id))))
sportNames?.unshift('all_sports')
// TODO: переделать на вариант без указания all_sports
return (
<>
<ScModal
@ -55,7 +53,7 @@ export const SelectSportPopup = ({
active={selectedSport.indexOf(sport) >= 0}
>
<ScSportName>
<T9n t={sports[sport as keyof typeof sports]} />
<T9n t={getSport({ sportName: sport })?.lexic ?? 'all_sports'} />
</ScSportName>
</ScSport>
))}

@ -5,17 +5,6 @@ import { useHeaderFiltersStore } from 'features/HeaderFilters'
import { SelectSport } from './components/SelectSport'
import { SelectSportPopup } from './components/SelectSportPopup'
const sports = {
all_sports: 'all_sports',
basketball: 'basketball',
football: 'football_popup',
handball: 'handball',
hockey: 'hockey_popup',
volleyball: 'volleyball',
}
export type SportsType = typeof sports
export const SportsFilter = () => {
const {
isShowTournament,
@ -25,6 +14,7 @@ export const SportsFilter = () => {
setSelectedSport,
sportIds,
} = useHeaderFiltersStore()
const [isOpen, setIsOpen] = useState(false)
const onSportClick = (sport: string) => {
@ -54,7 +44,6 @@ export const SportsFilter = () => {
onModalOpen={onModalOpen}
open={isOpen}
sport={selectedSport}
sports={sports}
/>
<SelectSportPopup
onSportClick={onSportClick}
@ -62,7 +51,6 @@ export const SportsFilter = () => {
onModalClose={onModalClose}
selectedSport={selectedSport}
sportIds={sportIds}
sports={sports}
/>
</>
)

@ -13,7 +13,7 @@ it('return correct progress and width lengthes', () => {
let expected = {
...chapter,
loaded: 100,
played: 100,
played: 50,
width: 25,
}
expect(calculateChapterStyles({
@ -34,7 +34,7 @@ it('return correct progress and width lengthes', () => {
expected = {
...chapter,
loaded: 50,
played: 50,
played: 25,
width: 50,
}
expect(calculateChapterStyles({

@ -81,9 +81,7 @@ export const CollapseTournament = ({
<FirstInfo>
<SportWrapper>
<SportIcon
size='0.65rem'
fill='#ffffff'
sport={sportType}
sportType={sportType}
/>
{sportInfo && (
<Tooltip>

@ -50,9 +50,7 @@ export const TournamentMobile = ({
{!isLffClient && (
<Fragment>
<SportIcon
size={10}
fill={open ? '#ffffff' : ''}
sport={sportType}
sportType={sportType}
/>
<CountryFlag
src={`${URL_AWS}/media/flags/${countryId}.png`}

@ -2,7 +2,7 @@ import { useMemo } from 'react'
import orderBy from 'lodash/orderBy'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import { TournamentListProps } from 'features/TournamentList'
import type { Match } from 'features/Matches'
import { useHeaderFiltersStore } from 'features/HeaderFilters'
@ -13,7 +13,7 @@ interface TournamentsSortProps {
isFavorite: boolean,
isLive: boolean,
isSuperTournament: boolean,
sportType: SportTypes,
sportType: number,
}
export const useTournaments = (matches: Array<Match>) => {

@ -1,18 +1,14 @@
import { Fragment } from 'react'
import { SportIcon } from 'components/SportIcon/SportIcon'
import { Name } from 'features/Name'
import { T9n } from 'features/T9n'
import { useUserFavoritesStore } from 'features/UserFavorites/store'
import {
ProfileTypes,
SportTypes,
URL_AWS,
} from 'config'
import { isLffClient } from 'config/clients'
import { isMobileDevice } from 'config/userAgent'
import { usePageParams } from 'hooks/usePageParams'
@ -20,6 +16,8 @@ import { TournamentType, SportInfo } from 'requests'
import { isMatchPage } from 'helpers/isMatchPage'
import { SportIcon } from 'components/SportIcon/SportIcon'
import {
CountryFlag,
CountryWrapper,
@ -30,6 +28,7 @@ import {
Tooltip,
Wrapper,
} from './styled'
import {
Time,
MatchDate,
@ -41,7 +40,7 @@ type Props = {
countryInfo?: TournamentType,
date?: string | null,
sportInfo?: SportInfo,
sportType?: SportTypes,
sportType?: number,
time?: string | null,
tournament: TournamentType,
}
@ -65,10 +64,7 @@ export const TournamentSubtitle = ({
{!isLffClient && (
<Fragment>
<SportWrapper>
<SportIcon
size={isMobileDevice ? 10 : '0.65rem'}
sport={sportType ?? sportTypeFromUrl}
/>
<SportIcon sportType={sportType ?? sportTypeFromUrl} />
{sportInfo && (
<Tooltip>
<T9n t={sportInfo.lexic} />

@ -71,12 +71,6 @@ export const CountryFlag = styled.img`
: ''}
`
export const NameSignWrapper = styled.div`
display: flex;
max-width: 90%;
align-items: center;
`
type StyledLinkProps = {
isLeftSide?: boolean,
isMatchPage?: boolean,

@ -1,5 +1,5 @@
import { T9n } from 'features/T9n'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import { Wrapper } from 'features/PreferencesPopup/styled'
@ -45,7 +45,7 @@ export const TournamentsPopup = () => {
<StyledLink
id={tournament.id}
profileType={ProfileTypes.TOURNAMENTS}
sportType={SportTypes.FOOTBALL}
sportType={1}
onClick={close}
key={tournament.id}
>
@ -63,7 +63,7 @@ export const TournamentsPopup = () => {
<StyledLink
id={team.id}
profileType={ProfileTypes.TEAMS}
sportType={SportTypes.FOOTBALL}
sportType={1}
onClick={close}
key={team.id}
>

@ -1,8 +1,6 @@
import isEmpty from 'lodash/isEmpty'
import map from 'lodash/map'
import { SportTypes } from 'config'
import type { MatchSubscriptions } from '../PageSubscriptions'
import { InlineButton } from '../../styled'
import {
@ -20,7 +18,7 @@ import {
type Props = {
list: MatchSubscriptions,
sport: SportTypes,
sport: number,
}
export const UserSubscriptionsList = ({ list, sport }: Props) => {

@ -20,7 +20,7 @@ import {
import { useToggle } from 'hooks/useToggle'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import { useAuthStore } from '../../AuthStore'
@ -36,7 +36,7 @@ type ProfileType = {
}
export type SuperTournament = ObjectWithName & {
sport: SportTypes,
sport: number,
type: ProfileTypes,
}

@ -0,0 +1,10 @@
export const getLocalStorageItem = (key: string) => {
const item = localStorage.getItem(key)!
return JSON.parse(item)
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const setLocalStorageItem = (key: string, value: any) => {
localStorage.setItem(key, JSON.stringify(value))
}

@ -1,4 +1,4 @@
import { SportTypes, ProfileTypes } from 'config'
import { ProfileTypes } from 'config'
import { getProfileLogo } from '..'
@ -7,19 +7,19 @@ describe('getLogo helper', () => {
expect(getProfileLogo({
id: 1,
profileType: ProfileTypes.PLAYERS,
sportType: SportTypes.FOOTBALL,
sportType: 1,
})).toBe('https://cf-aws.insports.tv/media/players/1/1/photo.png')
expect(getProfileLogo({
id: 1,
profileType: ProfileTypes.TEAMS,
sportType: SportTypes.BASKETBALL,
sportType: 3,
})).toBe('https://cf-aws.insports.tv/media/teams/3/1/logo.jpg')
expect(getProfileLogo({
id: 1,
profileType: ProfileTypes.TOURNAMENTS,
sportType: SportTypes.HOCKEY,
sportType: 2,
})).toBe('https://cf-aws.insports.tv/media/tournaments/2/1/logo.jpg')
})
})

@ -1,14 +1,14 @@
import {
PROFILE_NAMES,
ProfileTypes,
SportTypes,
URL_AWS,
} from 'config'
type GetLogoArgs = {
id: number,
profileType: ProfileTypes,
sportType: SportTypes,
sportType: number,
}
export const getProfileLogo = ({

@ -1,3 +1,37 @@
import { SportTypes, SPORT_NAMES } from 'config'
import { querieKeys } from 'config'
export const getSportLexic = (sport: SportTypes) => SPORT_NAMES[sport]
import type { Sport } from 'requests/getSportList'
import type { SportsType } from 'features/App/hooks'
import { getLocalStorageItem } from 'helpers/getLocalStorage'
type SportNameType = {
id?: number,
sportName: string,
}
type SportIdType = {
id: number,
sportName?: string,
}
export type SportProps = SportNameType | SportIdType
export const getSportLexic = (sport: number) => {
const sportList = getLocalStorageItem(querieKeys.sportsList)
return sportList && sportList[sport]?.name_eng.toLowerCase()
}
export const getSport = ({ id, sportName }: SportProps) => {
const sportList = getLocalStorageItem(querieKeys.sportsList)
if (sportName) {
const sport = sportList && Object.values(sportList as SportsType)
?.find(
(currentSport: Sport) => currentSport.name_eng.toLowerCase() === sportName.toLowerCase(),
)
return sport
}
return id && sportList[id]
}

@ -1,12 +1,11 @@
import includes from 'lodash/includes'
import { client } from 'config/clients'
import { SportTypes } from 'config/sportTypes'
import { lffTournamentsList } from 'config/lffTournaments'
export const isPermittedTournament = (
tournamentId: number,
sportType: SportTypes,
sportType: number,
) => {
if (client.name !== 'lff') {
return true

@ -2,7 +2,8 @@ import { useRouteMatch } from 'react-router'
import toUpper from 'lodash/toUpper'
import { ProfileTypes, SportTypes } from 'config'
import { ProfileTypes } from 'config'
import { getSport } from '../helpers'
type RouteParams = {
pageId: string,
@ -18,11 +19,12 @@ export const usePageParams = () => {
sportName,
},
} = useRouteMatch<RouteParams>('/:sportName/:profileName/:pageId') || { params: {} }
const sportType = sportName && getSport({ sportName })?.id
return {
profileId: Number(pageId),
profileType: ProfileTypes[toUpper(profileName) as keyof typeof ProfileTypes],
sportName,
sportType: SportTypes[toUpper(sportName) as keyof typeof SportTypes],
sportType,
}
}

@ -1,16 +1,10 @@
export { Arrow } from './objects/Arrow'
export { Boxing } from './objects/Boxing'
export { Date } from './objects/Date'
export { Edit } from './objects/Edit'
export { ExclamationPoint } from './objects/ExclamationPoint'
export { Calendar } from './objects/Calendar'
export { Check } from './objects/Check'
export { CheckCircle } from './objects/CheckCircle'
export { Basketball } from './objects/Basketball'
export { Football } from './objects/Football'
export { Hockey } from './objects/Hockey'
export { Handball } from './objects/Handball'
export { Volleyball } from './objects/Volleyball'
export { Search } from './objects/Search'
export { Sound } from './objects/Sound'
export { Star } from './objects/Star'
@ -20,6 +14,3 @@ export { PiP } from './objects/PiP'
export { PoweredByInstat } from './objects/PoweredByInstat'
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'

@ -1,20 +0,0 @@
export const Baseball = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='24'
height='24'
fill='none'
viewBox='0 0 24 24'
>
<g fill='#fff' clipPath='url(#clip0_44293_325999)'>
<path d='M11.64 18.12c-.328.36-.646.704-.961 1.051-.266.292-.266.294-.027.614.67.896 1.343 1.79 2.011 2.689.333.447.274 1.006-.128 1.325-.416.33-.964.25-1.305-.201a811.64 811.64 0 01-2.692-3.595c-.273-.367-.28-.749-.037-1.138.472-.756.945-1.512 1.423-2.264a.377.377 0 00.043-.356c-.354-1.124-.704-2.25-1.037-3.38-.056-.194-.136-.23-.317-.226-1.507.034-2.872-.413-4.106-1.29-.36-.257-.583-.58-.483-1.052.139-.657.877-.949 1.411-.547a5.15 5.15 0 002.352 1.001c.499.075.997.069 1.491-.035a.512.512 0 00.219-.127 2.037 2.037 0 013.32.87c.37 1.118.69 2.254 1.028 3.384.108.358.058.719.03 1.088-.027.378.027.77.096 1.147.367 1.99 1.408 3.58 2.854 4.924.108.1.22.198.328.297.378.344.442.874.155 1.265-.294.4-.821.492-1.248.2-1.96-1.34-3.464-3.06-4.287-5.349-.027-.077-.059-.152-.09-.227-.004-.012-.013-.022-.042-.067z' />
<path d='M6.18 9.688l-.977-.603c.038-.146.082-.329.132-.51L7.523.705c.152-.547.618-.82 1.119-.66.477.152.717.668.537 1.187-.337.972-.684 1.94-1.027 2.91l-1.89 5.34c-.022.064-.049.125-.081.206zM7.974 7.697c-.06-.93.706-1.88 1.623-2.041 1.042-.184 1.958.361 2.326 1.373a.352.352 0 00.179.184c.294.12.595.222.896.331-.024.154-.056.242-.227.232a37.841 37.841 0 00-1.773-.076c-.93-.012-1.863-.003-2.795-.003h-.23.001zM11.954 8.16c-.075.833-.968 1.58-1.907 1.604-.974.025-1.899-.707-2.018-1.605h3.925zM17.964 13.288c-.577 0-1.045-.48-1.038-1.064.007-.579.472-1.05 1.036-1.05.572-.001 1.043.484 1.037 1.068a1.043 1.043 0 01-1.035 1.046zM4.42 11.861c.268.157.505.293.738.436.032.02.066.072.064.107a.488.488 0 01-.513.44.433.433 0 01-.4-.506c.02-.152.07-.301.11-.476z' />
</g>
<defs>
<clipPath id='clip0_44293_325999'>
<path fill='#fff' d='M0 0H15V24H0z' transform='translate(4)' />
</clipPath>
</defs>
</svg>
)

@ -1,17 +0,0 @@
export const Basketball = () => (
<svg
width='24'
height='24'
viewBox='0 0 15 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M7.01759 0.748527C6.8893 0.772294 6.65772 0.866018 6.53712 0.942975C6.25879 1.12056 6.04865 1.43247 5.97725 1.77403C5.9326 1.98767 5.93238 2.07405 5.97605 2.28008C6.02596 2.51553 6.12685 2.70437 6.30263 2.89123C6.56679 3.17208 6.98126 3.33239 7.34541 3.29459C7.98753 3.22794 8.45867 2.7382 8.50217 2.09224C8.54113 1.51327 8.19326 0.996923 7.63476 0.804776C7.49871 0.757975 7.14201 0.725444 7.01759 0.748527ZM5.88683 3.40004C5.81017 3.42454 5.69451 3.4838 5.62982 3.53171C5.56515 3.57958 4.85604 4.27765 4.05401 5.08296C2.72721 6.41517 2.58771 6.56282 2.50623 6.72123C2.38122 6.96427 2.33408 7.18202 2.35014 7.44187C2.37138 7.78561 2.49122 8.05119 2.74716 8.32174C2.81719 8.39578 3.10602 8.73861 3.38901 9.0836L3.90352 9.71083L3.38247 10.8627C3.09589 11.4963 2.8424 12.0719 2.81915 12.1419C2.70019 12.5001 2.88284 12.9146 3.23881 13.0944C3.39552 13.1735 3.65814 13.1905 3.832 13.1327C3.98572 13.0817 4.16149 12.949 4.23982 12.8249C4.34341 12.6608 5.52885 10.0324 5.58735 9.83701C5.6339 9.68163 5.63983 9.62509 5.6234 9.49264C5.61258 9.4055 5.58595 9.29978 5.56419 9.25771L5.52466 9.18124L6.03247 9.38966C6.31176 9.50429 6.57952 9.61417 6.62749 9.63385L6.71468 9.66964L7.05134 11.1191C7.23651 11.9163 7.4055 12.6236 7.4269 12.691C7.48011 12.8584 7.55761 12.9748 7.68577 13.0799C8.25306 13.5447 9.10781 13.0396 8.97676 12.317C8.90514 11.922 8.16504 8.82889 8.11843 8.7297C8.01666 8.5132 7.85633 8.39955 7.36874 8.19827C5.89395 7.58952 5.56904 7.45025 5.57266 7.42831C5.57486 7.41485 5.99588 6.97193 6.50824 6.44408L7.4398 5.48432L8.40974 6.13635C8.9432 6.49497 9.62749 6.95539 9.9304 7.1595C10.2333 7.36364 10.524 7.5448 10.5765 7.56211C10.7126 7.60702 10.9347 7.58157 11.0625 7.5064C11.1998 7.42562 11.2632 7.35473 11.3269 7.21088C11.4323 6.97252 11.3795 6.6903 11.1974 6.51881C11.1535 6.47746 10.1037 5.76581 8.86441 4.93735C7.1705 3.80492 6.57858 3.42136 6.47955 3.39194C6.30764 3.3409 6.06125 3.34426 5.88683 3.40004ZM10.7137 8.71573C10.5147 8.73964 10.3259 8.82078 10.1639 8.95188C9.33611 9.62195 9.79837 10.9434 10.8605 10.9434C11.3071 10.9434 11.6813 10.7092 11.8689 10.3124C12.2507 9.505 11.6023 8.60886 10.7137 8.71573Z'
fill='white'
/>
</svg>
)

@ -1,17 +0,0 @@
export const Boxing = () => (
<svg
width='24'
height='24'
viewBox='0 0 14 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M7.04976 1.22904C6.91401 1.25174 6.70287 1.33604 6.57539 1.41844C6.22021 1.64801 6.01868 1.99599 5.99365 2.42289C5.94548 3.24462 6.70305 3.9044 7.5019 3.73645C8.19407 3.59091 8.64991 2.9204 8.51013 2.25334C8.40257 1.73993 8.01122 1.34426 7.50644 1.23853C7.3906 1.21428 7.16601 1.20962 7.04976 1.22904ZM11.4173 3.79211C11.3637 3.80264 11.2773 3.83154 11.2251 3.85629C11.1579 3.88819 11.0699 3.90365 10.9233 3.90933C10.7412 3.91638 10.7048 3.92504 10.6194 3.98153L10.5224 4.04573L9.17605 3.96225C8.43555 3.91633 7.62115 3.86298 7.36626 3.8437C6.7462 3.79677 6.33551 3.79706 6.13675 3.84458C5.76053 3.93453 5.40382 4.21883 5.22337 4.57249C5.19776 4.62275 5.06038 4.96331 4.91812 5.32929C4.77585 5.69529 4.56014 6.21855 4.43872 6.49209C4.16204 7.11549 4.1348 7.19357 4.11151 7.43026C4.09693 7.5787 4.02002 7.85642 3.7735 8.65102L3.45436 9.67962L3.07606 10.0526C2.86799 10.2578 2.41296 10.689 2.06489 11.0108C1.71682 11.3326 1.39813 11.6327 1.35672 11.6777C1.24036 11.804 1.18775 11.9384 1.19053 12.1022C1.19352 12.2765 1.23222 12.3719 1.35328 12.5033C1.52715 12.6919 1.8154 12.7477 2.04393 12.637C2.17406 12.5739 4.06465 11.1571 4.43908 10.8421C4.53876 10.7583 4.65199 10.6455 4.69072 10.5915C4.80515 10.4321 4.9747 10.0942 5.18567 9.60513C5.30982 9.3173 5.39428 9.14882 5.41228 9.153C5.42808 9.15666 5.81689 9.40344 6.2763 9.70139L7.11162 10.2431L7.26439 10.7187C7.3484 10.9802 7.49588 11.4645 7.5921 11.7947C7.68831 12.125 7.78018 12.42 7.79623 12.4503C7.89704 12.6406 8.07516 12.7582 8.29614 12.7803C8.59499 12.8102 8.87448 12.5889 8.92171 12.2849C8.94456 12.1377 8.91463 11.9096 8.72218 10.7647C8.50857 9.49398 8.47636 9.39783 8.16536 9.10256C8.02074 8.96525 6.90703 8.03268 6.82921 7.98372C6.82603 7.98171 6.92622 7.71648 7.05189 7.39432C7.17754 7.07217 7.28962 6.78471 7.30097 6.75552C7.32116 6.70357 7.32448 6.70515 7.46157 6.83209C7.53856 6.90337 7.63763 6.97702 7.68171 6.99579C7.79987 7.04602 7.98453 7.03702 8.21303 6.96983C8.32439 6.9371 8.44948 6.91031 8.49096 6.91031C8.53246 6.91031 8.63169 6.89392 8.71146 6.87387C8.82522 6.84529 8.87204 6.84285 8.9286 6.86256C9.10527 6.92417 9.50019 6.85431 9.69994 6.72611C10.1117 6.46191 10.164 5.85539 9.80411 5.51876C9.74314 5.46172 9.64543 5.39393 9.58697 5.36806C9.31669 5.2485 8.87489 5.31928 8.6358 5.52045C8.59077 5.55834 8.4998 5.5953 8.38267 5.62327C8.28212 5.6473 8.19635 5.66695 8.1921 5.66695C8.17388 5.66695 7.88449 5.25419 7.89521 5.24348C7.90556 5.23312 10.1083 5.08756 10.4068 5.0775C10.4939 5.07456 10.5455 5.08831 10.6314 5.13723C10.724 5.1899 10.7761 5.20229 10.9366 5.20979C11.0654 5.21581 11.1757 5.23618 11.2659 5.27061C11.5195 5.36743 11.87 5.36126 12.0756 5.25636C12.4563 5.06213 12.6141 4.58287 12.4221 4.20391C12.3356 4.03314 12.1427 3.8692 11.9631 3.81372C11.8078 3.76575 11.5941 3.7573 11.4173 3.79211Z'
fill='white'
/>
</svg>
)

@ -1,17 +0,0 @@
export const Football = () => (
<svg
width='24'
height='24'
viewBox='0 0 14 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M8.65501 0.0199196C8.14978 0.107846 7.75489 0.456715 7.60789 0.945024C7.56524 1.08672 7.56125 1.42898 7.60066 1.5666C7.73701 2.04276 8.08774 2.38165 8.56737 2.5007C8.69483 2.53233 8.72648 2.53487 8.92221 2.52908C9.16952 2.52175 9.28095 2.49679 9.46537 2.40736C9.74577 2.27141 9.9331 2.09048 10.0696 1.82386C10.1713 1.62524 10.1955 1.51777 10.1952 1.26588C10.195 1.07292 10.1912 1.04039 10.1558 0.928354C10.0821 0.695572 9.98681 0.540137 9.81558 0.373666C9.51261 0.0790931 9.07733 -0.0535823 8.65501 0.0199196ZM6.93568 2.91167C6.90022 2.91762 6.78001 2.95074 6.66855 2.98527C6.43099 3.05885 6.26605 3.09284 5.96147 3.13096C5.42502 3.19809 4.77887 3.23308 3.64771 3.25625C3.12298 3.267 2.90742 3.27623 2.84184 3.29072C2.63522 3.33641 2.46778 3.46069 2.37887 3.6344C2.33144 3.72708 2.32966 3.73628 2.32966 3.88928C2.32966 4.03401 2.33317 4.05521 2.36944 4.12971C2.44949 4.29406 2.58394 4.40626 2.77823 4.47081C2.87015 4.50135 2.89078 4.5026 3.28238 4.50116C3.50695 4.50033 3.8422 4.49246 4.02737 4.48366C4.49545 4.46141 5.12562 4.42812 5.19857 4.42179C5.23205 4.41887 5.25946 4.42147 5.25946 4.42756C5.25946 4.43363 4.9497 5.02651 4.57112 5.74504C3.195 8.3568 2.12234 10.4303 2.07101 10.5778C1.95423 10.9134 1.98121 11.1466 2.15404 11.2954C2.25763 11.3846 2.28039 11.4001 2.36423 11.4379C2.43605 11.4703 2.46119 11.474 2.60903 11.474C2.76668 11.474 2.778 11.472 2.87152 11.428C3.0035 11.366 3.14765 11.2323 3.25909 11.0687C3.30854 10.9961 3.73132 10.3725 4.19861 9.68292C4.66591 8.99337 5.0647 8.41455 5.08483 8.39669C5.11506 8.36983 5.13231 8.36536 5.18387 8.37094C5.26115 8.37931 5.30244 8.41319 5.30244 8.46822C5.30244 8.49284 5.03231 9.10713 4.64148 9.97125C4.27796 10.775 3.84937 11.7228 3.6891 12.0775C3.52882 12.4321 3.38439 12.7637 3.36816 12.8142C3.30655 13.006 3.30705 13.2146 3.3695 13.3751C3.41539 13.493 3.54357 13.6124 3.68442 13.6684C3.89191 13.7508 4.07333 13.7539 4.2318 13.6777C4.37884 13.6069 4.46638 13.5134 4.57935 13.3064C4.61655 13.2382 4.86452 12.7887 5.13036 12.3075C6.75693 9.36356 8.03554 6.99094 8.58651 5.89417C8.73116 5.60622 8.85597 5.35593 8.86385 5.33795C8.87777 5.30625 8.88108 5.30826 8.97623 5.40684C9.21184 5.65097 9.36519 5.93084 9.43696 6.24772C9.44954 6.30332 9.46335 6.43344 9.46762 6.53686C9.48091 6.85808 9.43031 7.13294 9.28156 7.54744L9.19256 7.79543L9.19234 7.96765C9.19214 8.13232 9.19409 8.14386 9.23709 8.23111C9.29552 8.34973 9.36389 8.42095 9.47482 8.4788C9.55995 8.52319 9.57209 8.52563 9.70819 8.52563C9.84127 8.52563 9.85868 8.52235 9.9465 8.48077C10.0782 8.41843 10.2112 8.28111 10.2863 8.12986C10.4565 7.78722 10.6517 7.09794 10.7106 6.63167C10.7388 6.40792 10.7387 5.99161 10.7103 5.78121C10.6018 4.97668 10.1618 4.33003 9.37838 3.8241C9.21365 3.71772 8.97313 3.58539 8.80663 3.50955C8.73497 3.4769 8.61508 3.41085 8.54024 3.36277C8.02595 3.03237 7.34951 2.8422 6.93568 2.91167ZM7.11632 11.4054C6.76268 11.4804 6.45746 11.6751 6.26398 11.9493C5.88722 12.4831 5.96375 13.1885 6.44654 13.632C6.91165 14.0593 7.60486 14.1211 8.13713 13.7826C8.26751 13.6997 8.43099 13.5471 8.5119 13.4328C8.58646 13.3275 8.67954 13.1243 8.71503 12.9895C8.76274 12.8082 8.75999 12.5596 8.70817 12.3695C8.57302 11.8736 8.16007 11.4998 7.64156 11.4039C7.51248 11.38 7.23235 11.3808 7.11632 11.4054Z'
fill='white'
/>
</svg>
)

@ -1,17 +0,0 @@
export const Handball = () => (
<svg
width='24'
height='24'
viewBox='0 0 14 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M4.0262 0.0159581C3.4822 0.11258 3.02783 0.497398 2.87492 0.990986C2.82574 1.14976 2.8258 1.5144 2.87503 1.69851C2.95838 2.01013 3.12671 2.23787 3.43262 2.4529C3.67373 2.62236 3.89346 2.69378 4.21145 2.70602C4.6238 2.72189 4.98326 2.59814 5.27197 2.34094C5.42362 2.20585 5.50922 2.09559 5.59771 1.92132C5.86354 1.39785 5.74878 0.814876 5.29748 0.396388C5.03218 0.150381 4.69578 0.0135286 4.32636 0.0013668C4.20408 -0.0026633 4.10354 0.00222427 4.0262 0.0159581ZM7.65102 1.89606C7.05376 1.98285 6.58837 2.41045 6.49338 2.9597C6.46739 3.1099 6.48285 3.38637 6.52491 3.52412C6.65086 3.93662 7.05143 4.30204 7.49781 4.41164C7.56844 4.42898 7.6918 4.44485 7.7889 4.4491C8.43669 4.47744 9.02061 4.07366 9.18633 3.4828C9.23361 3.31425 9.23996 3.0597 9.20071 2.90677C9.0738 2.41238 8.68526 2.03753 8.17631 1.91847C8.05374 1.8898 7.77571 1.87794 7.65102 1.89606ZM2.8632 2.66279C2.79436 2.67354 2.67336 2.71328 2.58732 2.7534C2.24 2.91532 2.0216 3.24576 2.02087 3.61042C2.02059 3.74179 2.04602 3.88214 2.14423 4.29124C2.3139 4.99804 2.42911 5.30823 2.61924 5.57023C2.72945 5.72207 2.98983 5.9599 3.16196 6.06593C3.33588 6.17307 3.77301 6.38484 4.306 6.62015C4.50569 6.70833 4.71606 6.80911 4.7735 6.84411C5.08444 7.03365 5.20306 7.27449 5.11645 7.54045C5.08902 7.62471 5.06602 7.66015 4.97926 7.75185C4.72455 8.02109 4.03815 8.70552 2.64014 10.0843C0.770704 11.928 0.216926 12.4811 0.142344 12.5789C0.0569902 12.6909 0.0118545 12.8382 0.00250872 13.0354C-0.00746525 13.2456 0.0101845 13.3332 0.0939751 13.4894C0.210583 13.7067 0.447553 13.8836 0.68319 13.9293C0.801806 13.9522 1.08626 13.9399 1.18555 13.9076C1.36761 13.8482 1.48278 13.7498 3.37645 12.035C4.89432 10.6605 4.88502 10.6683 5.14549 10.5501L5.30583 10.4773H5.55948H5.81314L5.92006 10.5262C6.05438 10.5876 6.20837 10.7287 6.27236 10.8489C6.31542 10.9298 6.31795 10.9442 6.31758 11.1061C6.31683 11.4334 6.26148 11.5215 5.64442 12.178C5.05038 12.81 5.01179 12.8776 5.02647 13.2599C5.03368 13.448 5.05222 13.5015 5.16167 13.65C5.32898 13.8768 5.61977 14.0002 5.98654 14C6.37646 13.9998 6.50854 13.9322 7.55909 13.1955C8.16579 12.7701 8.27424 12.6762 8.45606 12.4189C8.56093 12.2705 8.71926 11.9933 8.77647 11.8579C8.82821 11.7355 8.91805 11.2131 9.1061 9.9414C9.30437 8.60058 9.33156 8.49937 9.54062 8.32416C9.80231 8.10483 9.99033 8.06439 10.4624 8.12583C10.593 8.14283 11.1274 8.2234 11.6498 8.30489C13.1513 8.53908 13.199 8.54185 13.4883 8.41171C13.6528 8.33771 13.7703 8.24774 13.8627 8.12494C13.9871 7.95969 14.0051 7.8986 13.999 7.66196L13.9937 7.46189L13.9357 7.36039C13.8142 7.14811 13.6279 6.99758 13.4003 6.92773C13.0013 6.80531 11.7985 6.48762 8.06468 5.51849C4.86006 4.68673 5.07727 4.74714 4.86259 4.62792C4.51873 4.43695 4.26032 4.17904 4.11353 3.88028C4.08502 3.82226 4.01531 3.64937 3.95861 3.49609C3.81232 3.10062 3.76198 3.00747 3.63365 2.89475C3.50883 2.78511 3.38214 2.71941 3.22177 2.68114C3.11303 2.6552 2.96147 2.64744 2.8632 2.66279Z'
fill='white'
/>
</svg>
)

@ -1,17 +0,0 @@
export const Hockey = () => (
<svg
width='24'
height='24'
viewBox='0 0 14 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M6.66465 0.0401677C6.18456 0.154926 5.79914 0.572104 5.68577 1.0997C5.6463 1.28339 5.6463 1.56636 5.68577 1.75005C5.76212 2.10534 5.9594 2.41197 6.2428 2.61583C6.65397 2.9116 7.21797 2.9116 7.62914 2.61583C7.91254 2.41197 8.10982 2.10534 8.18617 1.75005C8.22564 1.56636 8.22564 1.28339 8.18617 1.0997C8.07137 0.565455 7.68517 0.151163 7.1974 0.0390356C7.05978 0.00740003 6.79942 0.00795812 6.66465 0.0401677ZM5.0494 0.809339C4.41123 0.99043 3.89406 1.27569 3.55903 1.6314C3.07757 2.14258 2.88601 2.91106 3.05604 3.64925C3.17208 4.15298 3.47975 4.61914 3.88062 4.8986L3.94099 4.94069L3.79261 5.42829C3.71099 5.69647 3.64104 5.91945 3.63715 5.92377C3.63327 5.92811 3.59289 5.94249 3.54743 5.95574C3.26937 6.03674 3.07042 6.27806 3.024 6.59065C2.99372 6.79455 3.05577 7.04289 3.17619 7.19962C3.20421 7.23609 3.22714 7.27208 3.22714 7.27957C3.22714 7.29686 2.14226 10.8763 2.13435 10.8851C2.13112 10.8887 2.09431 10.879 2.05253 10.8635C1.95923 10.8289 1.79874 10.828 1.71705 10.8615C1.45261 10.9703 0.276507 11.5252 0.22577 11.5652C0.133413 11.6381 0.0585076 11.7556 0.0235202 11.8827C-0.0755964 12.2424 0.149621 12.6138 0.491176 12.6538C0.531037 12.6584 0.596424 12.6544 0.636471 12.6448C0.717251 12.6255 2.07057 12.008 2.16452 11.9476C2.24478 11.896 2.33206 11.7819 2.38162 11.6638C2.40416 11.6101 2.70107 10.6469 3.04142 9.52332L3.66025 7.48053L3.77599 7.47095C3.92929 7.45827 4.4097 7.32323 4.7527 7.19642C5.05736 7.08376 5.46796 6.90549 5.74257 6.76664C6.07972 6.59617 6.07756 6.5948 5.79974 6.80279C5.69362 6.88223 5.55375 7.00225 5.48894 7.06949C5.16115 7.40956 4.94149 7.84131 4.83994 8.34515C4.79808 8.55293 4.78773 8.99145 4.81943 9.21519C4.83241 9.30672 4.926 9.71525 5.02741 10.1231C5.27205 11.1068 5.39408 11.6101 5.43707 11.8125C5.49957 12.107 5.61458 12.2829 5.8178 12.395C6.16925 12.5887 6.57105 12.4354 6.74644 12.0405C6.80332 11.9124 6.80705 11.8955 6.81188 11.7434C6.81676 11.5894 6.81309 11.565 6.73132 11.2073C6.6842 11.0012 6.54438 10.4272 6.42061 9.93171C6.23251 9.17868 6.19453 9.00855 6.18923 8.89526C6.1767 8.62689 6.25036 8.421 6.42798 8.22803C6.51348 8.13517 6.67336 8.01095 7.20038 7.62799L7.86496 7.14509L7.90263 7.18702C7.92334 7.2101 8.84866 8.43444 9.95889 9.90779C11.0691 11.3811 11.9944 12.6031 12.015 12.6233C12.1501 12.7555 12.2996 12.8178 12.4814 12.8178C13.0131 12.8178 13.3436 12.1998 13.0865 11.686C13.0583 11.6297 12.0364 10.2614 10.591 8.34481L8.14323 5.09901L8.23047 4.98403C8.41573 4.73993 8.62703 4.34421 8.73473 4.03967C8.83484 3.75659 8.90121 3.38907 8.90111 3.11825C8.90099 2.76674 8.83954 2.49244 8.79554 2.37277C8.75154 2.2531 8.71005 2.2048 8.6143 2.2048C8.47752 2.2048 8.41939 2.41965 8.41939 2.41965C8.25525 2.75168 8.22991 2.81297 8.05008 2.96262C7.95588 3.041 7.88594 3.06357 7.73207 3.1384C7.57819 3.21323 7.53487 3.23651 7.46534 3.28683C7.29142 3.4127 7.27029 3.87352 7.10741 4.05525C6.78714 4.41254 5.96614 4.96358 5.16373 5.35979C4.78067 5.54893 4.20891 5.78635 4.18928 5.76443C4.18449 5.75909 4.22846 5.59895 4.28702 5.40858L4.39348 5.06244L4.46743 5.04386C4.81609 4.95626 5.05833 4.56049 5.00087 4.17235C4.96632 3.93891 4.84483 3.74489 4.64713 3.60743C4.46183 3.47857 4.37709 3.30933 4.38804 3.09003C4.40122 2.82638 4.53097 2.67666 4.9003 2.49903C5.11214 2.39714 5.42193 2.44735 5.31858 2.16034C5.21366 1.86899 5.17648 1.62872 5.18997 1.3292C5.19818 1.14716 5.18997 1.21488 5.24949 0.997772C5.309 0.780661 5.11098 0.791866 5.0494 0.809339ZM7.04786 12.2917C7.0308 12.2993 6.83451 12.4413 6.61165 12.6073C6.38879 12.7732 6.18601 12.9207 6.16102 12.9351C6.07092 12.9871 6.04145 12.9731 5.86038 12.7921C5.73579 12.6676 5.68321 12.6449 5.58686 12.6739C5.47273 12.7081 5.39844 12.8408 5.42038 12.9712C5.42837 13.0188 5.45742 13.0626 5.55388 13.1726C5.6217 13.2499 5.70798 13.3352 5.74563 13.3621C5.90184 13.474 6.11084 13.5019 6.28783 13.4346C6.35774 13.408 6.50336 13.3088 6.83808 13.0596C7.08844 12.8732 7.30582 12.7016 7.32116 12.6783C7.36168 12.6167 7.36724 12.475 7.33195 12.4036C7.28334 12.3053 7.14169 12.2495 7.04786 12.2917ZM13.2573 12.9292C13.191 12.9515 13.1359 13.0061 13.1118 13.0731C13.0833 13.1526 13.0828 13.2014 13.1095 13.2729C13.1349 13.3406 13.6188 13.9382 13.6689 13.9636C13.7664 14.0132 13.8961 13.971 13.9649 13.8674C14.0049 13.8071 14.0121 13.6843 13.9794 13.6201C13.9651 13.5921 13.8441 13.4349 13.7105 13.2707C13.4277 12.9234 13.3805 12.8878 13.2573 12.9292Z'
fill='white'
/>
</svg>
)

@ -1,20 +0,0 @@
export const Softball = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='24'
height='24'
fill='none'
viewBox='0 0 24 24'
>
<g fill='#fff' clipPath='url(#clip0_44293_325999)'>
<path d='M14.516 5.617c-.375.023-.75.047-1.125.067-.579.032-.584.026-.598-.633 1.019-.144 2.049-.295 3.08-.431.401-.053.806-.093 1.21-.104.649-.017 1.128.37 1.196.97.227 2.006.398 4.018.682 6.016.124.875-.059 1.638-.43 2.413-.404.842-.723 1.721-1.16 2.547-.314.593-.285 1.154-.162 1.767.298 1.481.566 2.968.824 4.456.118.68-.274 1.196-.934 1.3-.638.1-1.197-.305-1.323-.975-.341-1.818-.693-3.634-.997-5.458-.058-.352.007-.758.141-1.096.31-.778.69-1.533 1.062-2.29.08-.161.244-.287.394-.458l-3.652-.254c.07.728.134 1.423.206 2.118.096.946.213 1.89.292 2.837.054.65-.4 1.151-1.036 1.203-.643.052-1.164-.357-1.234-1.019-.206-1.916-.393-3.834-.588-5.75a7.813 7.813 0 00-.038-.31c-.112-.757.4-1.323 1.22-1.282 1.423.073 2.846.183 4.269.277.291.019.583.033.889-.02-.832-.187-1.661-.387-2.498-.556-.286-.058-.382-.176-.403-.441-.054-.675-.154-1.345-.206-2.02-.01-.115.094-.289.202-.35.413-.238.85-.44 1.249-.725-.675.178-1.35.357-2.025.533-.457.119-.913.242-1.374.348-.538.124-1.04-.13-1.16-.633-.308-1.28-.59-2.565-.869-3.852-.096-.444.098-.788.508-1.017-.22-.883-.036-1.361.596-1.573.535-.18 1.146.046 1.388.514.282.546.063 1.034-.673 1.488l.702 3.099 2.39-.633-.014-.073h-.001z' />
<path d='M17.03 1.977c.005 1.093-.945 1.988-2.117 1.995-1.163.008-2.131-.89-2.136-1.98C12.773.9 13.722.006 14.897 0c1.17-.006 2.13.882 2.133 1.977zM8.994 2.716c-.524.862-.07 1.684.063 2.518.029.18.118.355.115.532a.53.53 0 01-.177.38c-.08.061-.278.046-.392-.002-.548-.227-1.085-.474-1.624-.718-.713-.323-.999-.893-.978-1.591.02-.666.384-1.16 1.05-1.427.7-.281 1.328-.116 1.942.308z' />
</g>
<defs>
<clipPath id='clip0_44293_325999'>
<path fill='#fff' d='M0 0H13V24H0z' transform='translate(6)' />
</clipPath>
</defs>
</svg>
)

@ -1,18 +0,0 @@
export const Streetball = () => (
<svg
width='24'
height='24'
viewBox='0 0 15 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M3.27195 1.97538C3.18658 1.9912 3.03247 2.05357 2.95221 2.10478C2.76699 2.22296 2.62715 2.43053 2.57963 2.65783C2.54992 2.8 2.54978 2.85748 2.57884 2.99459C2.61205 3.15127 2.67919 3.27694 2.79616 3.40129C2.97196 3.58819 3.24778 3.69487 3.49011 3.66972C3.91742 3.62536 4.23095 3.29945 4.2599 2.86958C4.28583 2.4843 4.05433 2.14068 3.68266 2.01282C3.59213 1.98167 3.35475 1.96002 3.27195 1.97538ZM2.51946 3.73989C2.46845 3.7562 2.39148 3.79563 2.34843 3.82751C2.30539 3.85937 1.8335 4.32392 1.29977 4.85983C0.416828 5.74637 0.323997 5.84463 0.269771 5.95005C0.186583 6.11178 0.15521 6.25669 0.165896 6.42961C0.180035 6.65836 0.259786 6.8351 0.430104 7.01514C0.476707 7.06441 0.668917 7.29256 0.857234 7.52214L1.19963 7.93954L0.852885 8.7061C0.662173 9.12773 0.493484 9.51078 0.47801 9.55735C0.398845 9.79571 0.520394 10.0716 0.757285 10.1912C0.861567 10.2438 1.03633 10.2551 1.15203 10.2167C1.25433 10.1827 1.3713 10.0944 1.42342 10.0119C1.49236 9.90268 2.28124 8.15351 2.32017 8.02351C2.35115 7.92011 2.35509 7.88248 2.34416 7.79434C2.33696 7.73635 2.31924 7.666 2.30476 7.638L2.27845 7.58711L2.61638 7.72581C2.80224 7.80209 2.98043 7.87522 3.01235 7.88831L3.07037 7.91213L3.29441 8.87671C3.41764 9.40723 3.5301 9.87793 3.54434 9.92273C3.57975 10.0342 3.63132 10.1116 3.71661 10.1815C4.09412 10.4909 4.66294 10.1548 4.57572 9.67388C4.52806 9.41103 4.03555 7.35263 4.00453 7.28663C3.9368 7.14255 3.83011 7.06692 3.50563 6.93298C2.5242 6.52787 2.30798 6.43519 2.31039 6.42059C2.31186 6.41163 2.59203 6.11688 2.93299 5.76561L3.55292 5.12692L4.19839 5.56082C4.55339 5.79947 5.00877 6.10587 5.21034 6.2417C5.41192 6.37755 5.6054 6.49811 5.64031 6.50963C5.73091 6.53952 5.87867 6.52258 5.96371 6.47255C6.05511 6.4188 6.09731 6.37163 6.13965 6.2759C6.20982 6.11727 6.17469 5.92946 6.05348 5.81534C6.02426 5.78783 5.32564 5.31424 4.50096 4.76292C3.37371 4.00933 2.97981 3.75408 2.9139 3.7345C2.7995 3.70054 2.63554 3.70277 2.51946 3.73989ZM6.00616 6.85798C5.87376 6.8739 5.74809 6.9279 5.64031 7.01514C5.08943 7.46105 5.39705 8.34045 6.10389 8.34045C6.40107 8.34045 6.65011 8.18461 6.77495 7.92055C7.02901 7.38322 6.59752 6.78687 6.00616 6.85798Z'
fill='white'
/>
<path d='M8.23259 9.9563C8.47792 9.9963 8.66592 10.0883 8.79659 10.2323C8.92725 10.3736 8.99259 10.5496 8.99259 10.7603C8.99259 10.923 8.94992 11.0736 8.86459 11.2123C8.77925 11.3483 8.64859 11.4576 8.47259 11.5403C8.29925 11.623 8.08592 11.6643 7.83259 11.6643C7.63525 11.6643 7.44059 11.639 7.24859 11.5883C7.05925 11.535 6.89792 11.4603 6.76459 11.3643L7.01659 10.8683C7.12325 10.9483 7.24592 11.011 7.38459 11.0563C7.52592 11.099 7.66992 11.1203 7.81659 11.1203C7.97925 11.1203 8.10725 11.0896 8.20059 11.0283C8.29392 10.9643 8.34059 10.875 8.34059 10.7603C8.34059 10.531 8.16592 10.4163 7.81659 10.4163H7.52059V9.9883L8.09659 9.3363H6.90459V8.8163H8.86459V9.2363L8.23259 9.9563ZM10.7293 11.6163L10.2573 10.9563L9.76927 11.6163H9.08927L9.91727 10.5323L9.11727 9.4643H9.81727L10.2733 10.0923L10.7413 9.4643H11.4053L10.6053 10.5163L11.4373 11.6163H10.7293ZM12.9162 9.9563C13.1615 9.9963 13.3495 10.0883 13.4802 10.2323C13.6108 10.3736 13.6762 10.5496 13.6762 10.7603C13.6762 10.923 13.6335 11.0736 13.5482 11.2123C13.4628 11.3483 13.3322 11.4576 13.1562 11.5403C12.9828 11.623 12.7695 11.6643 12.5162 11.6643C12.3188 11.6643 12.1242 11.639 11.9322 11.5883C11.7428 11.535 11.5815 11.4603 11.4482 11.3643L11.7002 10.8683C11.8068 10.9483 11.9295 11.011 12.0682 11.0563C12.2095 11.099 12.3535 11.1203 12.5002 11.1203C12.6628 11.1203 12.7908 11.0896 12.8842 11.0283C12.9775 10.9643 13.0242 10.875 13.0242 10.7603C13.0242 10.531 12.8495 10.4163 12.5002 10.4163H12.2042V9.9883L12.7802 9.3363H11.5882V8.8163H13.5482V9.2363L12.9162 9.9563Z' fill='white' />
</svg>
)

@ -1,17 +0,0 @@
export const Volleyball = () => (
<svg
width='24'
height='24'
viewBox='0 0 14 14'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
fillRule='evenodd'
clipRule='evenodd'
d='M10.2637 0.0105862C9.96154 0.0611716 9.70276 0.294536 9.61409 0.596424C9.579 0.715918 9.58183 0.936597 9.62007 1.06038C9.6954 1.30422 9.90917 1.51729 10.1565 1.59499C10.3027 1.64092 10.5119 1.63845 10.656 1.58909C11.058 1.45143 11.2868 1.0403 11.19 0.629683C11.0933 0.219286 10.6774 -0.0586586 10.2637 0.0105862ZM3.67604 1.56844C3.55373 1.61112 3.42069 1.69909 3.35716 1.77932C3.26672 1.89349 3.2371 1.98705 3.18937 2.30931C3.00247 3.57102 3.00032 3.58993 3 3.97684C2.99957 4.50413 3.06565 4.83569 3.20599 5.01033C3.26537 5.08421 3.3928 5.17467 3.46572 5.19469C3.54655 5.21691 4.29575 5.34211 4.60637 5.38534C5.10285 5.45442 5.59106 5.49653 5.99922 5.50548L6.15116 5.50881L6.17169 5.60838C6.18299 5.66315 6.38434 6.41803 6.61914 7.28588L7.04607 8.86381L6.99051 8.91182C6.87742 9.00954 5.92322 9.78011 5.69765 9.95587C5.41213 10.1783 5.10063 10.4019 4.83617 10.5742C4.5534 10.7584 4.46821 10.868 4.43873 11.0854C4.41451 11.264 4.50784 11.5063 4.6542 11.6447C4.84142 11.8218 5.07664 11.8575 5.30342 11.7433C5.53093 11.6287 6.15185 11.1758 6.7741 10.6706C7.35285 10.2007 7.74264 9.88871 7.91986 9.75351C8.00655 9.68736 8.08583 9.6215 8.09603 9.60718C8.10644 9.59255 8.14481 9.57704 8.18351 9.57183L8.25245 9.56257L8.37373 9.89491C8.47697 10.1778 8.67787 10.6977 8.79311 10.9802L8.82531 11.0592L8.68696 11.2177C8.21789 11.7552 7.81771 12.2898 7.46742 12.8469C7.26649 13.1665 7.22491 13.2723 7.23769 13.4315C7.26968 13.83 7.76534 14.1188 8.13041 13.9517C8.25096 13.8965 8.32603 13.8184 8.44681 13.6225C8.82006 13.0171 9.26246 12.4301 9.74987 11.8935C10.1233 11.4824 10.1457 11.447 10.1565 11.2523C10.1652 11.0944 10.1529 11.0525 9.95339 10.5574C9.58285 9.6382 9.21163 8.58174 9.11062 8.1591C9.09049 8.07484 8.88737 7.31308 8.65926 6.46628C8.43114 5.61949 8.24739 4.91906 8.25095 4.90976C8.25746 4.89276 8.58423 4.70341 8.99545 4.47836C9.36421 4.27655 9.76038 4.06992 10.5887 3.64735C11.0226 3.42598 11.4058 3.22563 11.4401 3.20213C11.611 3.08524 11.6926 2.85986 11.6393 2.65191C11.5441 2.27996 11.2 2.05133 10.8647 2.13721C10.799 2.15405 10.4788 2.30902 9.91495 2.59692C8.58158 3.27774 7.87364 3.66521 7.21967 4.07213C6.95745 4.23528 6.93314 4.24717 6.87498 4.24061C6.84056 4.23672 6.71589 4.24354 6.59793 4.25575C6.3405 4.28241 5.78291 4.28529 5.51789 4.26133C5.13623 4.22681 4.2601 4.09545 4.23372 4.06877C4.21414 4.04898 4.22763 3.5935 4.25368 3.39469C4.26805 3.28516 4.30341 3.06111 4.33227 2.89681C4.48123 2.04891 4.48824 1.9454 4.40693 1.79598C4.35325 1.69734 4.28269 1.63332 4.17047 1.58143C4.04554 1.52368 3.82123 1.51778 3.67604 1.56844ZM6.37694 1.59499C5.95415 1.68407 5.62965 1.97683 5.50279 2.3836C5.46 2.52085 5.44554 2.76331 5.47163 2.90635C5.54562 3.31214 5.84285 3.65344 6.23366 3.78138C6.39638 3.83464 6.67921 3.84727 6.84001 3.80843C7.22542 3.71533 7.53566 3.43045 7.65754 3.05766C7.71468 2.8829 7.72492 2.61564 7.68109 2.44235C7.58143 2.04827 7.29644 1.74848 6.90432 1.62523C6.78314 1.58715 6.4931 1.57051 6.37694 1.59499Z'
fill='white'
/>
</svg>
)

@ -4,9 +4,10 @@ import { format } from 'date-fns'
import { T9n } from 'features/T9n'
import { Checkbox } from 'features/Common/Checkbox'
import { SportIcon } from 'features/SportIcon'
import { ArrowLoader } from 'features/ArrowLoader'
import { SportIcon } from 'components/SportIcon/SportIcon'
import { isMobileDevice } from 'config/userAgent'
import { URL_AWS } from 'config'
@ -74,7 +75,7 @@ export const MatchesHighlights = () => {
</ScDate>&nbsp;
{team1.name_eng} - {team2.name_eng}
<ScTournament>
<SportIcon sport={sport} />
<SportIcon sportType={sport} />
<ScCountryFlag
src={`${URL_AWS}/media/flags/${country_id}.png`}
/>

@ -1,9 +1,9 @@
import { API_ROOT, SportTypes } from 'config'
import { API_ROOT } from 'config'
import { callApi } from 'helpers'
type Args = {
matchId: number,
sportType: SportTypes,
sportType: number,
}
export const getLandingStatus = async ({

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { Episode, Episodes } from 'requests'
@ -12,7 +12,7 @@ const proc = PROCEDURES.ott_match_events
type Args = {
matchId: number,
sportType: SportTypes,
sportType: number,
}
type PlayerNames = {

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -24,7 +24,7 @@ export type MatchTournament = {
id: number,
name_eng: string,
name_rus: string,
sportType: SportTypes,
sportType: number,
}
export type VideoBound = {

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -18,7 +18,7 @@ export type LastPlayPosition = {
}
export const getMatchLastWatchSeconds = async (
sportType: SportTypes,
sportType: number,
matchId: number,
) => {
const config = {

@ -1,6 +1,6 @@
import isUndefined from 'lodash/isUndefined'
import { SportTypes, STATS_API_URL } from 'config'
import { STATS_API_URL } from 'config'
import { callApi } from 'helpers'
@ -45,7 +45,7 @@ type GetMatchParticipantsArgs = {
matchId: number,
period?: number,
second?: number,
sportType: SportTypes,
sportType: number,
}
export const getMatchParticipants = async ({

@ -3,7 +3,7 @@ import isEmpty from 'lodash/isEmpty'
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi, getSportLexic } from 'helpers'
@ -13,7 +13,7 @@ type Args = {
fullMatchDuration?: number,
matchId: number,
selectedActions: Array<number>,
sportType: SportTypes,
sportType: number,
withFullMatchDuration?: boolean,
}

@ -1,7 +1,7 @@
import {
API_ROOT,
PROCEDURES,
SportTypes,
} from 'config'
import { client } from 'config/clients'
@ -19,7 +19,7 @@ type Args = {
offset: number,
p_match_completed?: boolean,
playerId: number,
sportType: SportTypes,
sportType: number,
sub_only?: boolean,
}

@ -1,7 +1,7 @@
import {
API_ROOT,
PROCEDURES,
SportTypes,
} from 'config'
import { client } from 'config/clients'
@ -17,7 +17,7 @@ const proc = PROCEDURES.get_team_matches
type Args = {
limit: number,
offset: number,
sportType: SportTypes,
sportType: number,
teamId: number,
}

@ -1,7 +1,7 @@
import {
API_ROOT,
PROCEDURES,
SportTypes,
} from 'config'
import { client } from 'config/clients'
@ -17,7 +17,7 @@ const proc = PROCEDURES.get_tournament_matches
type Args = {
limit: number,
offset: number,
sportType: SportTypes,
sportType: number,
tournamentId: number,
}

@ -1,5 +1,3 @@
import { SportTypes } from 'config'
type AwsTeamMedia = {
cover_url: string | null,
logo_url: string | null,
@ -16,7 +14,7 @@ export type TournamentType = {
media?: AwsTournamentMedia,
name_eng: string,
name_rus: string,
sportType: SportTypes,
sportType: number,
}
type Team = {
@ -51,7 +49,7 @@ export type Match = {
live: boolean,
preview?: string,
previewURL?: string,
sport: SportTypes,
sport: number,
sport_info: SportInfo,
/** наличие завершенного hls стрима */
storage: boolean,

@ -1,9 +1,9 @@
import { API_ROOT, SportTypes } from 'config'
import { API_ROOT } from 'config'
import { callApi } from 'helpers'
type Match = {
match_id: number,
sport_id: SportTypes,
sport_id: number,
}
export type PreviewsData = Array<Match>
@ -11,7 +11,7 @@ export type PreviewsData = Array<Match>
type Preview = {
match_id: number,
preview: string,
sport_id: SportTypes,
sport_id: number,
}
export type Previews = Array<Preview>

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -34,7 +34,7 @@ export type PlayerProfile = {
export const getPlayerInfo = (
playerId: number,
sportType: SportTypes,
sportType: number,
): Promise<PlayerProfile> => {
const config = {
body: {

@ -3,7 +3,7 @@ import isEmpty from 'lodash/isEmpty'
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi, getSportLexic } from 'helpers'
@ -19,7 +19,7 @@ type Args = {
matchId: number,
playerId: number,
settings?: Settings,
sportType: SportTypes,
sportType: number,
}
type Response = {

@ -1,7 +1,7 @@
import {
API_ROOT,
ProfileTypes,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -23,7 +23,7 @@ type Response = {
type Args = {
profileId: number,
profileType: ProfileTypes,
sportType: SportTypes,
sportType: number,
}
export const getProfileColor = async ({

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -26,7 +26,7 @@ export type PlayerTypeFromSearch = {
id: number,
lastname_eng: string,
lastname_rus: string,
sport: SportTypes,
sport: number,
team?: NamedObject,
}
@ -38,7 +38,7 @@ type Team = {
id: number,
name_eng: string,
name_rus: string,
sport: SportTypes,
sport: number,
}
type Tournament = {
@ -47,7 +47,7 @@ type Tournament = {
id: number,
name_eng: string,
name_rus: string,
sport: SportTypes,
sport: number,
}
export type SearchItems = {

@ -1,7 +1,7 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi, getSportLexic } from 'helpers'
@ -18,7 +18,7 @@ type Response = {
data: Actions,
}
export const getSportActions = async (sportType: SportTypes) => {
export const getSportActions = async (sportType: number) => {
const config = {
body: {
params: {},

@ -1,18 +1,19 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
const proc = PROCEDURES.get_sport_list
export type SportList = Array<{
id: SportTypes,
export type Sport = {
id: number,
lexic: number,
name_eng: string,
name_rus: string,
}>
}
export type SportList = Array<Sport>
export const getSportList = (): Promise<SportList> => {
const config = {

@ -4,7 +4,7 @@ import map from 'lodash/map'
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -24,13 +24,13 @@ export type Tournament = {
name_rus: string,
short_name_eng: string | null,
short_name_rus: string | null,
sport: SportTypes,
sport: number,
tournament_type: number,
}
export type Tournaments = Array<Tournament>
const getSportTournaments = (sportId: SportTypes): Promise<Tournaments> => {
const getSportTournaments = (sportId: number): Promise<Tournaments> => {
const config = {
body: {
params: {
@ -46,9 +46,9 @@ const getSportTournaments = (sportId: SportTypes): Promise<Tournaments> => {
})
}
export type TournamentsBySports = Partial<Record<SportTypes, Tournaments>>
export type TournamentsBySports = Partial<Record<number, Tournaments>>
export const getTournamentsBySports = async (sportIds: Array<SportTypes>) => {
export const getTournamentsBySports = async (sportIds: Array<number>) => {
const responses = await Promise.all(map(sportIds, getSportTournaments))
const tournamentsBySports = reduce(
responses,

@ -1,4 +1,4 @@
import { SportTypes, STATS_API_URL } from 'config'
import { STATS_API_URL } from 'config'
import { callApi } from 'helpers'
@ -18,7 +18,7 @@ type GetStatsEventsArgs = {
period?: number,
playerId?: number,
second?: number,
sportType: SportTypes,
sportType: number,
teamId: number,
}

@ -2,7 +2,6 @@ import {
currencySymbols,
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -64,7 +63,7 @@ export type Season = {
}
export const getSubscriptions = async (
sport: SportTypes,
sport: number,
matchId: number,
): Promise<SubscriptionsData> => {
const config = {

@ -2,7 +2,6 @@ import {
DATA_URL,
PROCEDURES,
ProfileTypes,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -26,7 +25,7 @@ export type UnauthenticatedMatch = {
} | null
export const getUnauthenticatedMatch = (
sportId: SportTypes,
sportId: number,
matchId: number,
profileType?: ProfileTypes,
)

@ -1,14 +1,13 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
const proc = PROCEDURES.get_user_preferences
export type UserPreferences = Array<{
sport: SportTypes,
sport: number,
tournament_id: number,
}>

@ -1,7 +1,6 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
ProfileTypes,
} from 'config'
import { callApi } from 'helpers'
@ -37,7 +36,7 @@ export type Info = {
export type UserFavorite = {
id: number,
info: Info,
sport: SportTypes,
sport: number,
type: ProfileTypes,
}

@ -1,7 +1,7 @@
import isEmpty from 'lodash/isEmpty'
import filter from 'lodash/filter'
import { API_ROOT, SportTypes } from 'config'
import { API_ROOT } from 'config'
import { callApi } from 'helpers'
const filterByIds = (videos: Videos) => {
@ -22,7 +22,7 @@ export type Video = {
export type Videos = Array<Video>
export const getVideos = (
sportType: SportTypes,
sportType: number,
matchId: number,
): Promise<Videos> => {
const config = {

@ -1,7 +1,6 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -16,7 +15,7 @@ type ResponseType = {
type ViewMatchDurationType = {
matchId: number,
sportType: SportTypes,
sportType: number,
userId: number,
}

@ -1,7 +1,6 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -19,7 +18,7 @@ type Args = {
matchId?: number,
playerId?: number,
playlistType?: number,
sportType?: SportTypes,
sportType?: number,
url: string,
}

@ -1,7 +1,6 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
ProfileTypes,
} from 'config'
import { callApi } from 'helpers'
@ -29,7 +28,7 @@ type Args = {
action: FavoritesActions,
id: number,
isAuto?: boolean,
sport: SportTypes,
sport: number,
type: ProfileTypes,
}

@ -1,7 +1,6 @@
import {
DATA_URL,
PROCEDURES,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -11,7 +10,7 @@ type Args = {
half?: number,
matchId: number,
seconds: number,
sport: SportTypes,
sport: number,
}
export const reportPlayerProgress = ({

@ -1,11 +1,11 @@
import { SportTypes, VIEWS_API } from 'config'
import { VIEWS_API } from 'config'
import { callApi } from 'helpers'
type Props = {
matchId: number,
matchSecond: number,
sportType: SportTypes,
sportType: number,
}
export const VIEW_INTERVAL_MS = 5000

@ -2,7 +2,7 @@ import {
DATA_URL,
PROCEDURES,
ProfileTypes,
SportTypes,
} from 'config'
import { callApi } from 'helpers'
@ -21,7 +21,7 @@ type Response = {
type Args = {
action: SubscriptionAction,
id: number,
sport: SportTypes,
sport: number,
type: ProfileTypes,
}

@ -3,7 +3,6 @@ import filter from 'lodash/filter'
import {
ProfileTypes,
SportTypes,
PROFILE_NAMES,
} from 'config'
@ -17,12 +16,12 @@ type FilterArgs = {
gender: Gender | null,
profileType: ProfileTypes | null,
results: SearchItems,
sportType: SportTypes | null,
sportType: number | null,
}
type Item = {
gender?: Gender,
sport: SportTypes,
sport: number,
}
// этот хелпер и его типы удалим когда сделают
@ -62,7 +61,7 @@ type Args = {
gender: Gender | null,
profileType: ProfileTypes | null,
query: string,
sportType: SportTypes | null,
sportType: number | null,
}
export const extendedSearch = async ({

Loading…
Cancel
Save