-
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(project): add support for custom screens
- Loading branch information
1 parent
3141fe3
commit 77b264c
Showing
63 changed files
with
812 additions
and
349 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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@use '../../styles/variables'; | ||
@use '../../styles/theme'; | ||
@use '../../styles/mixins/responsive'; | ||
@use '../../styles/mixins/typography'; | ||
|
||
.hero { | ||
height: 40vh; | ||
} | ||
|
||
.content { | ||
max-width: 60vw; | ||
padding: 37px 56px 0; | ||
|
||
@include responsive.tablet-only() { | ||
padding: 32px; | ||
} | ||
|
||
@include responsive.mobile-only() { | ||
max-width: none; | ||
padding: 16px; | ||
} | ||
} | ||
|
||
.title { | ||
@include typography.video-title-base; | ||
} | ||
|
||
.image { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
z-index: -1; | ||
width: 80vw; | ||
height: calc(85vw / 16 * 9); | ||
|
||
mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%); | ||
//noinspection CssInvalidPropertyValue | ||
-webkit-mask-image: radial-gradient(farthest-corner at 80% 20%, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0) 60%); /* stylelint-disable-line */ | ||
|
||
@include responsive.tablet-only() { | ||
width: 80vw; | ||
height: calc(140vw / 16 * 9); | ||
} | ||
|
||
@include responsive.mobile-only() { | ||
width: 110vw; | ||
height: calc(180vw / 16 * 9); | ||
} | ||
} |
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,26 @@ | ||
import React from 'react'; | ||
|
||
import styles from './Hero.module.scss'; | ||
|
||
import Image from '#src/components/Image/Image'; | ||
import type { ImageData } from '#types/playlist'; | ||
|
||
type Props = { | ||
title: string; | ||
description: string; | ||
image?: ImageData; | ||
}; | ||
|
||
const Hero = ({ title, description, image }: Props) => { | ||
return ( | ||
<div className={styles.hero}> | ||
<Image className={styles.image} image={image} width={1280} alt="" /> | ||
<div className={styles.content}> | ||
<h1 className={styles.title}>{title}</h1> | ||
<p>{description}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Hero; |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Navigate } from 'react-router'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { useSeriesData } from '#src/hooks/useSeriesData'; | ||
import useQueryParam from '#src/hooks/useQueryParam'; | ||
import { episodeURL } from '#src/utils/formatting'; | ||
import Loading from '#src/pages/Loading/Loading'; | ||
import ErrorPage from '#src/components/ErrorPage/ErrorPage'; | ||
|
||
type Props = { | ||
seriesId: string; | ||
episodeId?: string; | ||
}; | ||
|
||
/** | ||
* This container is mainly used to redirect the user to the correct episode media age. | ||
* | ||
* It fetches the series and redirects to the first episode. This behavior can be overridden when passing the | ||
* `episodeId` argument. | ||
* | ||
* Later, the watch history can also be used to determine the last watched episode to properly support continue | ||
* watching with series. | ||
*/ | ||
const SeriesRedirect = ({ seriesId, episodeId }: Props) => { | ||
const { t } = useTranslation('video'); | ||
const { isLoading, isPlaylistError, data } = useSeriesData(seriesId); | ||
const play = useQueryParam('play') === '1'; | ||
const feedId = useQueryParam('r'); | ||
|
||
if (isLoading) { | ||
return <Loading />; | ||
} | ||
|
||
if (isPlaylistError || !data) { | ||
return <ErrorPage title={t('series_error')} />; | ||
} | ||
|
||
const firstEpisode = data.seriesPlaylist.playlist[0]; | ||
const toEpisode = episodeId ? data.seriesPlaylist.playlist.find(({ mediaid }) => mediaid === episodeId) : firstEpisode; | ||
|
||
if (!toEpisode) { | ||
return <ErrorPage title={t('episode_not_found')} />; | ||
} | ||
|
||
return <Navigate to={episodeURL(toEpisode, seriesId, play, feedId)} replace />; | ||
}; | ||
|
||
export default SeriesRedirect; |
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
Oops, something went wrong.