Skip to content

Commit

Permalink
package updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed May 25, 2019
1 parent 4d0f674 commit d71924e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"plugins": ["react", "graphql", "prettier"],
"plugins": ["react", "graphql", "prettier", "react-hooks"],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
Expand All @@ -23,7 +23,9 @@
"quotes": ["error", "single"],
"semi": ["error", "never"],
"object-curly-spacing": ["error", "always"],
"prettier/prettier": "error"
"prettier/prettier": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
"dependencies": {
"classnames": "^2.2.6",
"file-saver": "^2.0.1",
"gatsby": "^2.3.31",
"gatsby-image": "^2.0.40",
"gatsby": "^2.7.1",
"gatsby-image": "^2.1.1",
"gatsby-plugin-favicon": "^3.1.6",
"gatsby-plugin-matomo": "^0.7.0",
"gatsby-plugin-offline": "^2.0.25",
"gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-plugin-sass": "^2.0.11",
"gatsby-plugin-sharp": "^2.0.35",
"gatsby-plugin-sharp": "^2.1.1",
"gatsby-plugin-sitemap": "^2.0.12",
"gatsby-plugin-svgr": "^2.0.2",
"gatsby-source-filesystem": "^2.0.32",
"gatsby-source-filesystem": "^2.0.37",
"gatsby-transformer-json": "^2.1.11",
"gatsby-transformer-sharp": "^2.1.18",
"gatsby-transformer-yaml": "^2.1.12",
"giphy-js-sdk-core": "^1.0.6",
"graphql": "^14.2.1",
"graphql": "^14.3.1",
"intersection-observer": "^0.7.0",
"js-yaml": "^3.13.1",
"node-sass": "^4.12.0",
Expand All @@ -56,9 +56,9 @@
"vcf": "^2.0.4"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/node": "^7.2.2",
"@babel/preset-env": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/node": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@svgr/webpack": "^4.2.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.7.1",
Expand All @@ -69,15 +69,16 @@
"eslint-plugin-graphql": "^3.0.3",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.7.1",
"jest-canvas-mock": "^2.0.0",
"jest-dom": "^3.1.3",
"jest-dom": "^3.4.0",
"ora": "^3.4.0",
"prepend": "^1.0.2",
"prettier": "^1.17.0",
"prettier-stylelint": "^0.4.2",
"react-testing-library": "^7.0.0",
"react-testing-library": "^7.0.1",
"slugify": "^1.3.4",
"stylelint": "^10.0.1",
"stylelint-config-css-modules": "^1.3.0",
Expand Down
10 changes: 5 additions & 5 deletions src/store/AppProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class AppProvider extends PureComponent {
state = {
dark: false,
toggleDark: () => this.toggleDark,
location: null
geolocation: null
}

static propTypes = {
Expand All @@ -21,8 +21,8 @@ export default class AppProvider extends PureComponent {

async componentDidMount() {
this.mounted = true
const location = await getCountry()
this.setState({ location })
const geolocation = await getCountry()
this.setState({ geolocation })
this.checkDark()
}

Expand All @@ -46,8 +46,8 @@ export default class AppProvider extends PureComponent {
// All the checks to see if we should go dark or light
//
async checkTimes() {
const { location, dark } = this.state
const { sunset, sunrise } = await getLocationTimes(location)
const { geolocation, dark } = this.state
const { sunset, sunrise } = await getLocationTimes(geolocation)
const now = new Date().getHours()
const weWantItDarkTimes = now >= sunset || now <= sunrise

Expand Down

0 comments on commit d71924e

Please sign in to comment.