From b8ab630f0a7eccf177035ee25c25d0c8a07d6ac7 Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Thu, 15 Jul 2021 20:15:41 +0200 Subject: [PATCH 1/5] style(selector): fix search type selection on mobile --- src/components/TypeSelector.css | 5 +++-- src/components/TypeSelector.js | 4 ++-- src/views/Search.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/TypeSelector.css b/src/components/TypeSelector.css index 80902e74..2a3d0743 100644 --- a/src/components/TypeSelector.css +++ b/src/components/TypeSelector.css @@ -5,6 +5,8 @@ position: relative; margin-bottom: 1.5rem; max-width: 100%; +} +.typeSelector:not(.nowrap) { flex-wrap: wrap; } @@ -52,8 +54,7 @@ } @media screen and (max-width: 700px) { - .typeSelector { - width: 80%; + .typeSelector:not(.nowrap) { display: block; } } diff --git a/src/components/TypeSelector.js b/src/components/TypeSelector.js index ee96b275..05f545e3 100644 --- a/src/components/TypeSelector.js +++ b/src/components/TypeSelector.js @@ -5,14 +5,14 @@ import './TypeSelector.css' // setType: (txt: string) => void // choices: { label: string, value: string }[] // selected: string -export function TypeSelector({ setType, choices, selected }) { +export function TypeSelector({ setType, choices, selected, noWrap = false }) { const selectedIndex = choices.findIndex(v=>v.value===selected); const transformStyles = { opacity: selectedIndex!==-1?1:0, transform: `translateX(${selectedIndex!==-1?selectedIndex*7:0}rem)` } return ( -
+
{choices.map(v=>(
setType(v.value)}> {v.label} diff --git a/src/views/Search.js b/src/views/Search.js index 67b0179c..14d60b50 100644 --- a/src/views/Search.js +++ b/src/views/Search.js @@ -115,6 +115,7 @@ export function SearchView() { { label: "Movie", value: "movie" }, { label: "TV Show", value: "show" } ]} + noWrap={true} selected={type} /> searchMovie(str, type)} /> From cb29acb38c687ee8eeacb49bd7635b39b006a180 Mon Sep 17 00:00:00 2001 From: Jip Fr Date: Thu, 15 Jul 2021 20:34:25 +0200 Subject: [PATCH 2/5] feat(video): store progress --- src/components/VideoElement.css | 2 +- src/components/VideoElement.js | 4 ++-- src/views/Movie.js | 31 ++++++++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/components/VideoElement.css b/src/components/VideoElement.css index cff2fd1d..f252de55 100644 --- a/src/components/VideoElement.css +++ b/src/components/VideoElement.css @@ -1,6 +1,6 @@ .videoElement { width: 100%; - background-color: var(--content); + background-color: black; border-radius: 5px; } diff --git a/src/components/VideoElement.js b/src/components/VideoElement.js index f1aa506a..35ec011a 100644 --- a/src/components/VideoElement.js +++ b/src/components/VideoElement.js @@ -5,7 +5,7 @@ import { VideoPlaceholder } from './VideoPlaceholder' // streamUrl: string // loading: boolean -export function VideoElement({ streamUrl, loading }) { +export function VideoElement({ streamUrl, loading, setProgress }) { const videoRef = React.useRef(null); const [error, setError] = React.useState(false); @@ -37,6 +37,6 @@ export function VideoElement({ streamUrl, loading }) { return No video selected return ( -