File tree Expand file tree Collapse file tree 5 files changed +68
-13
lines changed Expand file tree Collapse file tree 5 files changed +68
-13
lines changed Original file line number Diff line number Diff line change 2020 "prismjs" : " ^1.19.0" ,
2121 "react" : " ^16.8.9" ,
2222 "react-dom" : " ^16.8.9" ,
23+ "react-helmet" : " ^6.0.0" ,
2324 "react-scripts" : " ^3.4.0" ,
2425 "react-twitter-embed" : " ^3.0.3" ,
2526 "react-ui" : " 1.0.0-beta.26" ,
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { Helmet } from "react-helmet" ;
3+ import PropTypes from 'prop-types' ;
4+
5+ export const Head = ( { title, description} ) => {
6+ return (
7+ < Helmet >
8+ < meta name = "viewport" content = "minimum-scale=1, initial-scale=1, width=device-width" />
9+ < title > { title } </ title >
10+ < meta name = "description" content = { description } />
11+
12+ { /* twitter */ }
13+ < meta name = "twitter:card" content = "summary" />
14+ < meta name = "twitter:site" content = "React-ui" />
15+ < meta name = "twitter:title" content = { title } />
16+ < meta name = "twitter:description" content = { description } />
17+
18+ { /* facebook */ }
19+ < meta property = "og:type" content = "website" />
20+ < meta property = "og:title" content = { title } />
21+ < meta property = "og:description" content = { description } />
22+ < meta property = "og:ttl" content = "604800" />
23+ </ Helmet >
24+ )
25+ }
26+
27+ Head . propTypes = {
28+ description : PropTypes . string ,
29+ title : PropTypes . string ,
30+ } ;
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export * from '../components/page'
77export * from '../components/section'
88export * from '../components/list'
99export * from '../components/divider'
10+ export * from '../components/head'
Original file line number Diff line number Diff line change @@ -2,19 +2,27 @@ import React from 'react'
22import { Stack , calc } from 'react-ui'
33
44import { Heading , Tagline } from './typography'
5+ import { Head } from './head'
56
6- export const Page = ( { title, tagline, badges, ...props } ) => (
7- < Stack direction = "vertical" gap = { 16 } marginBottom = { calc ( '16 * 2' ) } >
8- { title ? (
9- < Stack as = "section" direction = "vertical" gap = { 2 } >
10- < Stack justify = "space-between" align = "center" >
11- < Heading > { title } </ Heading >
7+ export const Page = ( { title, tagline, badges, ...props } ) => {
8+ debugger
9+ return (
10+ < >
11+ < Head title = { title } description = { tagline } />
12+ < Stack direction = "vertical" gap = { 16 } marginBottom = { calc ( '16 * 2' ) } >
13+ { title ? (
14+ < Stack as = "section" direction = "vertical" gap = { 2 } >
15+ < Stack justify = "space-between" align = "center" >
16+ < Heading > { title } </ Heading >
1217
13- < span > { badges || null } </ span >
14- </ Stack >
15- < Tagline > { tagline } </ Tagline >
18+ < span > { badges || null } </ span >
19+ </ Stack >
20+ < Tagline > { tagline } </ Tagline >
21+ </ Stack >
22+ ) : null }
23+ { props . children }
1624 </ Stack >
17- ) : null }
18- { props . children }
19- </ Stack >
20- )
25+ </ >
26+
27+ )
28+ }
Original file line number Diff line number Diff line change @@ -13930,6 +13930,16 @@ react-helmet-async@^1.0.2:
1393013930 react-fast-compare "^2.0.4"
1393113931 shallowequal "^1.1.0"
1393213932
13933+ react-helmet@^6.0.0:
13934+ version "6.0.0"
13935+ resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.0.0.tgz#fcb93ebaca3ba562a686eb2f1f9d46093d83b5f8"
13936+ integrity sha512-My6S4sa0uHN/IuVUn0HFmasW5xj9clTkB9qmMngscVycQ5vVG51Qp44BEvLJ4lixupTwDlU9qX1/sCrMN4AEPg==
13937+ dependencies:
13938+ object-assign "^4.1.1"
13939+ prop-types "^15.7.2"
13940+ react-fast-compare "^2.0.4"
13941+ react-side-effect "^2.1.0"
13942+
1393313943react-hotkeys@2.0.0:
1393413944 version "2.0.0"
1393513945 resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0.tgz#a7719c7340cbba888b0e9184f806a9ec0ac2c53f"
@@ -14096,6 +14106,11 @@ react-scripts@^3.4.0:
1409614106 optionalDependencies:
1409714107 fsevents "2.1.2"
1409814108
14109+ react-side-effect@^2.1.0:
14110+ version "2.1.0"
14111+ resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.0.tgz#1ce4a8b4445168c487ed24dab886421f74d380d3"
14112+ integrity sha512-IgmcegOSi5SNX+2Snh1vqmF0Vg/CbkycU9XZbOHJlZ6kMzTmi3yc254oB1WCkgA7OQtIAoLmcSFuHTc/tlcqXg==
14113+
1409914114react-sizeme@^2.6.7:
1410014115 version "2.6.12"
1410114116 resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-2.6.12.tgz#ed207be5476f4a85bf364e92042520499455453e"
You can’t perform that action at this time.
0 commit comments