-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetaData.tsx
34 lines (31 loc) · 1.3 KB
/
metaData.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import Head from 'next/head';
import { OG_URL } from '@/data/appInfo';
interface PropTypes {
title: string;
description: string;
ogImageUrl?: string;
}
const MetaData = ({ title, description, ogImageUrl }: PropTypes) => {
return (
<Head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:image" content={ogImageUrl || OG_URL} />
<meta property="og:image:type" content={ogImageUrl || OG_URL} />
<meta property="og:image:width" content={ogImageUrl || OG_URL} />
<meta property="og:image:height" content={ogImageUrl || OG_URL} />
<meta name="twitter:image" content={ogImageUrl || OG_URL} />
<meta name="twitter:image:type" content={ogImageUrl || OG_URL} />
<meta name="twitter:image:width" content={ogImageUrl || OG_URL} />
<meta name="twitter:image:height" content={ogImageUrl || OG_URL} />
<meta property="og:image:alt" content="Crowdlaunch" />
<meta property="twitter:image:alt" content="Crowdlaunch" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="540" />
</Head>
);
};
export default MetaData;