-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inlineplayer): add inline player support
- Loading branch information
Showing
39 changed files
with
1,635 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ module.exports = { | |
'e2e', | ||
'signing', | ||
'entitlement', | ||
'inlineplayer', | ||
'config', | ||
'epg', | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,7 +196,3 @@ | |
border: 3px solid white; | ||
border-radius: 100%; | ||
} | ||
|
||
.related { | ||
position: relative; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
src/components/VideoDetailsInline/VideoDetailsInline.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
@use '../../styles/variables'; | ||
@use '../../styles/theme'; | ||
@use '../../styles/mixins/responsive'; | ||
@use '../../styles/mixins/typography'; | ||
|
||
.details { | ||
padding: 24px 0; | ||
color: var(--primary-color); | ||
font-family: var(--body-font-family); | ||
font-weight: 400; | ||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.2); | ||
|
||
@include responsive.desktop-small-only() { | ||
padding: 24px 0; | ||
} | ||
|
||
@include responsive.tablet-only() { | ||
padding: 24px 0 0; | ||
} | ||
|
||
@include responsive.mobile-only() { | ||
padding: variables.$base-spacing 0 0; | ||
} | ||
} | ||
|
||
.inlinePlayerMetadata { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: variables.$base-spacing; | ||
padding-bottom: variables.$base-spacing; | ||
border-bottom: 1px solid rgba(255, 255, 255, 0.3); | ||
|
||
> button { | ||
min-width: fit-content; | ||
margin-left: 8px; | ||
} | ||
|
||
@include responsive.mobile-and-small-tablet() { | ||
flex-wrap: wrap; | ||
|
||
> button:nth-last-child(3) { | ||
flex: 1 1 100%; | ||
margin: 0 0 8px 0; | ||
} | ||
|
||
> button:nth-last-child(2) { | ||
flex: 0 0 calc(50% - 4px); | ||
margin: 0 4px 0 0; | ||
} | ||
|
||
> button:nth-last-child(1) { | ||
flex: 0 0 calc(50% - 4px); | ||
margin: 0 0 0 4px; | ||
} | ||
} | ||
} | ||
|
||
.title { | ||
@include typography.video-title-base; | ||
margin-bottom: variables.$base-spacing; | ||
|
||
@include responsive.mobile-only() { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
div.title { | ||
font-weight: initial; | ||
} | ||
|
||
.primaryMetadata { | ||
flex: 1; | ||
flex-basis: 100%; | ||
margin-right: auto; | ||
margin-bottom: 0; | ||
font-size: 16px; | ||
line-height: 18px; | ||
letter-spacing: 0.15px; | ||
|
||
> div.live { | ||
display: inline-block; | ||
margin-right: 8px; | ||
|
||
@include responsive.mobile-only() { | ||
margin: 2px 4px 0 0; | ||
padding: 2px 4px; | ||
} | ||
} | ||
|
||
@include responsive.mobile-and-small-tablet() { | ||
margin-bottom: variables.$base-spacing; | ||
font-size: 14px; | ||
} | ||
} | ||
|
||
.secondaryMetadata { | ||
margin-top: 24px; | ||
margin-bottom: 8px; | ||
font-size: 20px; | ||
line-height: 20px; | ||
letter-spacing: 0.5px; | ||
|
||
@include responsive.mobile-only() { | ||
margin: 4px 0; | ||
font-size: 18px; | ||
} | ||
} | ||
|
||
.description { | ||
min-height: 21px; | ||
margin-bottom: 24px; | ||
font-size: 18px; | ||
line-height: 20px; | ||
letter-spacing: 0.5px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import Tag from '../Tag/Tag'; | ||
|
||
import styles from './VideoDetailsInline.module.scss'; | ||
|
||
import CollapsibleText from '#src/components/CollapsibleText/CollapsibleText'; | ||
import useBreakpoint, { Breakpoint } from '#src/hooks/useBreakpoint'; | ||
|
||
type Props = { | ||
title: string | React.ReactNode; | ||
description: string; | ||
primaryMetadata: React.ReactNode; | ||
shareButton: React.ReactNode; | ||
favoriteButton: React.ReactNode; | ||
trailerButton: React.ReactNode; | ||
live?: boolean; | ||
}; | ||
|
||
const VideoDetailsInline: React.FC<Props> = ({ title, description, primaryMetadata, shareButton, favoriteButton, trailerButton, live }) => { | ||
const { t } = useTranslation('common'); | ||
const breakpoint: Breakpoint = useBreakpoint(); | ||
const isMobile = breakpoint === Breakpoint.xs; | ||
|
||
const TitleComponent = typeof title === 'string' ? 'h2' : 'div'; | ||
|
||
return ( | ||
<div className={styles.details} data-testid="video-details-inline"> | ||
<TitleComponent className={styles.title}>{title}</TitleComponent> | ||
<div className={styles.inlinePlayerMetadata}> | ||
<div className={styles.primaryMetadata}> | ||
{live && ( | ||
<Tag className={styles.live} isLive> | ||
{t('live')} | ||
</Tag> | ||
)} | ||
{primaryMetadata} | ||
</div> | ||
{trailerButton} | ||
{favoriteButton} | ||
{shareButton} | ||
</div> | ||
<CollapsibleText text={description} className={styles.description} maxHeight={isMobile ? 60 : 'none'} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default VideoDetailsInline; |
Oops, something went wrong.