feat(ott-350): redirect to matches page (#117)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Armen 5 years ago committed by GitHub
parent 79d230d8f1
commit dca47f25b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/features/MatchCard/CardFinished/index.tsx
  2. 12
      src/features/MatchCard/CardFinishedHover/index.tsx
  3. 11
      src/features/MatchCard/CardLive/index.tsx
  4. 16
      src/features/MatchCard/CardLiveHover/index.tsx

@ -33,7 +33,7 @@ type CardFinishedProps = {
export const CardFinished = ({ export const CardFinished = ({
match: { match: {
date, id,
preview, preview,
sportName, sportName,
sportType, sportType,
@ -52,7 +52,15 @@ export const CardFinished = ({
showScore, showScore,
} = useCard() } = useCard()
if (isOpen) return <CardFinishedHover onClose={close} /> if (isOpen) {
return (
<CardFinishedHover
id={id}
sportName={sportName}
onClose={close}
/>
)
}
return ( return (
<CardWrapper <CardWrapper

@ -1,5 +1,7 @@
import React from 'react' import React from 'react'
import { Link } from 'react-router-dom'
import { CloseButton } from 'features/Common' import { CloseButton } from 'features/Common'
import { import {
@ -12,17 +14,25 @@ import {
} from '../styled' } from '../styled'
type CardFinishedHoverProps = { type CardFinishedHoverProps = {
id: number,
onClose: () => void, onClose: () => void,
sportName: string,
} }
export const CardFinishedHover = ({ onClose }: CardFinishedHoverProps) => ( export const CardFinishedHover = ({
id,
onClose,
sportName,
}: CardFinishedHoverProps) => (
<CardHoverWrapper> <CardHoverWrapper>
<CardHoverInner> <CardHoverInner>
<CloseButton onClick={onClose} /> <CloseButton onClick={onClose} />
<CardHoverTitle t='match_video' /> <CardHoverTitle t='match_video' />
<Rows> <Rows>
<Row> <Row>
<Link to={`${sportName}/matches/${id}`}>
<MoreVideo t='full_game' /> <MoreVideo t='full_game' />
</Link>
<MoreVideo t='game_time' /> <MoreVideo t='game_time' />
</Row> </Row>

@ -33,7 +33,6 @@ type CardLiveProps = {
export const CardLive = ({ export const CardLive = ({
match: { match: {
date,
id, id,
preview, preview,
sportName, sportName,
@ -53,7 +52,15 @@ export const CardLive = ({
showScore, showScore,
} = useCard() } = useCard()
if (isOpen) return <CardLiveHover onClose={close} /> if (isOpen) {
return (
<CardLiveHover
id={id}
sportName={sportName}
onClose={close}
/>
)
}
return ( return (
<CardWrapper <CardWrapper

@ -1,6 +1,8 @@
import React from 'react' import React from 'react'
import type { MouseEvent } from 'react' import type { MouseEvent } from 'react'
import { Link } from 'react-router-dom'
import { CloseButton } from 'features/Common' import { CloseButton } from 'features/Common'
import { import {
@ -13,26 +15,38 @@ import {
} from '../styled' } from '../styled'
type CardLiveHoverProps = { type CardLiveHoverProps = {
id: number,
onClose: () => void, onClose: () => void,
sportName: string,
} }
const stopProp = (e: MouseEvent<HTMLDivElement>) => { const stopProp = (e: MouseEvent<HTMLDivElement>) => {
e.stopPropagation() e.stopPropagation()
} }
export const CardLiveHover = ({ onClose }: CardLiveHoverProps) => ( export const CardLiveHover = ({
id,
onClose,
sportName,
}: CardLiveHoverProps) => (
<CardHoverWrapper onClick={onClose}> <CardHoverWrapper onClick={onClose}>
<CardHoverInner> <CardHoverInner>
<CloseButton onClick={onClose} /> <CloseButton onClick={onClose} />
<CardHoverTitle t='match_video' /> <CardHoverTitle t='match_video' />
<Rows onClick={stopProp}> <Rows onClick={stopProp}>
<Row> <Row>
<Link to={`${sportName}/matches/${id}`}>
<MoreVideo t='watch_now' /> <MoreVideo t='watch_now' />
</Link>
<Link to={`${sportName}/matches/${id}`}>
<MoreVideo t='watch_from_beginning' /> <MoreVideo t='watch_from_beginning' />
</Link>
</Row> </Row>
<Row> <Row>
<Link to={`${sportName}/matches/${id}`}>
<MoreVideo t='watch_from_last_pause' /> <MoreVideo t='watch_from_last_pause' />
</Link>
</Row> </Row>
</Rows> </Rows>
</CardHoverInner> </CardHoverInner>

Loading…
Cancel
Save