1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Update <title> based on content

This commit is contained in:
Josh Heng 2021-08-02 14:15:24 +01:00
parent 5c2ce4c30c
commit e529916805
4 changed files with 31 additions and 0 deletions

View file

@ -13,6 +13,7 @@
"json5": "^2.2.0", "json5": "^2.2.0",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "4.0.3", "react-scripts": "4.0.3",
"web-vitals": "^1.0.1" "web-vitals": "^1.0.1"

View file

@ -1,5 +1,6 @@
import React from 'react' import React from 'react'
import { useRouteMatch, useHistory } from 'react-router-dom' import { useRouteMatch, useHistory } from 'react-router-dom'
import { Helmet } from 'react-helmet';
import { Title } from '../components/Title' import { Title } from '../components/Title'
import { Card } from '../components/Card' import { Card } from '../components/Card'
import { useMovie } from '../hooks/useMovie' import { useMovie } from '../hooks/useMovie'
@ -109,6 +110,10 @@ export function MovieView(props) {
return ( return (
<div className={`cardView showType-${streamData.type}`}> <div className={`cardView showType-${streamData.type}`}>
<Helmet>
<title>{streamData.title}{streamData.type === 'show' && ` | S${season}E${episode}`} | movie-web</title>
</Helmet>
<Card fullWidth> <Card fullWidth>
<Title accent="Return to home" accentLink="search"> <Title accent="Return to home" accentLink="search">
{streamData.title} {streamData.title}

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { Redirect, useRouteMatch, useHistory } from 'react-router-dom'; import { Redirect, useRouteMatch, useHistory } from 'react-router-dom';
import { Helmet } from 'react-helmet';
import { InputBox } from '../components/InputBox'; import { InputBox } from '../components/InputBox';
import { Title } from '../components/Title'; import { Title } from '../components/Title';
import { Card } from '../components/Card'; import { Card } from '../components/Card';
@ -136,6 +137,10 @@ export function SearchView() {
return ( return (
<div className="cardView"> <div className="cardView">
<Helmet>
<title>{type === 'movie' ? 'Movies' : 'TV Shows'} | movie-web</title>
</Helmet>
<Card> <Card>
<DiscordBanner /> <DiscordBanner />
{errorStatus ? <ErrorBanner>{errorStatus}</ErrorBanner> : ''} {errorStatus ? <ErrorBanner>{errorStatus}</ErrorBanner> : ''}

View file

@ -9046,6 +9046,21 @@ react-error-overlay@^6.0.9:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a"
integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==
react-fast-compare@^3.1.1:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
react-helmet@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
dependencies:
object-assign "^4.1.1"
prop-types "^15.7.2"
react-fast-compare "^3.1.1"
react-side-effect "^2.1.0"
react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1" version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
@ -9156,6 +9171,11 @@ react-scripts@4.0.3:
optionalDependencies: optionalDependencies:
fsevents "^2.1.3" fsevents "^2.1.3"
react-side-effect@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==
react@^17.0.2: react@^17.0.2:
version "17.0.2" version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"