Skip to content

Commit

Permalink
refactor: stop using webfontloader for loading custom google fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
asapzacy committed Mar 2, 2020
1 parent 0a16aa4 commit 8ab28fd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"react-router-dom": "^5.0.1",
"response-time": "^2.3.2",
"velocity-react": "^1.2.2",
"webfontloader": "^1.6.27",
"xml2js": "^0.4.17"
},
"devDependencies": {
Expand Down
15 changes: 2 additions & 13 deletions src/containers/Main/MainContainer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react'
import WebFont from 'webfontloader'
import React from 'react'

import { Header, Footer } from 'components'
import Routes from 'config/Routes'
Expand All @@ -17,7 +16,7 @@ class MainContainer extends Component {
componentDidMount() {
/* eslint-disable-next-line */
console.log('asap', process.env.NODE_ENV, Date.now())
this.loadFonts()

this.getScreenWidth()
window.addEventListener('resize', this.getScreenWidth)
}
Expand All @@ -32,16 +31,6 @@ class MainContainer extends Component {
window.removeEventListener('resize', this.getScreenWidth)
}

loadFonts = () => {
WebFont.load({
google: { families: ['Comfortaa:300,400,700'] },
active() {
document.getElementById('app').classList.add('ready')
},
classes: false
})
}

getScreenWidth = () => {
this.setState({ screenWidth: window.innerWidth }, () => {
const header = document.querySelector('header')
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12574,11 +12574,6 @@ wcwidth@^1.0.0:
dependencies:
defaults "^1.0.3"

webfontloader@^1.6.27:
version "1.6.28"
resolved "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.28.tgz#db786129253cb6e8eae54c2fb05f870af6675bae"
integrity sha1-23hhKSU8tujq5UwvsF+HCvZnW64=

webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
Expand Down

0 comments on commit 8ab28fd

Please # to comment.