lbry-sec/component/header.jsx

52 lines
1.2 KiB
React
Raw Normal View History

2021-03-29 04:10:33 +02:00
import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';
import { t, m } from '../i18n';
export function Header(props) {
const { faqPage } = props;
const lang = 'en'; // req.query.lang || 'en'
function __(message) {
return t(message, lang);
}
return (
<>
<Head>
<title>{__(m.title)}</title>
<link rel="icon" href="/favicon.ico" />
<meta
property="og:image"
2021-03-29 04:16:12 +02:00
content="https://i.imgur.com/onVjlEW.jpg"
2021-03-29 04:10:33 +02:00
key="image"
/>
<meta
property="og:description"
content={m.og_description}
2021-03-29 04:10:33 +02:00
key="description"
/>
</Head>
<header className={faqPage ? 'header header--faq' : 'header'}>
<Link href="/">
<span className="title">{__(m.title)}</span>
</Link>
<div className="header__links">
{!faqPage ? (
2021-03-29 05:32:35 +02:00
<Link href="/faq">
<span className="link">FAQ</span>
2021-03-29 04:10:33 +02:00
</Link>
) : (
<Link href="/">
<span className="link">{__(m.go_home)}</span>
</Link>
)}
</div>
2021-03-29 04:10:33 +02:00
</header>
</>
);
}