Fix remaining time for mobile + smaller heading sizes

This commit is contained in:
mrjvs 2023-11-29 17:51:22 +01:00
parent bc22c323a0
commit 761884ee01
3 changed files with 384 additions and 385 deletions

View File

@ -111,9 +111,10 @@
"short": "Back"
},
"time": {
"short": "-{{timeLeft}}",
"regular": "{{timeWatched}} / {{duration}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}"
"shortRegular": "{{timeWatched}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}",
"shortRemaining": "-{{timeLeft}}"
},
"nextEpisode": {
"next": "Next episode",
@ -203,15 +204,9 @@
"stopEditing": "Stop editing"
},
"titles": {
"morning": [
"Morning title"
],
"day": [
"Day title"
],
"night": [
"Night title"
]
"morning": ["Morning title"],
"day": ["Day title"],
"night": ["Night title"]
},
"search": {
"loading": "Loading...",

View File

@ -40,10 +40,14 @@ export function Time(props: { short?: boolean }) {
const timeFinished = new Date(Date.now() + secondsRemaining * 1e3);
const duration = formatSeconds(timeDuration, hasHours);
let localizationKey = "regular";
if (props.short) localizationKey = "short";
else if (timeFormat === VideoPlayerTimeFormat.REMAINING)
localizationKey = "remaining";
let localizationKey =
timeFormat === VideoPlayerTimeFormat.REGULAR ? "regular" : "remaining";
if (props.short) {
localizationKey =
timeFormat === VideoPlayerTimeFormat.REGULAR
? "shortRegular"
: "shortRemaining";
}
return (
<VideoPlayerButton onClick={() => toggleMode()}>

View File

@ -24,7 +24,7 @@ export function Heading2(props: TextProps) {
return (
<h2
className={[
"text-xl lg:text-3xl font-bold text-white mt-20 mb-9",
"text-xl lg:text-2xl font-bold text-white mt-20 mb-9",
props.border ? borderClass : null,
props.className ?? "",
].join(" ")}