Compare commits
3 Commits
develop
...
demo.inspo
| Author | SHA1 | Date |
|---|---|---|
|
|
a740a79ef0 | 2 years ago |
|
|
24dc9cbf57 | 2 years ago |
|
|
55e15e2b08 | 2 years ago |
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,51 @@ |
||||
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', |
||||
} |
||||
@ -0,0 +1,42 @@ |
||||
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; |
||||
} |
||||
` : ''}
|
||||
`,
|
||||
}, |
||||
} |
||||
@ -0,0 +1,22 @@ |
||||
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 } |
||||
) |
||||
} |
||||
@ -0,0 +1,32 @@ |
||||
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> |
||||
) |
||||
}) |
||||
@ -0,0 +1,15 @@ |
||||
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; |
||||
` |
||||
@ -0,0 +1,14 @@ |
||||
export const Share = () => ( |
||||
<svg |
||||
width='20' |
||||
height='21' |
||||
viewBox='0 0 20 21' |
||||
fill='none' |
||||
xmlns='http://www.w3.org/2000/svg' |
||||
> |
||||
<path |
||||
d='M15 17.8332C14.3056 17.8332 13.7153 17.5901 13.2292 17.104C12.7431 16.6179 12.5 16.0276 12.5 15.3332C12.5 15.2359 12.5069 15.1351 12.5208 15.0307C12.5347 14.9262 12.5556 14.8326 12.5833 14.7498L6.70833 11.3332C6.47222 11.5415 6.20833 11.7048 5.91667 11.8232C5.625 11.9415 5.31944 12.0004 5 11.9998C4.30556 11.9998 3.71528 11.7568 3.22917 11.2707C2.74306 10.7846 2.5 10.1943 2.5 9.49984C2.5 8.80539 2.74306 8.21512 3.22917 7.729C3.71528 7.24289 4.30556 6.99984 5 6.99984C5.31944 6.99984 5.625 7.059 5.91667 7.17734C6.20833 7.29567 6.47222 7.45873 6.70833 7.6665L12.5833 4.24984C12.5556 4.1665 12.5347 4.07289 12.5208 3.969C12.5069 3.86511 12.5 3.76428 12.5 3.6665C12.5 2.97206 12.7431 2.38178 13.2292 1.89567C13.7153 1.40956 14.3056 1.1665 15 1.1665C15.6944 1.1665 16.2847 1.40956 16.7708 1.89567C17.2569 2.38178 17.5 2.97206 17.5 3.6665C17.5 4.36095 17.2569 4.95123 16.7708 5.43734C16.2847 5.92345 15.6944 6.1665 15 6.1665C14.6806 6.1665 14.375 6.10761 14.0833 5.98984C13.7917 5.87206 13.5278 5.70873 13.2917 5.49984L7.41667 8.9165C7.44444 8.99984 7.46528 9.09373 7.47917 9.19817C7.49306 9.30261 7.5 9.40317 7.5 9.49984C7.5 9.59706 7.49306 9.69789 7.47917 9.80234C7.46528 9.90678 7.44444 10.0004 7.41667 10.0832L13.2917 13.4998C13.5278 13.2915 13.7917 13.1284 14.0833 13.0107C14.375 12.8929 14.6806 12.8337 15 12.8332C15.6944 12.8332 16.2847 13.0762 16.7708 13.5623C17.2569 14.0484 17.5 14.6387 17.5 15.3332C17.5 16.0276 17.2569 16.6179 16.7708 17.104C16.2847 17.5901 15.6944 17.8332 15 17.8332Z' |
||||
fill='white' |
||||
/> |
||||
</svg> |
||||
) |
||||
@ -0,0 +1,23 @@ |
||||
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}`, |
||||
}) |
||||
} |
||||
@ -0,0 +1,20 @@ |
||||
import { |
||||
API_ROOT, |
||||
} from 'config' |
||||
|
||||
import { callApi } from 'helpers' |
||||
|
||||
interface Response { |
||||
url: string, |
||||
} |
||||
|
||||
export const getShareHighlight = (sport_id: number, match_id: number): Promise<Response> => { |
||||
const config = { |
||||
method: 'GET', |
||||
} |
||||
|
||||
return callApi({ |
||||
config, |
||||
url: `${API_ROOT}/v1/share/highlight/${sport_id}/${match_id}`, |
||||
}) |
||||
} |
||||
@ -0,0 +1 @@ |
||||
export * from './getHighlight' |
||||
Loading…
Reference in new issue