Compare commits
No commits in common. 'demo-insports-label' and 'develop' have entirely different histories.
demo-inspo
...
develop
@ -1,51 +0,0 @@ |
|||||||
import { css } from 'styled-components/macro' |
|
||||||
|
|
||||||
import { |
|
||||||
ClientConfig, |
|
||||||
ClientIds, |
|
||||||
ClientNames, |
|
||||||
} from './types' |
|
||||||
|
|
||||||
export const rustat: ClientConfig = { |
|
||||||
auth: { |
|
||||||
clientId: ClientIds.Rustat, |
|
||||||
}, |
|
||||||
currencyBadge: { |
|
||||||
color: '#333333', |
|
||||||
secondColor: 'rgba(255, 255, 255, 0.7)', |
|
||||||
sign: 'Dollar', |
|
||||||
}, |
|
||||||
defaultLanguage: 'en', |
|
||||||
description: 'Live sports streaming platform. Football, basketball, ice hockey and more. Access to various player playlists and game highlights. Multiple subscription options. Available across all devices.', |
|
||||||
disabledPreferences: true, |
|
||||||
host: 'demo.insports.tv', |
|
||||||
name: ClientNames.Rustat, |
|
||||||
privacyLink: '/privacy-policy-and-statement?client_id=insports-ott-web', |
|
||||||
showSearch: true, |
|
||||||
showSmartBanner: true, |
|
||||||
styles: { |
|
||||||
background: 'background-image: url(/images/Checker.png);', |
|
||||||
logo: 'insports-logo.svg', |
|
||||||
logoHeight: 2.465, |
|
||||||
logoLeft: 1.7, |
|
||||||
logoTop: 1.5, |
|
||||||
logoWidth: 6.37, |
|
||||||
matchLogoHeight: 2.465, |
|
||||||
matchLogoWidth: 6.37, |
|
||||||
matchPageMobileHeaderLogo: css` |
|
||||||
width: 90px; |
|
||||||
height: 27px; |
|
||||||
top: 0; |
|
||||||
`,
|
|
||||||
mobileHeaderLogo: css` |
|
||||||
width: 77px; |
|
||||||
height: 24px; |
|
||||||
`,
|
|
||||||
userAccountLogo: css` |
|
||||||
width: 6.37rem; |
|
||||||
height: 2.465rem; |
|
||||||
`,
|
|
||||||
}, |
|
||||||
termsLink: '/terms-and-conditions?client_id=insports-ott-web', |
|
||||||
title: 'InSports TV - The Home of Sports Streaming', |
|
||||||
} |
|
||||||
@ -1,42 +0,0 @@ |
|||||||
import { css } from 'styled-components' |
|
||||||
|
|
||||||
import { rustat as platformRustat } from 'config/clients/rustat' |
|
||||||
import { isMobileDevice } from 'config/userAgent' |
|
||||||
|
|
||||||
import { Background } from 'features/Background' |
|
||||||
|
|
||||||
import type { ClientConfig } from './types' |
|
||||||
|
|
||||||
export const rustat: ClientConfig = { |
|
||||||
...platformRustat, |
|
||||||
background: Background, |
|
||||||
styles: { |
|
||||||
centerBlock: css` |
|
||||||
margin-top: 9.15rem; |
|
||||||
${isMobileDevice ? css` |
|
||||||
margin-top: 107px; |
|
||||||
@media screen and (orientation: landscape) { |
|
||||||
width: 290px; |
|
||||||
margin: auto; |
|
||||||
} |
|
||||||
` : ''};
|
|
||||||
`,
|
|
||||||
logo: css` |
|
||||||
background-image: url(/images/insports-logo.svg); |
|
||||||
background-position: center; |
|
||||||
height: 85px; |
|
||||||
width: 275px; |
|
||||||
margin-bottom: 1.82rem; |
|
||||||
|
|
||||||
${isMobileDevice ? css` |
|
||||||
margin-bottom: 15px; |
|
||||||
width: 165px; |
|
||||||
height: 50px; |
|
||||||
@media screen and (orientation: landscape){ |
|
||||||
width: 92px; |
|
||||||
height: 22px; |
|
||||||
} |
|
||||||
` : ''}
|
|
||||||
`,
|
|
||||||
}, |
|
||||||
} |
|
||||||
@ -1,22 +0,0 @@ |
|||||||
import { usePageParams } from 'hooks' |
|
||||||
import { useEffect, useState } from 'react' |
|
||||||
import { Peak, getViewPeaks } from 'requests/getViewPeaks' |
|
||||||
|
|
||||||
export const useViewsPeaks = () => { |
|
||||||
const { profileId, sportType } = usePageParams() |
|
||||||
|
|
||||||
const [peaks, setPeaks] = useState<Array<Peak>>([]) |
|
||||||
|
|
||||||
useEffect(() => { |
|
||||||
(async () => { |
|
||||||
const res = await getViewPeaks({ match_id: profileId, sport_id: sportType }) |
|
||||||
if (res) { |
|
||||||
setPeaks(res) |
|
||||||
} |
|
||||||
})() |
|
||||||
}, [profileId, sportType]) |
|
||||||
|
|
||||||
return ( |
|
||||||
{ peaks } |
|
||||||
) |
|
||||||
} |
|
||||||
@ -1,32 +0,0 @@ |
|||||||
import { useMatchPageStore } from 'features/MatchPage/store' |
|
||||||
import { memo, useMemo } from 'react' |
|
||||||
|
|
||||||
import { |
|
||||||
PeakContainer, |
|
||||||
PeaksList, |
|
||||||
} from './styled' |
|
||||||
|
|
||||||
interface Props { |
|
||||||
duration: number, |
|
||||||
} |
|
||||||
|
|
||||||
export const Peaks: React.FC<Props> = memo(({ duration }) => { |
|
||||||
const { peaks } = useMatchPageStore() |
|
||||||
|
|
||||||
const peaksPrepared = useMemo(() => peaks.map((p) => ( |
|
||||||
{ |
|
||||||
...p, |
|
||||||
left: p.s / (duration / 1000) * 100, |
|
||||||
width: (p.e - p.s) / (duration / 1000) * 100, |
|
||||||
} |
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
)), [peaks.length, duration]) |
|
||||||
|
|
||||||
return ( |
|
||||||
<PeaksList> |
|
||||||
{peaksPrepared.map((p) => ( |
|
||||||
<PeakContainer style={{ left: `${p.left}%`, width: `${p.width}%` }} /> |
|
||||||
))} |
|
||||||
</PeaksList> |
|
||||||
) |
|
||||||
}) |
|
||||||
@ -1,15 +0,0 @@ |
|||||||
import styled from 'styled-components/macro' |
|
||||||
|
|
||||||
export const PeaksList = styled.div` |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
display: flex; |
|
||||||
position: absolute; |
|
||||||
z-index: 3; |
|
||||||
` |
|
||||||
|
|
||||||
export const PeakContainer = styled.div` |
|
||||||
position: relative; |
|
||||||
height: 100%; |
|
||||||
background-color: #5CDD86; |
|
||||||
` |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
import { API_ROOT } from 'config' |
|
||||||
import { callApi } from 'helpers' |
|
||||||
|
|
||||||
export interface Peak { |
|
||||||
e: number, |
|
||||||
s: number, |
|
||||||
} |
|
||||||
|
|
||||||
export type Props = { |
|
||||||
match_id: number, |
|
||||||
sport_id: number, |
|
||||||
} |
|
||||||
|
|
||||||
export const getViewPeaks = async ({ match_id, sport_id }: Props): Promise<Array<Peak>> => { |
|
||||||
const config = { |
|
||||||
method: 'GET', |
|
||||||
} |
|
||||||
|
|
||||||
return callApi({ |
|
||||||
config, |
|
||||||
url: `${API_ROOT}/v1/views/peaks/${sport_id}/${match_id}`, |
|
||||||
}) |
|
||||||
} |
|
||||||
Loading…
Reference in new issue