2018-09-10 09:55:26 -07:00
|
|
|
import React from 'react';
|
2018-09-17 13:55:49 -07:00
|
|
|
import { Helmet } from 'react-helmet';
|
2018-10-22 10:16:15 -07:00
|
|
|
import { RouteComponentProps, withRouter } from 'react-router';
|
2019-03-12 14:13:04 -07:00
|
|
|
import { withNamespaces, WithNamespaces } from 'react-i18next';
|
2018-10-22 10:16:15 -07:00
|
|
|
import ogpLogo from 'static/images/ogp-logo.png';
|
|
|
|
import { urlToPublic } from 'utils/helpers';
|
2018-09-10 09:55:26 -07:00
|
|
|
|
2018-10-22 10:16:15 -07:00
|
|
|
interface OwnProps {
|
2018-09-10 09:55:26 -07:00
|
|
|
title: string;
|
|
|
|
}
|
|
|
|
|
2019-03-12 14:13:04 -07:00
|
|
|
type Props = OwnProps & RouteComponentProps<any> & WithNamespaces;
|
2018-10-22 10:16:15 -07:00
|
|
|
|
|
|
|
class BasicHead extends React.Component<Props> {
|
2018-09-10 09:55:26 -07:00
|
|
|
render() {
|
2019-03-12 14:13:04 -07:00
|
|
|
const { children, title, t } = this.props;
|
2018-10-22 10:16:15 -07:00
|
|
|
const defaultOgpUrl = process.env.PUBLIC_HOST_URL + this.props.location.pathname;
|
|
|
|
const defaultOgpImage = urlToPublic(ogpLogo);
|
2018-09-10 09:55:26 -07:00
|
|
|
return (
|
|
|
|
<div>
|
2018-09-17 13:55:49 -07:00
|
|
|
<Helmet>
|
2019-01-22 10:40:20 -08:00
|
|
|
<title>{`ZF Grants - ${title}`}</title>
|
2019-03-12 14:13:04 -07:00
|
|
|
<meta name="description" content={t('site.description')} />
|
|
|
|
<meta
|
|
|
|
name="keywords"
|
|
|
|
content="Zcash, Zcash Foundation, Zcash Foundation Grants, Zcash Grants, Zcash Grant, ZF Grants, ZFGrants"
|
|
|
|
/>
|
2018-09-10 09:55:26 -07:00
|
|
|
<link
|
|
|
|
rel="stylesheet"
|
|
|
|
href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
|
|
|
|
integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"
|
|
|
|
crossOrigin="anonymous"
|
|
|
|
/>
|
2018-10-22 10:16:15 -07:00
|
|
|
|
|
|
|
{/* open graph protocol defaults, can be overridden in children <HeaderDetails ...> */}
|
2019-01-22 10:40:20 -08:00
|
|
|
<meta property="og:site_name" content="ZF Grants" />
|
|
|
|
<meta property="og:title" content={`ZF Grants - ${title}`} />
|
2019-03-12 14:13:04 -07:00
|
|
|
<meta property="og:description" content={t('site.description')} />
|
2018-10-22 10:16:15 -07:00
|
|
|
<meta property="og:type" content="website" />
|
|
|
|
<meta property="og:url" content={defaultOgpUrl} />
|
|
|
|
<meta property="og:image" content={defaultOgpImage} />
|
|
|
|
<meta property="og:locale" content="en_US" />
|
|
|
|
{/* <meta property="og:locale:alternate" content="en_US" /> */}
|
|
|
|
{/* <meta property="og:locale:alternate" content="de_DE" /> */}
|
|
|
|
|
|
|
|
{/* twitter defaults, can be overridden in children <HeaderDetails ...> */}
|
|
|
|
<meta property="twitter:card" content="summary_large_image" />
|
2019-03-12 14:13:04 -07:00
|
|
|
<meta property="twitter:site" content="@zcashfoundation" />
|
2019-01-22 10:40:20 -08:00
|
|
|
<meta property="twitter:title" content={`ZF Grants - ${title}`} />
|
2019-03-12 14:13:04 -07:00
|
|
|
<meta property="twitter:description" content={t('site.description')} />
|
2018-10-22 10:16:15 -07:00
|
|
|
<meta property="twitter:image" content={defaultOgpImage} />
|
|
|
|
<meta property="twitter:url" content={defaultOgpUrl} />
|
2018-09-17 13:55:49 -07:00
|
|
|
</Helmet>
|
2018-09-10 09:55:26 -07:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2018-10-22 10:16:15 -07:00
|
|
|
|
2019-03-12 14:13:04 -07:00
|
|
|
export default withNamespaces()(withRouter(BasicHead));
|