New Version - 1.0.1 — Set dark theme as default & fix eslint

This commit is contained in:
panr 2018-08-24 09:37:55 +02:00
parent 259f86abb2
commit 9f68618996
6 changed files with 113 additions and 52 deletions

View File

@ -50,42 +50,6 @@ rules:
- 2
- specialLink:
- to
# react
react/prop-types: 0
react/jsx-filename-extension: 0
react/jsx-no-bind:
- 2
- ignoreRefs: true
react/jsx-first-prop-new-line:
- 2
- never
react/jsx-indent-props:
- 2
- 2
react/jsx-closing-bracket-location:
- 1
- selfClosing: after-props
nonEmpty: after-props
react/prefer-stateless-function:
- 1
- ignorePureComponents: true
react/jsx-boolean-value:
- 2
- always
react/no-unused-prop-types: 0
# import - wyłączone! jak pogodzić resolver webpack i react-native?
import/no-unresolved: 0
import/extensions: 0
import/no-extraneous-dependencies: 0
import/prefer-default-export: 0
flowtype/delimiter-dangle:
- 2
- always-multiline
flowtype/require-return-type:
- 2
- always
- excludeArrowFunctions: true
annotateUndefined: always
globals:
document: true

View File

@ -6,7 +6,7 @@
{{ end }}
{{ partial "head.html" . }}
</head>
<body>
<body class="dark-theme">
<div class="container">
{{ partial "header.html" . }}

View File

@ -25,7 +25,9 @@
"clean-webpack-plugin": "^0.1.16",
"css-loader": "^1.0.0",
"cssnano": "^4.0.3",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
@ -45,8 +47,5 @@
"url-loader": "^1.0.1",
"webpack": "^4.16.1",
"webpack-cli": "^3.1.0"
},
"dependencies": {
"yarn": "^1.9.4"
}
}

View File

@ -51,6 +51,7 @@
height: 24px;
fill: currentColor;
margin-left: 10px;
cursor: pointer;
}
a {
@ -66,4 +67,4 @@
margin-right: 0;
}
}
}
}

View File

@ -1,12 +1,16 @@
// Toggle theme
const getTheme = localStorage.getItem('theme')
const getTheme = window.localStorage && window.localStorage.getItem('theme')
const themeToggle = document.querySelector('.theme-toggle')
const isDark = getTheme === 'dark'
const isDark = getTheme === 'dark' || getTheme === null
document.body.classList.toggle('dark-theme', isDark)
themeToggle.addEventListener('click', () => {
document.body.classList.toggle('dark-theme')
localStorage.setItem('theme', document.body.classList.contains('dark-theme') ? 'dark' : 'light')
})
window.localStorage &&
window.localStorage.setItem(
'theme',
document.body.classList.contains('dark-theme') ? 'dark' : 'light',
)
})

107
yarn.lock
View File

@ -967,6 +967,13 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"
aria-query@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
dependencies:
ast-types-flow "0.0.7"
commander "^2.11.0"
arr-diff@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
@ -979,6 +986,13 @@ arr-union@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
array-includes@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.7.0"
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@ -1015,6 +1029,10 @@ assign-symbols@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
ast-types-flow@0.0.7, ast-types-flow@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
async-each@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
@ -1040,6 +1058,12 @@ autoprefixer@^8.6.5:
postcss "^6.0.23"
postcss-value-parser "^3.2.3"
axobject-query@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.1.tgz#05dfa705ada8ad9db993fa6896f22d395b0b0a07"
dependencies:
ast-types-flow "0.0.7"
babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
@ -1504,6 +1528,10 @@ commander@2.16.x, commander@^2.8.1, commander@~2.16.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50"
commander@^2.11.0:
version "2.17.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
@ -1825,6 +1853,10 @@ cyclist@~0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"
damerau-levenshtein@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514"
date-now@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
@ -2020,6 +2052,10 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
emoji-regex@^6.5.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2"
emojis-list@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
@ -2054,7 +2090,7 @@ error-ex@^1.3.1:
dependencies:
is-arrayish "^0.2.1"
es-abstract@^1.5.1, es-abstract@^1.6.1:
es-abstract@^1.5.1, es-abstract@^1.6.1, es-abstract@^1.7.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165"
dependencies:
@ -2076,12 +2112,45 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
eslint-config-airbnb-base@^13.1.0:
version "13.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz#b5a1b480b80dfad16433d6c4ad84e6605052c05c"
dependencies:
eslint-restricted-globals "^0.1.1"
object.assign "^4.1.0"
object.entries "^1.0.4"
eslint-config-airbnb@^17.1.0:
version "17.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.0.tgz#3964ed4bc198240315ff52030bf8636f42bc4732"
dependencies:
eslint-config-airbnb-base "^13.1.0"
object.assign "^4.1.0"
object.entries "^1.0.4"
eslint-config-prettier@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3"
dependencies:
get-stdin "^5.0.1"
eslint-plugin-jsx-a11y@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.1.tgz#7bf56dbe7d47d811d14dbb3ddff644aa656ce8e1"
dependencies:
aria-query "^3.0.0"
array-includes "^3.0.3"
ast-types-flow "^0.0.7"
axobject-query "^2.0.1"
damerau-levenshtein "^1.0.4"
emoji-regex "^6.5.1"
has "^1.0.3"
jsx-ast-utils "^2.0.1"
eslint-restricted-globals@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7"
eslint-scope@^3.7.1, eslint-scope@~3.7.1:
version "3.7.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535"
@ -2546,6 +2615,10 @@ has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
has-symbols@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44"
has-unicode@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
@ -2577,7 +2650,7 @@ has-values@^1.0.0:
is-number "^3.0.0"
kind-of "^4.0.0"
has@^1.0.0, has@^1.0.1:
has@^1.0.0, has@^1.0.1, has@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
dependencies:
@ -3076,6 +3149,12 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"
jsx-ast-utils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f"
dependencies:
array-includes "^3.0.3"
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
@ -3596,7 +3675,7 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"
object-keys@^1.0.8:
object-keys@^1.0.11, object-keys@^1.0.8:
version "1.0.12"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2"
@ -3606,6 +3685,24 @@ object-visit@^1.0.0:
dependencies:
isobject "^3.0.0"
object.assign@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
dependencies:
define-properties "^1.1.2"
function-bind "^1.1.1"
has-symbols "^1.0.0"
object-keys "^1.0.11"
object.entries@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.0.4.tgz#1bf9a4dd2288f5b33f3a993d257661f05d161a5f"
dependencies:
define-properties "^1.1.2"
es-abstract "^1.6.1"
function-bind "^1.1.0"
has "^1.0.1"
object.getownpropertydescriptors@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
@ -5676,7 +5773,3 @@ yargs@^12.0.1:
which-module "^2.0.0"
y18n "^3.2.1 || ^4.0.0"
yargs-parser "^10.1.0"
yarn@^1.9.4:
version "1.9.4"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.9.4.tgz#3b82d8446b652775723900b470d966861976924b"