1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-11-13 16:45:12 +01:00

package updates

This commit is contained in:
Matthias Kretschmann 2019-05-25 13:26:57 +02:00
parent 4d0f674c6a
commit d71924e1a5
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 20 additions and 17 deletions

View File

@ -5,7 +5,7 @@
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"plugins": ["react", "graphql", "prettier"],
"plugins": ["react", "graphql", "prettier", "react-hooks"],
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
@ -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": {

View File

@ -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",
@ -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",
@ -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",

View File

@ -8,7 +8,7 @@ export default class AppProvider extends PureComponent {
state = {
dark: false,
toggleDark: () => this.toggleDark,
location: null
geolocation: null
}
static propTypes = {
@ -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()
}
@ -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