From 3169729207868116a389087e49c61ba2117dc9d6 Mon Sep 17 00:00:00 2001 From: Armen <35077035+Armen9393@users.noreply.github.com> Date: Fri, 4 Sep 2020 13:07:37 +0300 Subject: [PATCH] Ott 399 click outside (#125) --- .../MatchCard/CardFinishedHover/index.tsx | 56 +++++++++++-------- .../MatchCard/CardLiveHover/index.tsx | 47 ++++++++-------- src/features/MatchCard/styled.tsx | 4 +- 3 files changed, 60 insertions(+), 47 deletions(-) diff --git a/src/features/MatchCard/CardFinishedHover/index.tsx b/src/features/MatchCard/CardFinishedHover/index.tsx index adda35b8..ad009e88 100644 --- a/src/features/MatchCard/CardFinishedHover/index.tsx +++ b/src/features/MatchCard/CardFinishedHover/index.tsx @@ -1,8 +1,10 @@ +import type { MouseEvent } from 'react' import React from 'react' import { Link } from 'react-router-dom' import { CloseButton } from 'features/Common' +import { OutsideClick } from 'features/OutsideClick' import { CardHoverInner, @@ -19,33 +21,39 @@ type CardFinishedHoverProps = { sportName: string, } +const stopProp = (e: MouseEvent) => { + e.stopPropagation() +} + export const CardFinishedHover = ({ id, onClose, sportName, }: CardFinishedHoverProps) => ( - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + ) diff --git a/src/features/MatchCard/CardLiveHover/index.tsx b/src/features/MatchCard/CardLiveHover/index.tsx index 4d31e5cf..4d0dc234 100644 --- a/src/features/MatchCard/CardLiveHover/index.tsx +++ b/src/features/MatchCard/CardLiveHover/index.tsx @@ -1,9 +1,10 @@ -import React from 'react' import type { MouseEvent } from 'react' +import React from 'react' import { Link } from 'react-router-dom' import { CloseButton } from 'features/Common' +import { OutsideClick } from 'features/OutsideClick' import { CardHoverInner, @@ -29,26 +30,28 @@ export const CardLiveHover = ({ onClose, sportName, }: CardLiveHoverProps) => ( - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + ) diff --git a/src/features/MatchCard/styled.tsx b/src/features/MatchCard/styled.tsx index 4439e378..ea4b419a 100644 --- a/src/features/MatchCard/styled.tsx +++ b/src/features/MatchCard/styled.tsx @@ -10,6 +10,7 @@ export const CardWrapper = styled.li.attrs({ position: relative; flex: 0 0 auto; min-width: ${MATCH_CARD_WIDTH}px; + height: 100%; padding-bottom: 18px; border-radius: 2px; border: 2px solid transparent; @@ -158,12 +159,13 @@ export const MoreVideo = styled(T9n)` export const CardHoverWrapper = styled(CardWrapper)` padding: 16px 24px; - cursor: default; + cursor: pointer; ` export const CardHoverInner = styled.div` position: relative; overflow: hidden; + width: fit-content; ` export const CardHoverTitle = styled(T9n)`