Fix font loading && revert to react-helmet v4
This commit is contained in:
parent
c4c1d60ba1
commit
3d52815256
6 changed files with 17 additions and 31 deletions
|
|
@ -11,12 +11,11 @@
|
|||
"polished": "^1.0.0",
|
||||
"react": "^15.4.2",
|
||||
"react-dom": "^15.4.2",
|
||||
"react-helmet": "^5",
|
||||
"react-helmet": "^4.0.0",
|
||||
"react-markdown": "^2.4.6",
|
||||
"react-router-dom": "^4.0.0",
|
||||
"react-snapshot": "^1.0.4",
|
||||
"styled-components": "^1.4.4",
|
||||
"webfontloader": "^1.6.27"
|
||||
"styled-components": "^1.4.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import NoMatch from './views/NoMatch'
|
|||
import Nav from './components/Nav'
|
||||
import NavLink from './components/NavLink'
|
||||
import Logo from './components/Logo'
|
||||
import globalStyles, { loadFonts } from './globalStyles'
|
||||
import globalStyles from './globalStyles'
|
||||
|
||||
const siteTitle = 'HyperStatic'
|
||||
const routes = [
|
||||
|
|
@ -27,13 +27,15 @@ const routes = [
|
|||
class App extends Component {
|
||||
componentWillMount () {
|
||||
globalStyles()
|
||||
loadFonts()
|
||||
}
|
||||
render () {
|
||||
return (
|
||||
<Router>
|
||||
<div>
|
||||
<Helmet titleTemplate={`${siteTitle} | %s`} />
|
||||
<Helmet
|
||||
titleTemplate={`${siteTitle} | %s`}
|
||||
link={[{rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Open+Sans'}]}
|
||||
/>
|
||||
<Nav>
|
||||
<Logo>🍉</Logo>
|
||||
{routes.map((route, i) => (
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
import { injectGlobal } from 'styled-components'
|
||||
import { normalize } from 'polished'
|
||||
import WebFont from 'webfontloader'
|
||||
|
||||
export const loadFonts = () => WebFont.load({
|
||||
google: {
|
||||
families: ['Cabin:400,500,600']
|
||||
}
|
||||
})
|
||||
|
||||
export const font = {
|
||||
primary: `'Cabin', sans-serif`
|
||||
primary: `'Open Sans', sans-serif`
|
||||
}
|
||||
|
||||
export const color = {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ export default ({title}) => (
|
|||
<p>A sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.</p>
|
||||
</Container>
|
||||
</Section>
|
||||
<Helmet>
|
||||
<title>{title}</title>
|
||||
</Helmet>
|
||||
<Helmet title={title} />
|
||||
</Page>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@ export default ({title}) => {
|
|||
<Marked source={content} />
|
||||
</Container>
|
||||
</Section>
|
||||
<Helmet>
|
||||
<title>{title}</title>
|
||||
</Helmet>
|
||||
<Helmet title={title} />
|
||||
</Page>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
18
yarn.lock
18
yarn.lock
|
|
@ -1539,7 +1539,7 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
|
|||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
|
||||
deep-equal@^1.0.1:
|
||||
deep-equal@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
|
||||
|
||||
|
|
@ -3832,7 +3832,7 @@ oauth-sign@~0.8.1:
|
|||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
|
||||
|
||||
object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
|
||||
object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
|
||||
|
|
@ -4516,12 +4516,12 @@ react-dom, react-dom@^15.3.0:
|
|||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.0"
|
||||
|
||||
react-helmet@^5:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-5.0.1.tgz#ffaf4553bb47c68a65edc53782d7fc6706796343"
|
||||
react-helmet@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-4.0.0.tgz#df74bcd6ff585a1ccbbfba5aaa1c346cabc43d03"
|
||||
dependencies:
|
||||
deep-equal "^1.0.1"
|
||||
object-assign "^4.1.1"
|
||||
deep-equal "1.0.1"
|
||||
object-assign "^4.0.1"
|
||||
react-side-effect "^1.1.0"
|
||||
|
||||
react-markdown@^2.4.6:
|
||||
|
|
@ -5560,10 +5560,6 @@ watchpack@^0.2.1:
|
|||
chokidar "^1.0.0"
|
||||
graceful-fs "^4.1.2"
|
||||
|
||||
webfontloader@^1.6.27:
|
||||
version "1.6.27"
|
||||
resolved "https://registry.yarnpkg.com/webfontloader/-/webfontloader-1.6.27.tgz#c3899649b0653aa57d0a23388f82409e0df224ba"
|
||||
|
||||
webidl-conversions@^3.0.0, webidl-conversions@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue