Browse Source

Fix remaining time for mobile + smaller heading sizes

pull/499/head
mrjvs 2 years ago
parent
commit
761884ee01
  1. 17
      src/assets/locales/en.json
  2. 12
      src/components/player/atoms/Time.tsx
  3. 2
      src/components/utils/Text.tsx

17
src/assets/locales/en.json

@ -111,9 +111,10 @@ @@ -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 @@ @@ -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...",

12
src/components/player/atoms/Time.tsx

@ -40,10 +40,14 @@ export function Time(props: { short?: boolean }) { @@ -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()}>

2
src/components/utils/Text.tsx

@ -24,7 +24,7 @@ export function Heading2(props: TextProps) { @@ -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(" ")}

Loading…
Cancel
Save