Ott 560 available matches toggler (#221)

* Ott 560 part 1/store refactor and switch (#219)

* refactor(#560): added/renamed svgs

* refactor(#560): extended score store and added MatchSwitch component

* Ott 560 part 2/request matches (#220)

* refactor(#560): added matches re-requesting on switch change

* refactor(#560): added tooltip
keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 5 years ago committed by GitHub
parent a16a2cfabf
commit b4a1f7cc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      public/images/match-switch-off.svg
  2. 25
      public/images/match-switch-on.svg
  3. 0
      public/images/score-switch-off.svg
  4. 0
      public/images/score-switch-on.svg
  5. 2
      src/config/lexics/indexLexics.tsx
  6. 6
      src/features/App/AuthenticatedApp.tsx
  7. 5
      src/features/HeaderMobile/index.tsx
  8. 5
      src/features/HomePage/components/Header/index.tsx
  9. 4
      src/features/HomePage/hooks.tsx
  10. 8
      src/features/MatchCard/MatchInfoCard/index.tsx
  11. 6
      src/features/MatchPage/MatchProfileCard/index.tsx
  12. 49
      src/features/MatchSwitches/components/AvailableMatchesSwitch/index.tsx
  13. 35
      src/features/MatchSwitches/components/ScoreSwitch/index.tsx
  14. 29
      src/features/MatchSwitches/hooks.tsx
  15. 3
      src/features/MatchSwitches/index.tsx
  16. 25
      src/features/MatchSwitches/store.tsx
  17. 21
      src/features/MatchSwitches/styled.tsx
  18. 9
      src/features/PlayerPage/hooks.tsx
  19. 5
      src/features/ProfileHeader/index.tsx
  20. 9
      src/features/TeamPage/hooks.tsx
  21. 25
      src/features/ToggleScore/index.tsx
  22. 37
      src/features/ToggleScore/store.tsx
  23. 9
      src/features/TournamentPage/hooks.tsx
  24. 3
      src/requests/getMatches/getHomeMatches.tsx
  25. 3
      src/requests/getMatches/getPlayerMatches.tsx
  26. 3
      src/requests/getMatches/getTeamMatches.tsx
  27. 3
      src/requests/getMatches/getTournamentMatches.tsx

@ -0,0 +1,23 @@
<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M38 31H18C14.1 31 11 27.9 11 24C11 20.1 14.1 17 18 17H38C41.9 17 45 20.1 45 24C45 27.9 41.9 31 38 31Z" fill="white" fill-opacity="0.2"/>
<g filter="url(#filter0_dd)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 34C23.5228 34 28 29.5228 28 24C28 18.4772 23.5228 14 18 14C12.4772 14 8 18.4772 8 24C8 29.5228 12.4772 34 18 34Z" fill="#F9F9F9"/>
</g>
<path d="M13.7902 22.6746H14.3422V20.7305C14.3422 18.6735 16.0157 17 18.0727 17H18.0728C20.1297 17.0001 21.8032 18.6736 21.8032 20.7305V20.7705H20.4721V20.7305C20.4721 20.069 20.203 19.4691 19.7686 19.0346C19.66 18.926 19.541 18.8277 19.4133 18.7414C19.1579 18.5688 18.8678 18.444 18.5556 18.38C18.3997 18.3479 18.2381 18.3311 18.0728 18.3311H18.0727C16.7496 18.3311 15.6733 19.4074 15.6733 20.7305V22.6746H18.0728H20.4721H21.8032H22.3553C22.7917 22.6746 23.1455 23.0284 23.1455 23.4648V23.9455V29.4297V29.9105C23.1455 30.3469 22.7917 30.7007 22.3553 30.7007H18.0728H13.7902C13.3538 30.7007 13 30.3469 13 29.9105V29.4297V23.9455V23.4648C13 23.0283 13.3538 22.6746 13.7902 22.6746ZM17.2811 28.2382H18.8645L18.581 26.8878C18.846 26.7192 19.0231 26.4247 19.0231 26.0873C19.0231 25.5625 18.5976 25.137 18.0728 25.137C17.5479 25.137 17.1225 25.5625 17.1225 26.0873C17.1225 26.4247 17.2995 26.7192 17.5645 26.8878L17.2811 28.2382Z" fill="#464646"/>
<defs>
<filter id="filter0_dd" x="7" y="13" width="22" height="23" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.237602 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
<feBlend mode="normal" in2="effect1_dropShadow" result="effect2_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,25 @@
<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M38 31H18C14.1 31 11 27.9 11 24C11 20.1 14.1 17 18 17H38C41.9 17 45 20.1 45 24C45 27.9 41.9 31 38 31Z" fill="#FF7D7D" fill-opacity="0.4"/>
<g filter="url(#filter0_dd)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M35 34C40.5228 34 45 29.5228 45 24C45 18.4772 40.5228 14 35 14C29.4772 14 25 18.4772 25 24C25 29.5228 29.4772 34 35 34Z" fill="#FF5A5A"/>
</g>
<path d="M32 22.5V19.5C32 18.6667 32.6 17 35 17C37.4 17 38 18.6667 38 19.5V22.5" stroke="white"/>
<rect x="30" y="22" width="10" height="8" rx="1" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.3593 25.9335C35.7341 25.7892 36 25.4256 36 25C36 24.4477 35.5523 24 35 24C34.4477 24 34 24.4477 34 25C34 25.4256 34.2659 25.7892 34.6407 25.9335L34.134 27.25H35.866L35.3593 25.9335Z" fill="#FF5A5A"/>
<defs>
<filter id="filter0_dd" x="24" y="13" width="22" height="23" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.237602 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
<feBlend mode="normal" in2="effect1_dropShadow" result="effect2_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -4,6 +4,8 @@ export const indexLexics = {
add_to_favorites: 1701,
add_to_favorites_error: 12943,
added_to_favorites: 13048,
all_matches_shown: 13386,
available_matches_shown: 13385,
basketball: 6960,
broadcast: 13049,
cm: 817,

@ -16,7 +16,7 @@ import { PlayerPage } from 'features/PlayerPage'
import { TournamentPage } from 'features/TournamentPage'
import { ExtendedSearchStore, ExtendedSearchPage } from 'features/ExtendedSearchPage'
import { UserAccount } from 'features/UserAccount'
import { ScoreStore } from 'features/ToggleScore'
import { MatchSwitchesStore } from 'features/MatchSwitches'
import { MainWrapper } from 'features/MainWrapper'
import { UserFavorites } from 'features/UserFavorites'
@ -29,7 +29,7 @@ export const AuthenticatedApp = () => {
const isMobile = useMediaQuery({ query: devices.tablet })
return (
<ScoreStore>
<MatchSwitchesStore>
<Switch>
<Route path={PAGES.useraccount}>
<UserAccountForm />
@ -63,7 +63,7 @@ export const AuthenticatedApp = () => {
</UserFavoritesStore>
<Redirect to={PAGES.home} />
</Switch>
</ScoreStore>
</MatchSwitchesStore>
)
}

@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
import { PAGES } from 'config'
import { ToggleScore } from 'features/ToggleScore'
import { ScoreSwitch, AvailableMatchesSwitch } from 'features/MatchSwitches'
import { Logo } from 'features/Logo'
import { Menu } from 'features/Menu'
import { Search } from 'features/Search'
@ -16,7 +16,8 @@ import {
export const HeaderMobile = () => (
<HeaderMobileWrapper>
<ToggleScore />
<ScoreSwitch />
<AvailableMatchesSwitch />
<Link to={PAGES.home}>
<Logo width={52} height={12} />
</Link>

@ -2,7 +2,7 @@ import React from 'react'
import { Menu } from 'features/Menu'
import { LanguageSelect } from 'features/LanguageSelect'
import { ToggleScore } from 'features/ToggleScore'
import { ScoreSwitch, AvailableMatchesSwitch } from 'features/MatchSwitches'
import { Search } from 'features/Search'
import {
DateFilter,
@ -42,7 +42,8 @@ export const Header = () => (
</HeaderGroup>
<HeaderGroup>
<ToggleScore />
<ScoreSwitch />
<AvailableMatchesSwitch />
<MenuWrapper>
<Menu />
</MenuWrapper>

@ -3,6 +3,7 @@ import { useCallback } from 'react'
import { getHomeMatches } from 'requests'
import { useHeaderFiltersStore } from 'features/HeaderFilters'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
export const useHomePage = () => {
const {
@ -11,9 +12,11 @@ export const useHomePage = () => {
selectedSportTypeId,
selectedTournamentId,
} = useHeaderFiltersStore()
const { availableMatchesOnly } = useMatchSwitchesStore()
const fetchMatches = useCallback(
(limit: number, offset: number) => getHomeMatches({
availableMatchesOnly,
date: selectedDateFormatted,
limit,
matchStatus: selectedMatchStatus,
@ -26,6 +29,7 @@ export const useHomePage = () => {
selectedMatchStatus,
selectedSportTypeId,
selectedTournamentId,
availableMatchesOnly,
],
)

@ -5,7 +5,7 @@ import { ProfileTypes } from 'config'
import type { Match } from 'features/Matches'
import { SportName } from 'features/Common'
import { useScoreStore } from 'features/ToggleScore'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { useName } from 'features/Name'
import {
@ -47,7 +47,7 @@ export const MatchInfoCard = ({
showSportName,
}: Props) => {
const tournamentName = useName(tournament)
const { isHidden } = useScoreStore()
const { isScoreHidden } = useMatchSwitchesStore()
return (
<CardWrapper
@ -100,11 +100,11 @@ export const MatchInfoCard = ({
<Teams>
<Team>
<TeamName nameObj={team1} />
{!isHidden && <Score>{team1.score}</Score>}
{!isScoreHidden && <Score>{team1.score}</Score>}
</Team>
<Team>
<TeamName nameObj={team2} />
{!isHidden && <Score>{team2.score}</Score>}
{!isScoreHidden && <Score>{team2.score}</Score>}
</Team>
</Teams>
</Info>

@ -7,7 +7,7 @@ import type { MatchInfo } from 'requests'
import { ProfileTypes } from 'config'
import { SportName } from 'features/Common/SportName'
import { useScoreStore } from 'features/ToggleScore'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { Name } from 'features/Name'
import { useSportNameParam } from 'hooks/useSportNameParam'
@ -30,7 +30,7 @@ type Props = {
export const MatchProfileCard = ({ profile }: Props) => {
const { sportType } = useSportNameParam()
const { isHidden } = useScoreStore()
const { isScoreHidden } = useMatchSwitchesStore()
if (!profile) return <Wrapper />
@ -51,7 +51,7 @@ export const MatchProfileCard = ({ profile }: Props) => {
<Name nameObj={team1} />
</StyledLink>
{
isHidden
isScoreHidden
? <Dash />
: (
<Score>

@ -0,0 +1,49 @@
import React from 'react'
import styled from 'styled-components/macro'
import { Tooltip, TooltipWrapper } from 'features/Tooltip'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
import {
Switch,
Icon,
} from '../../styled'
const Wrapper = styled.div`
position: relative;
:hover ${TooltipWrapper} {
display: block;
}
`
export const AvailableMatchesSwitch = () => {
const {
availableMatchesOnly,
toggleMatchAvailablity,
} = useMatchSwitchesStore()
const lexic = availableMatchesOnly
? 'available_matches_shown'
: 'all_matches_shown'
return (
<Wrapper>
<Tooltip lexic={lexic}>
<Switch
role='switch'
aria-checked={availableMatchesOnly}
onClick={toggleMatchAvailablity}
>
<Icon
iconName='match-switch'
width={56}
height={48}
isOn={availableMatchesOnly}
/>
</Switch>
</Tooltip>
</Wrapper>
)
}

@ -0,0 +1,35 @@
import React from 'react'
import styled from 'styled-components/macro'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
import {
Switch,
Title,
Icon,
} from '../../styled'
const Wrapper = styled.div`
margin-right: 27px;
height: 100%;
display: flex;
align-items: center;
`
export const ScoreSwitch = () => {
const { isScoreHidden, toggleScore } = useMatchSwitchesStore()
return (
<Wrapper>
<Switch
role='switch'
onClick={toggleScore}
aria-checked={isScoreHidden}
>
<Title t='hide_score' />
<Icon iconName='score-switch' isOn={isScoreHidden} />
</Switch>
</Wrapper>
)
}

@ -0,0 +1,29 @@
import isBoolean from 'lodash/isBoolean'
import { useLocalStore } from 'hooks'
const SCORE_KEY = 'score_hidden'
const MATCH_AVAILABILITY_KEY = 'available_matches_only'
export const useMatchSwitches = () => {
const [isScoreHidden, setScoreHidden] = useLocalStore({
defaultValue: false,
key: SCORE_KEY,
validator: isBoolean,
})
const toggleScore = () => setScoreHidden(!isScoreHidden)
const [availableMatchesOnly, setAvailableMatchesOnly] = useLocalStore({
defaultValue: false,
key: MATCH_AVAILABILITY_KEY,
validator: isBoolean,
})
const toggleMatchAvailablity = () => setAvailableMatchesOnly(!availableMatchesOnly)
return {
availableMatchesOnly,
isScoreHidden,
toggleMatchAvailablity,
toggleScore,
}
}

@ -0,0 +1,3 @@
export * from './store'
export * from './components/ScoreSwitch'
export * from './components/AvailableMatchesSwitch'

@ -0,0 +1,25 @@
import type { ReactNode } from 'react'
import React, {
createContext,
useContext,
} from 'react'
import { useMatchSwitches } from './hooks'
type SwitchStore = ReturnType<typeof useMatchSwitches>
type Props = { children: ReactNode }
const Context = createContext({} as SwitchStore)
export const MatchSwitchesStore = ({ children }: Props) => {
const value = useMatchSwitches()
return (
<Context.Provider value={value}>
{children}
</Context.Provider>
)
}
export const useMatchSwitchesStore = () => useContext(Context)

@ -7,11 +7,6 @@ export const Switch = styled.div`
display: flex;
align-items: center;
cursor: pointer;
margin-right: 135px;
@media ${devices.laptop} {
margin-right: 12px;
}
@media ${devices.tablet} {
position: static;
@ -35,23 +30,25 @@ export const Title = styled(T9n)`
`
type IconProps = {
height?: number,
iconName: string,
isOn: boolean,
width?: number,
}
export const Icon = styled.div<IconProps>`
width: 28px;
height: 16px;
width: ${({ width = 30 }) => width}px;
height: ${({ height = 18 }) => height}px;
color: white;
background-repeat: no-repeat;
${({ isOn }) => (
background-position-y: 1px;
${({ iconName, isOn }) => (
isOn
? `
background-image: url(/images/switchOn.svg);
background-position: 0 -1px;
background-image: url(/images/${iconName}-on.svg);
`
: `
background-image: url(/images/switchOff.svg);
background-position: -2px -1px;
background-image: url(/images/${iconName}-off.svg);
`
)};
`

@ -12,12 +12,14 @@ import { getPlayerInfo, getPlayerMatches } from 'requests'
import { useName } from 'features/Name'
import { useLexicsStore } from 'features/LexicsStore'
import { addSportType } from 'features/Matches/helpers/addSportType'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
export const usePlayerPage = () => {
const [playerProfile, setPlayerProfile] = useState<PlayerProfile>(null)
const { sportType } = useSportNameParam()
const playerId = usePageId()
const { translate } = useLexicsStore()
const { availableMatchesOnly } = useMatchSwitchesStore()
const {
club_team,
@ -47,12 +49,17 @@ export const usePlayerPage = () => {
const fetchMatches = useCallback(
(limit: number, offset: number) => getPlayerMatches({
availableMatchesOnly,
limit,
offset,
playerId,
sportType,
}).then((matches) => addSportType(matches, sportType)),
[playerId, sportType],
[
playerId,
sportType,
availableMatchesOnly,
],
)
return {

@ -4,7 +4,7 @@ import { devices } from 'config'
import { Menu } from 'features/Menu'
import { LanguageSelect } from 'features/LanguageSelect'
import { ToggleScore } from 'features/ToggleScore'
import { ScoreSwitch, AvailableMatchesSwitch } from 'features/MatchSwitches'
import { Search } from 'features/Search'
import { HeaderMobile } from 'features/HeaderMobile'
import { useMediaQuery } from 'features/MediaQuery'
@ -31,7 +31,8 @@ export const ProfileHeader = () => {
</HeaderGroup>
<HeaderGroup>
<ToggleScore />
<ScoreSwitch />
<AvailableMatchesSwitch />
<MenuWrapper>
<Menu />
</MenuWrapper>

@ -11,12 +11,14 @@ import { useSportNameParam, usePageId } from 'hooks'
import { useName } from 'features/Name'
import { addSportType } from 'features/Matches/helpers/addSportType'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
export const useTeamPage = () => {
const [teamProfile, setTeamProfile] = useState<TeamInfo>(null)
const { sportType } = useSportNameParam()
const teamId = usePageId()
const country = useName(teamProfile?.country || {})
const { availableMatchesOnly } = useMatchSwitchesStore()
useEffect(() => {
getTeamInfo(sportType, teamId)
@ -29,12 +31,17 @@ export const useTeamPage = () => {
const fetchMatches = useCallback(
(limit: number, offset: number) => getTeamMatches({
availableMatchesOnly,
limit,
offset,
sportType,
teamId,
}).then((matches) => addSportType(matches, sportType)),
[teamId, sportType],
[
teamId,
sportType,
availableMatchesOnly,
],
)
return {

@ -1,25 +0,0 @@
import React from 'react'
import { useScoreStore } from './store'
import {
Switch,
Title,
Icon,
} from './styled'
export * from './store'
export const ToggleScore = () => {
const { isHidden, toggle } = useScoreStore()
return (
<Switch
onClick={toggle}
role='switch'
aria-checked={isHidden}
>
<Title t='hide_score' />
<Icon isOn={isHidden} />
</Switch>
)
}

@ -1,37 +0,0 @@
import type { ReactNode } from 'react'
import React, {
createContext,
useContext,
} from 'react'
import isBoolean from 'lodash/isBoolean'
import { useLocalStore } from 'hooks'
const SCORE_KEY = 'hide_score'
type ScoreStore = {
isHidden: boolean,
toggle: () => void,
}
type Props = { children: ReactNode }
const ScoreContext = createContext({} as ScoreStore)
export const ScoreStore = ({ children }: Props) => {
const [isOpen, setIsOpen] = useLocalStore({
defaultValue: false,
key: SCORE_KEY,
validator: isBoolean,
})
const toggle = () => setIsOpen(!isOpen)
return (
<ScoreContext.Provider value={{ isHidden: isOpen, toggle }}>
{children}
</ScoreContext.Provider>
)
}
export const useScoreStore = () => useContext(ScoreContext)

@ -11,12 +11,14 @@ import { useSportNameParam, usePageId } from 'hooks'
import { useName } from 'features/Name'
import { addSportType } from 'features/Matches/helpers/addSportType'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
export const useTournamentPage = () => {
const [tournamentProfile, setTournamentProfile] = useState<TournamentInfo>(null)
const { sportType } = useSportNameParam()
const tournamentId = usePageId()
const country = useName(tournamentProfile?.country || {})
const { availableMatchesOnly } = useMatchSwitchesStore()
useEffect(() => {
getTournamentInfo(sportType, tournamentId)
@ -29,12 +31,17 @@ export const useTournamentPage = () => {
const fetchMatches = useCallback(
(limit: number, offset: number) => getTournamentMatches({
availableMatchesOnly,
limit,
offset,
sportType,
tournamentId,
}).then((matches) => addSportType(matches, sportType)),
[tournamentId, sportType],
[
tournamentId,
sportType,
availableMatchesOnly,
],
)
return {

@ -8,6 +8,7 @@ import { requestMatches } from './request'
const proc = PROCEDURES.get_matches
type Args = {
availableMatchesOnly: boolean,
date: string,
limit: number,
matchStatus: MatchStatuses | null,
@ -17,6 +18,7 @@ type Args = {
}
export const getHomeMatches = async ({
availableMatchesOnly,
date,
limit,
matchStatus,
@ -32,6 +34,7 @@ export const getHomeMatches = async ({
_p_offset: offset,
_p_sport: sportType,
_p_stream_status: matchStatus,
_p_sub_only: availableMatchesOnly,
_p_tournament_id: tournamentId,
},
proc,

@ -6,6 +6,7 @@ import { requestMatches } from './request'
const proc = PROCEDURES.get_player_matches
type Args = {
availableMatchesOnly: boolean,
limit: number,
offset: number,
playerId: number,
@ -13,6 +14,7 @@ type Args = {
}
export const getPlayerMatches = async ({
availableMatchesOnly,
limit,
offset,
playerId,
@ -25,6 +27,7 @@ export const getPlayerMatches = async ({
_p_offset: offset,
_p_player_id: playerId,
_p_sport: sportType,
_p_sub_only: availableMatchesOnly,
},
proc,
},

@ -6,6 +6,7 @@ import { requestMatches } from './request'
const proc = PROCEDURES.get_team_matches
type Args = {
availableMatchesOnly: boolean,
limit: number,
offset: number,
sportType: SportTypes,
@ -13,6 +14,7 @@ type Args = {
}
export const getTeamMatches = async ({
availableMatchesOnly,
limit,
offset,
sportType,
@ -24,6 +26,7 @@ export const getTeamMatches = async ({
_p_limit: limit,
_p_offset: offset,
_p_sport: sportType,
_p_sub_only: availableMatchesOnly,
_p_team_id: teamId,
},
proc,

@ -6,6 +6,7 @@ import { requestMatches } from './request'
const proc = PROCEDURES.get_tournament_matches
type Args = {
availableMatchesOnly: boolean,
limit: number,
offset: number,
sportType: SportTypes,
@ -13,6 +14,7 @@ type Args = {
}
export const getTournamentMatches = async ({
availableMatchesOnly,
limit,
offset,
sportType,
@ -24,6 +26,7 @@ export const getTournamentMatches = async ({
_p_limit: limit,
_p_offset: offset,
_p_sport: sportType,
_p_sub_only: availableMatchesOnly,
_p_tournament_id: tournamentId,
},
proc,

Loading…
Cancel
Save