mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-11-04 03:27:14 -05:00 
			
		
		
		
	Add head details for collections
This commit is contained in:
		
							parent
							
								
									9084a78420
								
							
						
					
					
						commit
						d73a37fbed
					
				@ -21,9 +21,11 @@
 | 
				
			|||||||
export const Head = ({
 | 
					export const Head = ({
 | 
				
			||||||
	title,
 | 
						title,
 | 
				
			||||||
	description,
 | 
						description,
 | 
				
			||||||
 | 
						image,
 | 
				
			||||||
}: {
 | 
					}: {
 | 
				
			||||||
	title?: string | null;
 | 
						title?: string | null;
 | 
				
			||||||
	description?: string | null;
 | 
						description?: string | null;
 | 
				
			||||||
 | 
						image?: string | null;
 | 
				
			||||||
}) => {
 | 
					}) => {
 | 
				
			||||||
	return null;
 | 
						return null;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -23,14 +23,17 @@ import NextHead from "next/head";
 | 
				
			|||||||
export const Head = ({
 | 
					export const Head = ({
 | 
				
			||||||
	title,
 | 
						title,
 | 
				
			||||||
	description,
 | 
						description,
 | 
				
			||||||
 | 
						image,
 | 
				
			||||||
}: {
 | 
					}: {
 | 
				
			||||||
	title?: string | null;
 | 
						title?: string | null;
 | 
				
			||||||
	description?: string | null;
 | 
						description?: string | null;
 | 
				
			||||||
 | 
						image?: string | null;
 | 
				
			||||||
}) => {
 | 
					}) => {
 | 
				
			||||||
	return (
 | 
						return (
 | 
				
			||||||
		<NextHead>
 | 
							<NextHead>
 | 
				
			||||||
			{title && <title>{title + " - Kyoo"}</title>}
 | 
								{title && <title>{title + " - Kyoo"}</title>}
 | 
				
			||||||
			{description && <meta name="description" content={description} />}
 | 
								{description && <meta name="description" content={description} />}
 | 
				
			||||||
 | 
								{image && <meta property="og:image" content={image} />}
 | 
				
			||||||
		</NextHead>
 | 
							</NextHead>
 | 
				
			||||||
	);
 | 
						);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@ import {
 | 
				
			|||||||
	getDisplayDate,
 | 
						getDisplayDate,
 | 
				
			||||||
} from "@kyoo/models";
 | 
					} from "@kyoo/models";
 | 
				
			||||||
import { Header as ShowHeader, TitleLine } from "../details/header";
 | 
					import { Header as ShowHeader, TitleLine } from "../details/header";
 | 
				
			||||||
import { Container, ImageBackground, P, Skeleton, ts } from "@kyoo/primitives";
 | 
					import { Container, Head, ImageBackground, P, Skeleton, ts } from "@kyoo/primitives";
 | 
				
			||||||
import { percent, px, useYoshiki } from "yoshiki/native";
 | 
					import { percent, px, useYoshiki } from "yoshiki/native";
 | 
				
			||||||
import { useTranslation } from "react-i18next";
 | 
					import { useTranslation } from "react-i18next";
 | 
				
			||||||
import { forwardRef } from "react";
 | 
					import { forwardRef } from "react";
 | 
				
			||||||
@ -48,6 +48,8 @@ const Header = ({ slug }: { slug: string }) => {
 | 
				
			|||||||
		<Fetch query={Header.query(slug)}>
 | 
							<Fetch query={Header.query(slug)}>
 | 
				
			||||||
			{({ isLoading, ...data }) => (
 | 
								{({ isLoading, ...data }) => (
 | 
				
			||||||
				<>
 | 
									<>
 | 
				
			||||||
 | 
										<Head title={data?.name} description={data?.overview} image={data?.thumbnail?.high} />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					<ImageBackground
 | 
										<ImageBackground
 | 
				
			||||||
						src={data?.thumbnail}
 | 
											src={data?.thumbnail}
 | 
				
			||||||
						quality="high"
 | 
											quality="high"
 | 
				
			||||||
 | 
				
			|||||||
@ -386,7 +386,7 @@ export const Header = ({
 | 
				
			|||||||
		<Fetch query={query}>
 | 
							<Fetch query={query}>
 | 
				
			||||||
			{({ isLoading, ...data }) => (
 | 
								{({ isLoading, ...data }) => (
 | 
				
			||||||
				<>
 | 
									<>
 | 
				
			||||||
					<Head title={data?.name} description={data?.overview} />
 | 
										<Head title={data?.name} description={data?.overview} image={data?.thumbnail?.high} />
 | 
				
			||||||
					<ImageBackground
 | 
										<ImageBackground
 | 
				
			||||||
						src={data?.thumbnail}
 | 
											src={data?.thumbnail}
 | 
				
			||||||
						quality="high"
 | 
											quality="high"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user