diff --git a/src/features/AddCardForm/components/ElementContainer/index.tsx b/src/features/AddCardForm/components/ElementContainer/index.tsx index 27c3a955..68666e87 100644 --- a/src/features/AddCardForm/components/ElementContainer/index.tsx +++ b/src/features/AddCardForm/components/ElementContainer/index.tsx @@ -40,11 +40,12 @@ const Label = styled.label` :nth-child(3){ width: 48%; + + &.AddCardForm_Address { + width: 100%; + } } - /* & .test_class { - width: 48%; - } */ :nth-child(4){ width: 48%; } diff --git a/src/features/AddCardForm/components/Form/index.tsx b/src/features/AddCardForm/components/Form/index.tsx index ac97322d..453d96b5 100644 --- a/src/features/AddCardForm/components/Form/index.tsx +++ b/src/features/AddCardForm/components/Form/index.tsx @@ -162,7 +162,7 @@ export const AddCardFormInner = (props: Props) => { { label={isLabelVisible(ElementTypes.CardAddress) ? 'address' : ''} width='100%' backgroundColor={inputsBackground} + className='AddCardForm_Address' > ( - new Intl.DateTimeFormat(locale, { weekday: 'short' }).format(date) + new Intl.DateTimeFormat(locale || 'en', { weekday: 'short' }).format(date) ) const createDayGetter = (weekStart: Date, locale: string) => (day: number) => { diff --git a/src/features/UserAccount/styled.tsx b/src/features/UserAccount/styled.tsx index 809f9f98..b4bc7cd1 100644 --- a/src/features/UserAccount/styled.tsx +++ b/src/features/UserAccount/styled.tsx @@ -265,4 +265,12 @@ export const ScButtonGetHighlight = styled(ButtonOutline)` border: 1px solid #FFFFFF; border-radius: 5px; filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.3)); + + ${isMobileDevice + ? css` + margin: 5px 0; + height: 100%; + width: 100%; + ` + : ''}; ` diff --git a/src/features/VideoPlayer/hooks/index.tsx b/src/features/VideoPlayer/hooks/index.tsx index fc14cd0e..bff60797 100644 --- a/src/features/VideoPlayer/hooks/index.tsx +++ b/src/features/VideoPlayer/hooks/index.tsx @@ -14,6 +14,7 @@ type Ref = Parameters>[1] export type Props = { className?: string, + controls?: boolean, crossOrigin?: string, height?: string, hidden?: boolean, diff --git a/src/features/VideoPlayer/index.tsx b/src/features/VideoPlayer/index.tsx index 8d39709d..05dac725 100644 --- a/src/features/VideoPlayer/index.tsx +++ b/src/features/VideoPlayer/index.tsx @@ -7,6 +7,7 @@ import { Video } from './styled' export const VideoPlayer = forwardRef((props: Props, ref) => { const { className, + controls, crossOrigin, height, hidden, @@ -42,6 +43,7 @@ export const VideoPlayer = forwardRef((props: Props, re onPause={onPause} onError={onError} crossOrigin={crossOrigin} + controls={controls} /> ) }) diff --git a/src/pages/HighlightsPage/components/FormHighlights/index.tsx b/src/pages/HighlightsPage/components/FormHighlights/index.tsx index 87f8d9a8..12379478 100644 --- a/src/pages/HighlightsPage/components/FormHighlights/index.tsx +++ b/src/pages/HighlightsPage/components/FormHighlights/index.tsx @@ -23,7 +23,7 @@ import { PriceInfoType, PriceInfo } from '../PriceInfo' const labelWidth = 100 const wrapperHeight = 50 -export const FormHighlights = ({ price }: PriceInfoType) => { +export const FormHighlights = ({ price, setIsOpenPopupVideo }: PriceInfoType) => { const { formRef, formState: { @@ -55,7 +55,8 @@ export const FormHighlights = ({ price }: PriceInfoType) => { return ( - {isMobileDevice ? : null} + {isMobileDevice + ? : null} diff --git a/src/pages/HighlightsPage/components/PriceInfo/index.tsx b/src/pages/HighlightsPage/components/PriceInfo/index.tsx index 72992660..61eeaff9 100644 --- a/src/pages/HighlightsPage/components/PriceInfo/index.tsx +++ b/src/pages/HighlightsPage/components/PriceInfo/index.tsx @@ -10,9 +10,10 @@ import { export type PriceInfoType = { price: number, + setIsOpenPopupVideo: (open: boolean) => void, } -export const PriceInfo = ({ price }: PriceInfoType) => ( +export const PriceInfo = ({ price, setIsOpenPopupVideo }: PriceInfoType) => ( @@ -21,7 +22,7 @@ export const PriceInfo = ({ price }: PriceInfoType) => ( $ {price} - + setIsOpenPopupVideo(true)}> diff --git a/src/pages/HighlightsPage/components/VideoHighlight/index.tsx b/src/pages/HighlightsPage/components/VideoHighlight/index.tsx new file mode 100644 index 00000000..e9263266 --- /dev/null +++ b/src/pages/HighlightsPage/components/VideoHighlight/index.tsx @@ -0,0 +1,43 @@ +import { useRef } from 'react' + +import { VideoPlayer } from 'features/VideoPlayer' + +import { readToken } from 'helpers' + +import { ScModal } from './styled' + +interface VideoPropsType { + isOpenPopupVideo: boolean, + setIsOpenPopupVideo: (open: boolean) => void, +} + +const urls = { + production: 'https://instat-stream-production.s3.eu-west-1.amazonaws.com/media/highlights/demo/demohighlight.mp4', + stage: 'https://instat-stream-staging.s3.eu-west-1.amazonaws.com/media/highlights/demo/demohighlight.mp4', +} +export const VideoHighlight = ({ + isOpenPopupVideo, + setIsOpenPopupVideo, +} :VideoPropsType) => { + const videoRef = useRef(null) + return ( + // eslint-disable-next-line + setIsOpenPopupVideo(false)} + withCloseButton={false} + > + + + ) +} diff --git a/src/pages/HighlightsPage/components/VideoHighlight/styled.tsx b/src/pages/HighlightsPage/components/VideoHighlight/styled.tsx new file mode 100644 index 00000000..9400a596 --- /dev/null +++ b/src/pages/HighlightsPage/components/VideoHighlight/styled.tsx @@ -0,0 +1,37 @@ +import styled, { css } from 'styled-components/macro' + +import { ModalWindow } from 'features/Modal/styled' +import { Modal as BaseModal } from 'features/Modal' + +import { isMobileDevice } from 'config/userAgent' + +export const ScModal = styled(BaseModal)` + background-color: rgba(0, 0, 0, 0.7); + + ${ModalWindow} { + background-color: #333333; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding: 50px; + width: 80vw; + height: 80vh; + + > * { + margin-bottom: 25px; + } + + ${isMobileDevice + ? css` + width: calc(100vw - 60px); + @media screen and (orientation: landscape){ + max-width: calc(100vw - 80px); + height: calc(100vh - 20px); + overflow: auto; + } + ` + : ''}; + } +` diff --git a/src/pages/HighlightsPage/index.tsx b/src/pages/HighlightsPage/index.tsx index 7629ae7b..e81f25bd 100644 --- a/src/pages/HighlightsPage/index.tsx +++ b/src/pages/HighlightsPage/index.tsx @@ -1,3 +1,4 @@ +import { useState } from 'react' import { Link } from 'react-router-dom' import { isMobileDevice } from 'config/userAgent' @@ -15,6 +16,7 @@ import { PriceInfo } from './components/PriceInfo' import { FormHighlights } from './components/FormHighlights' import { MatchesHighlights } from './components/MatchesHighlights' import { ThanksPopup } from './components/ThanksPopup' +import { VideoHighlight } from './components/VideoHighlight' import { dataForPayHighlights, @@ -36,6 +38,7 @@ import { const HighlightsPage = () => { const playerMatches = useRecoilValue(playerMatchesState) const [isOpenPopupChangeCard, setIsOpenPopupChangeCard] = useRecoilState(openPopupChangeCard) + const [isOpenPopupVideo, setIsOpenPopupVideo] = useState(false) const { data } = useRecoilValue(dataForPayHighlights) const isNotEmpty = !data?.duration @@ -58,8 +61,10 @@ const HighlightsPage = () => { - {isMobileDevice ? null : } - + {isMobileDevice ? null : ( + + )} + { title='payment' /> + ) }