refactor: make components more modular

would help in implementing name route

also did some stylistic changes
This commit is contained in:
zyachel
2023-04-15 20:56:15 +05:30
parent 8ce02d0236
commit 18ca98fd4a
43 changed files with 757 additions and 796 deletions

View File

@ -1,4 +1,5 @@
import Head from 'next/head';
import { ReactNode } from 'react';
type Props = {
title: string;
@ -6,11 +7,15 @@ type Props = {
imgUrl?: string;
};
const BASE_URL = process.env.NEXT_PUBLIC_URL ?? 'https://iket.me';
const Meta = ({
title,
description = 'libremdb, a free & open source IMDb front-end.',
imgUrl = 'icon.svg',
}: Props) => {
const url = new URL(imgUrl, BASE_URL);
return (
<Head>
<meta charSet='UTF-8' />
@ -30,10 +35,7 @@ const Meta = ({
<meta property='og:site_name' content='libremdb' />
<meta property='og:locale' content='en_US' />
<meta property='og:type' content='video.movie' />
<meta
property='og:image'
content={`${process.env.NEXT_PUBLIC_URL}/${imgUrl}`}
/>
<meta property='og:image' content={url.toString()} />
</Head>
);
};