@autobusal/common 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Meta.tsx +23 -0
- package/index.ts +5 -0
- package/package.json +9 -0
package/Meta.tsx
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Helmet } from 'react-helmet';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
title: string
|
|
5
|
+
keywords?: string
|
|
6
|
+
description?: string
|
|
7
|
+
children: JSX.Element | JSX.Element[] | string | null | false
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Meta = ({ title, keywords, description, children }: Props): JSX.Element => (
|
|
11
|
+
<>
|
|
12
|
+
<Helmet>
|
|
13
|
+
<title>{ title }</title>
|
|
14
|
+
|
|
15
|
+
{ keywords && <meta name="keywords" content={ keywords } /> }
|
|
16
|
+
{ description && <meta name="description" content={ description } /> }
|
|
17
|
+
</Helmet>
|
|
18
|
+
|
|
19
|
+
{ children }
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default Meta;
|
package/index.ts
ADDED