Installing a clean linter for the frontend

This commit is contained in:
Nikola Bjelo committed 2018-11-06 02:38:16 +01:00
1 parent 6dd6fac7e6
commit b14828655f
33 files changed
+607 -401

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
module.exports = {
parser: 'babel-eslint',
extends: [
'airbnb-base',
'plugin:react/recommended',
],
rules: {
'no-underscore-dangle': 'off',
'no-param-reassign': 'off',
'react/prop-types': 0,
},
settings: {
'react': {
'pragma': 'React',
'version': '16.5',
},
},
env: {
'browser': true,
},
};
+233 -62
View File
@@ -227,9 +227,9 @@
"integrity": "sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg=="
},
"acorn": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz",
"integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==",
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz",
"integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==",
"dev": true
},
"acorn-jsx": {
@@ -239,9 +239,9 @@
"dev": true
},
"ajv": {
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz",
"integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==",
"version": "6.5.5",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz",
"integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
@@ -263,9 +263,9 @@
"dev": true
},
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"ansi-styles": {
@@ -381,6 +381,12 @@
"js-tokens": "^3.0.2"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
@@ -496,9 +502,9 @@
"integrity": "sha1-6LL+PX8at9aaMhma/5HqaTFAlRU="
},
"chardet": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
"dev": true
},
"circular-json": {
@@ -730,16 +736,16 @@
"dev": true
},
"eslint": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz",
"integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==",
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz",
"integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==",
"dev": true,
"requires": {
"ajv": "^6.5.0",
"babel-code-frame": "^6.26.0",
"@babel/code-frame": "^7.0.0",
"ajv": "^6.5.3",
"chalk": "^2.1.0",
"cross-spawn": "^6.0.5",
"debug": "^3.1.0",
"debug": "^4.0.1",
"doctrine": "^2.1.0",
"eslint-scope": "^4.0.0",
"eslint-utils": "^1.3.1",
@@ -751,11 +757,11 @@
"functional-red-black-tree": "^1.0.1",
"glob": "^7.1.2",
"globals": "^11.7.0",
"ignore": "^4.0.2",
"ignore": "^4.0.6",
"imurmurhash": "^0.1.4",
"inquirer": "^5.2.0",
"inquirer": "^6.1.0",
"is-resolvable": "^1.1.0",
"js-yaml": "^3.11.0",
"js-yaml": "^3.12.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0",
"lodash": "^4.17.5",
@@ -766,15 +772,24 @@
"path-is-inside": "^1.0.2",
"pluralize": "^7.0.0",
"progress": "^2.0.0",
"regexpp": "^2.0.0",
"regexpp": "^2.0.1",
"require-uncached": "^1.0.3",
"semver": "^5.5.0",
"semver": "^5.5.1",
"strip-ansi": "^4.0.0",
"strip-json-comments": "^2.0.1",
"table": "^4.0.3",
"table": "^5.0.2",
"text-table": "^0.2.0"
},
"dependencies": {
"debug": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
"integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==",
"dev": true,
"requires": {
"ms": "^2.1.1"
}
},
"eslint-scope": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
@@ -787,6 +802,17 @@
}
}
},
"eslint-config-airbnb-base": {
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz",
"integrity": "sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==",
"dev": true,
"requires": {
"eslint-restricted-globals": "^0.1.1",
"object.assign": "^4.1.0",
"object.entries": "^1.0.4"
}
},
"eslint-config-standard": {
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz",
@@ -953,6 +979,12 @@
"integrity": "sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==",
"dev": true
},
"eslint-restricted-globals": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz",
"integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=",
"dev": true
},
"eslint-scope": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
@@ -1023,13 +1055,13 @@
"dev": true
},
"external-editor": {
"version": "2.2.0",
"resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz",
"integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==",
"dev": true,
"requires": {
"chardet": "^0.4.0",
"iconv-lite": "^0.4.17",
"chardet": "^0.7.0",
"iconv-lite": "^0.4.24",
"tmp": "^0.0.33"
}
},
@@ -1219,6 +1251,14 @@
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
}
}
},
"has-flag": {
@@ -1316,21 +1356,21 @@
"dev": true
},
"inquirer": {
"version": "5.2.0",
"resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz",
"integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==",
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz",
"integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==",
"dev": true,
"requires": {
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.0",
"cli-cursor": "^2.1.0",
"cli-width": "^2.0.0",
"external-editor": "^2.1.0",
"external-editor": "^3.0.0",
"figures": "^2.0.0",
"lodash": "^4.3.0",
"lodash": "^4.17.10",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rxjs": "^5.5.2",
"rxjs": "^6.1.0",
"string-width": "^2.1.0",
"strip-ansi": "^4.0.0",
"through": "^2.3.6"
@@ -1788,6 +1828,30 @@
"integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==",
"dev": true
},
"object.assign": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
"integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"function-bind": "^1.1.1",
"has-symbols": "^1.0.0",
"object-keys": "^1.0.11"
}
},
"object.entries": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz",
"integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.6.1",
"function-bind": "^1.1.0",
"has": "^1.0.1"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -2327,20 +2391,12 @@
"dev": true
},
"rxjs": {
"version": "5.5.12",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz",
"integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==",
"version": "6.3.3",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz",
"integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"dev": true,
"requires": {
"symbol-observable": "1.0.1"
},
"dependencies": {
"symbol-observable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
"integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=",
"dev": true
}
"tslib": "^1.9.0"
}
},
"safer-buffer": {
@@ -2463,6 +2519,131 @@
"eslint-plugin-react": "~7.11.1",
"eslint-plugin-standard": "~4.0.0",
"standard-engine": "~9.0.0"
},
"dependencies": {
"chardet": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
"dev": true
},
"eslint": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz",
"integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==",
"dev": true,
"requires": {
"ajv": "^6.5.0",
"babel-code-frame": "^6.26.0",
"chalk": "^2.1.0",
"cross-spawn": "^6.0.5",
"debug": "^3.1.0",
"doctrine": "^2.1.0",
"eslint-scope": "^4.0.0",
"eslint-utils": "^1.3.1",
"eslint-visitor-keys": "^1.0.0",
"espree": "^4.0.0",
"esquery": "^1.0.1",
"esutils": "^2.0.2",
"file-entry-cache": "^2.0.0",
"functional-red-black-tree": "^1.0.1",
"glob": "^7.1.2",
"globals": "^11.7.0",
"ignore": "^4.0.2",
"imurmurhash": "^0.1.4",
"inquirer": "^5.2.0",
"is-resolvable": "^1.1.0",
"js-yaml": "^3.11.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0",
"lodash": "^4.17.5",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
"optionator": "^0.8.2",
"path-is-inside": "^1.0.2",
"pluralize": "^7.0.0",
"progress": "^2.0.0",
"regexpp": "^2.0.0",
"require-uncached": "^1.0.3",
"semver": "^5.5.0",
"strip-ansi": "^4.0.0",
"strip-json-comments": "^2.0.1",
"table": "^4.0.3",
"text-table": "^0.2.0"
}
},
"eslint-scope": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
"integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
"dev": true,
"requires": {
"esrecurse": "^4.1.0",
"estraverse": "^4.1.1"
}
},
"external-editor": {
"version": "2.2.0",
"resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
"dev": true,
"requires": {
"chardet": "^0.4.0",
"iconv-lite": "^0.4.17",
"tmp": "^0.0.33"
}
},
"inquirer": {
"version": "5.2.0",
"resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz",
"integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==",
"dev": true,
"requires": {
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.0",
"cli-cursor": "^2.1.0",
"cli-width": "^2.0.0",
"external-editor": "^2.1.0",
"figures": "^2.0.0",
"lodash": "^4.3.0",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rxjs": "^5.5.2",
"string-width": "^2.1.0",
"strip-ansi": "^4.0.0",
"through": "^2.3.6"
}
},
"rxjs": {
"version": "5.5.12",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz",
"integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==",
"dev": true,
"requires": {
"symbol-observable": "1.0.1"
}
},
"symbol-observable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
"integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=",
"dev": true
},
"table": {
"version": "4.0.3",
"resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz",
"integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==",
"dev": true,
"requires": {
"ajv": "^6.0.1",
"ajv-keywords": "^3.0.0",
"chalk": "^2.1.0",
"lodash": "^4.17.4",
"slice-ansi": "1.0.0",
"string-width": "^2.1.1"
}
}
}
},
"standard-engine": {
@@ -2502,14 +2683,6 @@
"dev": true,
"requires": {
"ansi-regex": "^3.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
}
}
},
"strip-bom": {
@@ -2539,15 +2712,13 @@
"integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0="
},
"table": {
"version": "4.0.3",
"resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz",
"integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz",
"integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==",
"dev": true,
"requires": {
"ajv": "^6.0.1",
"ajv-keywords": "^3.0.0",
"chalk": "^2.1.0",
"lodash": "^4.17.4",
"ajv": "^6.5.3",
"lodash": "^4.17.10",
"slice-ansi": "1.0.0",
"string-width": "^2.1.1"
}
+4
View File
@@ -13,6 +13,10 @@
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-react": "^7.11.1",
"react-hot-loader": "^4.3.11",
"standard": "^12.0.1"
},
+12 -12
View File
@@ -1,15 +1,15 @@
import React from 'react'
import { Query } from 'react-apollo'
import React from 'react';
import { Query } from 'react-apollo';
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/core/styles';
import styles from './styles'
import styles from './styles';
import { showEventCalls } from '../../../GraphQL/Calls/index'
import { showEventCalls } from '../../../GraphQL/Calls/index';
class Edit extends React.Component {
render () {
render() {
return (
<React.Fragment>
<Typography
@@ -25,18 +25,18 @@ class Edit extends React.Component {
variables={{ designator: this.props.match.params.slug }}
>
{({ loading, error, data }) => {
if (loading) return 'Loading...'
if (error) return `Error! ${error.message}`
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
return (
<p>
{data.events_Event.description}
</p>
)
);
}}
</Query>
</React.Fragment>
)
);
}
}
export default withStyles(styles)(Edit)
export default withStyles(styles)(Edit);
+3 -3
View File
@@ -1,4 +1,4 @@
const styles = theme => ({
})
const styles = () => ({
});
export default styles
export default styles;
+12 -12
View File
@@ -1,15 +1,15 @@
import React from 'react'
import { Query } from 'react-apollo'
import React from 'react';
import { Query } from 'react-apollo';
import Typography from '@material-ui/core/Typography'
import { withStyles } from '@material-ui/core/styles'
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/core/styles';
import styles from './styles'
import styles from './styles';
import { showEventCalls } from '../../../GraphQL/Calls/index'
import { showEventCalls } from '../../../GraphQL/Calls/index';
class Show extends React.Component {
render () {
render() {
return (
<React.Fragment>
<Typography
@@ -25,18 +25,18 @@ class Show extends React.Component {
variables={{ designator: this.props.match.params.slug }}
>
{({ loading, error, data }) => {
if (loading) return 'Loading...'
if (error) return `Error! ${error.message}`
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
return (
<p>
{data.events_Event.description}
</p>
)
);
}}
</Query>
</React.Fragment>
)
);
}
}
export default withStyles(styles)(Show)
export default withStyles(styles)(Show);
+3 -3
View File
@@ -1,4 +1,4 @@
const styles = theme => ({
})
const styles = () => ({
});
export default styles
export default styles;
+3 -7
View File
@@ -1,9 +1,5 @@
import React from 'react'
import React from 'react';
class Index extends React.Component {
render () {
return <p>Here will come a list the competitions you applied for</p>
}
}
const Index = () => <p>Here will come a list the competitions you applied for</p>;
export default Index
export default Index;
+17 -15
View File
@@ -1,27 +1,27 @@
import React from 'react'
import { Link } from 'react-router-dom'
import React from 'react';
import { Link } from 'react-router-dom';
import {
Grid, Paper,
Typography,
Button
} from '@material-ui/core'
import { withStyles } from '@material-ui/core/styles'
import styles from './styles'
Button,
} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import styles from './styles';
import { toLocalTime } from '../../utils'
import { toLocalTime } from '../../utils';
class Event extends React.Component {
render () {
const classes = this.props.classes
render() {
const { classes } = this.props;
const {
name,
designator,
startDatetime,
finishDatetime,
host,
description
} = this.props.event
description,
} = this.props.event;
return (
<Paper className={classes.card}>
<Grid container spacing={16}>
@@ -31,7 +31,9 @@ class Event extends React.Component {
<Typography gutterBottom>To : {toLocalTime(finishDatetime)} </Typography>
</Grid>
<Grid item xs>
<Typography gutterBottom>Hosted by: {host.alias} ({host.lastName} {host.firstName}) </Typography>
<Typography gutterBottom>
Hosted by: {host.alias} ({host.lastName} {host.firstName})
</Typography>
<Typography gutterBottom>Formula: </Typography>
<Typography gutterBottom>First prize: </Typography>
</Grid>
@@ -58,7 +60,7 @@ class Event extends React.Component {
color='primary'
size='small'
component={Link}
to={'/show/' + designator}
to={`/show/${designator}`}
>
Show
</Button>
@@ -67,8 +69,8 @@ class Event extends React.Component {
</Grid>
</Grid>
</Paper>
)
);
}
}
export default withStyles(styles)(Event)
export default withStyles(styles)(Event);
+39 -33
View File
@@ -1,64 +1,70 @@
import React from 'react'
import { Mutation } from 'react-apollo'
import { hostedEventsCalls } from '../../GraphQL/Calls/index'
import { DateTime } from 'luxon'
import React from 'react';
import { Mutation } from 'react-apollo';
import { DateTime } from 'luxon';
import {
Button,
TextField
} from '@material-ui/core'
import { ChevronLeft, ChevronRight } from '@material-ui/icons'
import { DateTimePicker } from 'material-ui-pickers'
TextField,
} from '@material-ui/core';
import { ChevronLeft, ChevronRight } from '@material-ui/icons';
import { DateTimePicker } from 'material-ui-pickers';
import { hostedEventsCalls } from '../../GraphQL/Calls/index';
class New extends React.Component {
constructor (props) {
super(props)
constructor(props) {
super(props);
this.state = {
name: '',
description: '',
startDatetime: DateTime.local().plus({ days: 1 }).startOf('day'),
finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day')
}
finishDatetime: DateTime.local().plus({ days: 8 }).startOf('day'),
};
}
render () {
const { name, description, startDatetime, finishDatetime } = this.state
render() {
const {
name, description, startDatetime, finishDatetime,
} = this.state;
return (
<Mutation mutation={hostedEventsCalls.EVENTS_HOSTEVENT}
update={(store, { data }) => {
const { events_EventsByHost: hostedEvents } = store.readQuery({ query: hostedEventsCalls.EVENTS_EVENTSBYHOST })
const { events_EventsByHost: hostedEvents } = store.readQuery({
query: hostedEventsCalls.EVENTS_EVENTSBYHOST,
});
store.writeQuery({
query: hostedEventsCalls.EVENTS_EVENTSBYHOST,
data: { events_EventsByHost: hostedEvents.concat([data.events_HostEvent]) }
})
this.props.handleNewEvent(data.events_HostEvent)
data: { events_EventsByHost: hostedEvents.concat([data.events_HostEvent]) },
});
this.props.handleNewEvent(data.events_HostEvent);
}
}
>
{(hostEvent, { data }) => (
{hostEvent => (
<div className='container'>
<form
onSubmit={e => {
e.preventDefault()
hostEvent({ variables: {
name: name,
description: description,
startDatetime: startDatetime.valueOf() / 1000,
finishDatetime: startDatetime.valueOf() / 1000
} })
onSubmit={(e) => {
e.preventDefault();
hostEvent({
variables: {
name,
description,
startDatetime: startDatetime.valueOf() / 1000,
finishDatetime: startDatetime.valueOf() / 1000,
},
});
}}
>
<TextField
label='Name'
value={name}
onChange={(e) => this.setState({ name: e.target.value })}
onChange={e => this.setState({ name: e.target.value })}
fullWidth
/>
<TextField
multiline
label='Description'
value={description}
onChange={(e) => this.setState({ description: e.target.value })}
onChange={e => this.setState({ description: e.target.value })}
fullWidth
/>
<DateTimePicker
@@ -70,7 +76,7 @@ class New extends React.Component {
leftArrowIcon={<ChevronLeft />}
rightArrowIcon={<ChevronRight />}
value={startDatetime}
onChange={(date) => this.setState({ startDatetime: date })}
onChange={date => this.setState({ startDatetime: date })}
helperText='Competition start date'
/>
<DateTimePicker
@@ -82,7 +88,7 @@ class New extends React.Component {
leftArrowIcon={<ChevronLeft />}
rightArrowIcon={<ChevronRight />}
value={finishDatetime}
onChange={(date) => this.setState({ finishDatetime: date })}
onChange={date => this.setState({ finishDatetime: date })}
helperText='Competition finishing date'
/>
<Button type='submit' variant='contained' color='secondary'>Create New Project</Button>
@@ -91,8 +97,8 @@ class New extends React.Component {
</div>
)}
</Mutation>
)
);
}
}
export default New
export default New;
+27 -28
View File
@@ -1,41 +1,41 @@
import React from 'react'
import { Query } from 'react-apollo'
import React from 'react';
import { Query } from 'react-apollo';
import {
Button,
Dialog,
DialogContent,
DialogContentText,
DialogTitle
} from '@material-ui/core'
DialogTitle,
} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles'
import styles from './styles'
import { withStyles } from '@material-ui/core/styles';
import styles from './styles';
import { hostedEventsCalls } from '../../GraphQL/Calls/index'
import { hostedEventsCalls } from '../../GraphQL/Calls/index';
import New from './New'
import Event from './Event'
import New from './New';
import Event from './Event';
class HostedEvent extends React.Component {
constructor (props) {
super(props)
constructor(props) {
super(props);
this.state = {
isNewEventOpen: false
}
isNewEventOpen: false,
};
}
handleNewEvent = (event) => {
this.props.history.push(`/edit/${event.designator}`)
this.props.history.push(`/edit/${event.designator}`);
};
render () {
const { classes } = this.props
render() {
const { classes } = this.props;
return (
<React.Fragment>
<Button variant='contained' color='secondary'
aria-label='addNewEvent' className={classes.addButton}
onClick={() => { this.setState({ isNewEventOpen: true }) }} >
onClick={() => { this.setState({ isNewEventOpen: true }); }} >
Host a new event
</Button>
@@ -43,24 +43,22 @@ class HostedEvent extends React.Component {
query={hostedEventsCalls.EVENTS_EVENTSBYHOST}
>
{({ loading, error, data }) => {
if (loading) return 'Loading...'
if (error) return `Error! ${error.message}`
const list = data.events_EventsByHost.map((event, index) => {
return (
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
const list = data.events_EventsByHost.map((event, index) => (
<Event key={index} event={event} />
)
})
));
return (
<React.Fragment>
{ list }
</React.Fragment>
)
);
}}
</Query>
<Dialog
open={this.state.isNewEventOpen}
onClose={() => { this.setState({ isNewEventOpen: false }) }}
onClose={() => { this.setState({ isNewEventOpen: false }); }}
aria-labelledby='addEvent-dialog-title'
>
<DialogTitle id='addEvent-dialog-title'>
@@ -68,14 +66,15 @@ class HostedEvent extends React.Component {
</DialogTitle>
<DialogContent>
<DialogContentText>
Here you will add just the minimal information, will be settable in the edit page of your event.
Here you will add just the minimal information,
will be settable in the edit page of your event.
</DialogContentText>
<New handleNewEvent={this.handleNewEvent} classes={classes} />
</DialogContent>
</Dialog>
</React.Fragment>
)
);
}
}
export default withStyles(styles)(HostedEvent)
export default withStyles(styles)(HostedEvent);
+7 -7
View File
@@ -5,22 +5,22 @@ const styles = theme => ({
marginTop: 20,
marginBottom: 20,
marginLeft: 400,
marginRight: 400
marginRight: 400,
},
buttonList: {
margin: theme.spacing.unit,
float: 'right'
float: 'right',
},
buttonGrid: {
marginTop: -20
marginTop: -20,
},
addButton: {
display: 'block',
padding: 20,
marginTop: 20,
marginRight: 20,
marginLeft: 'auto'
}
})
marginLeft: 'auto',
},
});
export default styles
export default styles;
+17 -15
View File
@@ -1,27 +1,27 @@
import React from 'react'
import { Link } from 'react-router-dom'
import React from 'react';
import { Link } from 'react-router-dom';
import {
Grid, Paper,
Typography,
Button
} from '@material-ui/core'
import { withStyles } from '@material-ui/core/styles'
import styles from './styles'
Button,
} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import styles from './styles';
import { toLocalTime } from '../../utils'
import { toLocalTime } from '../../utils';
class Event extends React.Component {
render () {
const classes = this.props.classes
render() {
const { classes } = this.props;
const {
name,
designator,
startDatetime,
finishDatetime,
host,
description
} = this.props.event
description,
} = this.props.event;
return (
<Paper className={classes.card}>
<Grid container spacing={16}>
@@ -31,7 +31,9 @@ class Event extends React.Component {
<Typography gutterBottom>To : {toLocalTime(finishDatetime)} </Typography>
</Grid>
<Grid item xs>
<Typography gutterBottom>Hosted by: {host.alias} ({host.lastName} {host.firstName}) </Typography>
<Typography gutterBottom>
Hosted by: {host.alias} ({host.lastName} {host.firstName})
</Typography>
<Typography gutterBottom>Formula: </Typography>
<Typography gutterBottom>First prize: </Typography>
</Grid>
@@ -48,7 +50,7 @@ class Event extends React.Component {
color='primary'
size='small'
component={Link}
to={'/show/' + designator}
to={`/show/${designator}`}
>
Show
</Button>
@@ -57,8 +59,8 @@ class Event extends React.Component {
</Grid>
</Grid>
</Paper>
)
);
}
}
export default withStyles(styles)(Event)
export default withStyles(styles)(Event);
+12 -14
View File
@@ -1,21 +1,19 @@
import React from 'react'
import { Typography } from '@material-ui/core'
import React from 'react';
import { Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles'
import styles from '../styles'
import { withStyles } from '@material-ui/core/styles';
import styles from '../styles';
import Event from '../Event'
import Event from '../Event';
class Future extends React.Component {
render () {
const classes = this.props.classes
const { FutureEvents } = this.props
render() {
const { classes } = this.props;
const { FutureEvents } = this.props;
const futureEvents = FutureEvents.map((event, index) => {
return (
const futureEvents = FutureEvents.map((event, index) => (
<Event key={index} event={event} />
)
})
));
return (
<React.Fragment>
<Typography
@@ -29,8 +27,8 @@ class Future extends React.Component {
</Typography>
{futureEvents}
</React.Fragment>
)
);
}
}
export default withStyles(styles)(Future)
export default withStyles(styles)(Future);
+8 -8
View File
@@ -1,12 +1,12 @@
import React from 'react'
import { Typography } from '@material-ui/core'
import React from 'react';
import { Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles'
import styles from '../styles'
import { withStyles } from '@material-ui/core/styles';
import styles from '../styles';
class History extends React.Component {
render () {
const classes = this.props.classes
render() {
const { classes } = this.props;
return (
<Typography
className={classes.title}
@@ -17,8 +17,8 @@ class History extends React.Component {
>
Your old events (maybe here, maybe not, who knows)
</Typography>
)
);
}
}
export default withStyles(styles)(History)
export default withStyles(styles)(History);
+14 -18
View File
@@ -1,26 +1,22 @@
import React from 'react'
import { Typography } from '@material-ui/core'
import React from 'react';
import { Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles'
import styles from '../styles'
import { withStyles } from '@material-ui/core/styles';
import styles from '../styles';
import Event from '../Event'
import Event from '../Event';
class Incoming extends React.Component {
render () {
const classes = this.props.classes
const { IncomingEvents, OngoingEvents } = this.props
render() {
const { classes } = this.props;
const { IncomingEvents, OngoingEvents } = this.props;
const incomingEvents = IncomingEvents.map((event, index) => {
return (
const incomingEvents = IncomingEvents.map((event, index) => (
<Event key={index} event={event} />
)
})
const ongoingEvents = OngoingEvents.map((event, index) => {
return (
));
const ongoingEvents = OngoingEvents.map((event, index) => (
<Event key={index} event={event} />
)
})
));
return (
<React.Fragment>
<Typography
@@ -49,8 +45,8 @@ class Incoming extends React.Component {
</Typography>
{incomingEvents}
</React.Fragment>
)
);
}
}
export default withStyles(styles)(Incoming)
export default withStyles(styles)(Incoming);
+12 -14
View File
@@ -1,21 +1,19 @@
import React from 'react'
import { Typography } from '@material-ui/core'
import React from 'react';
import { Typography } from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles'
import styles from '../styles'
import { withStyles } from '@material-ui/core/styles';
import styles from '../styles';
import Event from '../Event'
import Event from '../Event';
class Past extends React.Component {
render () {
const classes = this.props.classes
const { PastEvents } = this.props
render() {
const { classes } = this.props;
const { PastEvents } = this.props;
const pastEvents = PastEvents.map((event, index) => {
return (
const pastEvents = PastEvents.map((event, index) => (
<Event key={index} event={event} />
)
})
));
return (
<React.Fragment>
<Typography
@@ -29,8 +27,8 @@ class Past extends React.Component {
</Typography>
{pastEvents}
</React.Fragment>
)
);
}
}
export default withStyles(styles)(Past)
export default withStyles(styles)(Past);
+6 -6
View File
@@ -1,11 +1,11 @@
import Future from './Future'
import History from './History'
import Incoming from './Incoming'
import Past from './Past'
import Future from './Future';
import History from './History';
import Incoming from './Incoming';
import Past from './Past';
export {
Future,
History,
Incoming,
Past
}
Past,
};
+38 -34
View File
@@ -1,68 +1,70 @@
import React from 'react'
import { Query } from 'react-apollo'
import { DateTime } from 'luxon'
import React from 'react';
import { Query } from 'react-apollo';
import { DateTime } from 'luxon';
import {
Typography,
AppBar,
Tabs,
Tab
} from '@material-ui/core'
Tab,
} from '@material-ui/core';
import {
GetApp as IncomingIcon,
AlarmAdd as FutureIcon,
History as HistoryIcon
} from '@material-ui/icons'
History as HistoryIcon,
} from '@material-ui/icons';
import { withStyles } from '@material-ui/core/styles'
import styles from './styles'
import { withStyles } from '@material-ui/core/styles';
import styles from './styles';
import { listEventsCalls } from '../../GraphQL/Calls/index'
import { listEventsCalls } from '../../GraphQL/Calls/index';
import {
Future,
History,
Incoming,
Past
} from './Tabs'
Past,
} from './Tabs';
function TabContainer (props) {
function TabContainer(props) {
return (
<Typography component='div' style={{ padding: 8 * 3 }}>
{props.children}
</Typography>
)
);
}
class Search extends React.Component {
constructor (props) {
super(props)
constructor(props) {
super(props);
this.state = {
value: 0
}
value: 0,
};
}
handleChange = (event, value) => {
this.setState({ value })
this.setState({ value });
}
render () {
const classes = this.props.classes
const { value } = this.state
render() {
const { classes } = this.props;
const { value } = this.state;
return (
<Query
query={listEventsCalls.EVENTS_EVENTS}
>
{({ loading, error, data }) => {
if (loading) return 'Loading...'
if (error) return `Error! ${error.message}`
const now = ~~(DateTime.local().valueOf() / 1000)
const inTwoWeeks = ~~(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000)
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
const now = Math.floor(DateTime.local().valueOf() / 1000);
const inTwoWeeks = Math.floor(DateTime.local().plus({ weeks: 2 }).valueOf() / 1000);
const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now && event.startDatetime < inTwoWeeks)
const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now && event.startDatetime < now)
const FutureEvents = data.events_Events.filter(event => event.startDatetime > now)
const PastEvents = data.events_Events.filter(event => event.finishDatetime < now)
const IncomingEvents = data.events_Events.filter(event => event.startDatetime > now
&& event.startDatetime < inTwoWeeks);
const OngoingEvents = data.events_Events.filter(event => event.finishDatetime > now
&& event.startDatetime < now);
const FutureEvents = data.events_Events.filter(event => event.startDatetime > now);
const PastEvents = data.events_Events.filter(event => event.finishDatetime < now);
return (
<React.Fragment>
@@ -98,17 +100,19 @@ class Search extends React.Component {
/>
</Tabs>
</AppBar>
{value === 0 && <TabContainer><Incoming IncomingEvents={IncomingEvents} OngoingEvents={OngoingEvents} /></TabContainer>}
{value === 0 && <TabContainer>
<Incoming IncomingEvents={IncomingEvents} OngoingEvents={OngoingEvents} />
</TabContainer>}
{value === 1 && <TabContainer><Future FutureEvents={FutureEvents} /></TabContainer>}
{value === 2 && <TabContainer><History /></TabContainer>}
{value === 3 && <TabContainer><Past PastEvents={PastEvents} /></TabContainer>}
</div>
</React.Fragment>
)
);
}}
</Query>
)
);
}
}
export default withStyles(styles)(Search)
export default withStyles(styles)(Search);
+9 -9
View File
@@ -4,11 +4,11 @@ const styles = theme => ({
width: '100%',
backgroundColor: theme.palette.background.paper,
padding: 0,
margin: 0
margin: 0,
},
tabTitle: {
width: '25%',
maxWidth: 'none'
maxWidth: 'none',
},
card: {
flexGrow: 1,
@@ -16,18 +16,18 @@ const styles = theme => ({
marginTop: 20,
marginBottom: 20,
marginLeft: 400,
marginRight: 400
marginRight: 400,
},
buttonList: {
margin: theme.spacing.unit,
float: 'right'
float: 'right',
},
buttonGrid: {
marginTop: -20
marginTop: -20,
},
title: {
marginTop: 20
}
})
marginTop: 20,
},
});
export default styles
export default styles;
+14 -8
View File
@@ -1,11 +1,17 @@
import GamesIcon from '@material-ui/icons/Games'
import SearchIcon from '@material-ui/icons/Search'
import LibraryAddIcon from '@material-ui/icons/LibraryAdd'
import GamesIcon from '@material-ui/icons/Games';
import SearchIcon from '@material-ui/icons/Search';
import LibraryAddIcon from '@material-ui/icons/LibraryAdd';
const data = [
{ title: 'Look for an event', to: '/', icon: SearchIcon, text: '' },
{ title: 'Events you are enrolled in', to: '/my', icon: GamesIcon, text: '' },
{ title: 'Host your own competition', to: '/host', icon: LibraryAddIcon, text: '' }
]
{
title: 'Look for an event', to: '/', icon: SearchIcon, text: '',
},
{
title: 'Events you are enrolled in', to: '/my', icon: GamesIcon, text: '',
},
{
title: 'Host your own competition', to: '/host', icon: LibraryAddIcon, text: '',
},
];
export default data
export default data;
+16 -15
View File
@@ -1,16 +1,18 @@
import React from 'react'
import { Link } from 'react-router-dom'
import classNames from 'classnames'
import React from 'react';
import { Link } from 'react-router-dom';
import classNames from 'classnames';
import { AppBar, Toolbar, Typography, Button } from '@material-ui/core'
import { withStyles } from '@material-ui/core/styles'
import {
AppBar, Toolbar, Typography, Button,
} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import datas from './data'
import styles from './styles'
import datas from './data';
import styles from './styles';
const TopBar = ({ classes, user, match }) => {
const TopBar = ({ classes }) => {
const buttons = datas.map((data, index) => {
const Icon = data.icon
const Icon = data.icon;
return (
<Button
key={index}
@@ -22,9 +24,8 @@ const TopBar = ({ classes, user, match }) => {
to={data.to}>
<Icon className={classNames(classes.leftIcon, classes.iconSmall)} />
{data.text}
</Button>)
}
)
</Button>);
});
return (
<div className={classes.root}>
<AppBar position='static' color='secondary'>
@@ -36,7 +37,7 @@ const TopBar = ({ classes, user, match }) => {
</Toolbar>
</AppBar>
</div>
)
}
);
};
export default withStyles(styles)(TopBar)
export default withStyles(styles)(TopBar);
+12 -12
View File
@@ -1,37 +1,37 @@
const styles = theme => ({
root: {
flexGrow: 1
flexGrow: 1,
},
flex: {
flexGrow: 1,
marginLeft: 30
marginLeft: 30,
},
menuButton: {
marginLeft: -12,
marginRight: 20
marginRight: 20,
},
cssRoot: {
color: '#FFFFFF',
backgroundColor: theme.palette.secondary,
'&:hover': {
backgroundColor: theme.palette.dark
backgroundColor: theme.palette.dark,
},
whiteSpace: 'nowrap',
paddingRight: 2 * theme.spacing.unit,
paddingLeft: 2 * theme.spacing.unit
paddingLeft: 2 * theme.spacing.unit,
},
button: {
margin: theme.spacing.unit
margin: theme.spacing.unit,
},
leftIcon: {
marginRight: theme.spacing.unit
marginRight: theme.spacing.unit,
},
rightIcon: {
marginLeft: theme.spacing.unit
marginLeft: theme.spacing.unit,
},
iconSmall: {
fontSize: 20
}
})
fontSize: 20,
},
});
export default styles
export default styles;
+6 -6
View File
@@ -1,5 +1,5 @@
import gql from 'graphql-tag'
import { eventMinimalInfo } from '../Fragments'
import gql from 'graphql-tag';
import { eventMinimalInfo } from '../Fragments';
const EVENTS_HOSTEVENT = gql`
mutation Hosts_HostEvent($name: String!, $description: String!, $startDatetime: Int!, $finishDatetime: Int!) {
@@ -8,7 +8,7 @@ const EVENTS_HOSTEVENT = gql`
}
}
${eventMinimalInfo}
`
`;
const EVENTS_EVENTSBYHOST = gql`
query Hosts_EventsByHost{
events_EventsByHost {
@@ -16,8 +16,8 @@ const EVENTS_EVENTSBYHOST = gql`
}
}
${eventMinimalInfo}
`
`;
export default {
EVENTS_HOSTEVENT,
EVENTS_EVENTSBYHOST
}
EVENTS_EVENTSBYHOST,
};
+5 -5
View File
@@ -1,9 +1,9 @@
import hostedEventsCalls from './hostedEvents'
import listEventsCalls from './listEvents'
import showEventCalls from './showEvent'
import hostedEventsCalls from './hostedEvents';
import listEventsCalls from './listEvents';
import showEventCalls from './showEvent';
export {
hostedEventsCalls,
listEventsCalls,
showEventCalls
}
showEventCalls,
};
+5 -5
View File
@@ -1,5 +1,5 @@
import gql from 'graphql-tag'
import { eventMinimalInfo } from '../Fragments'
import gql from 'graphql-tag';
import { eventMinimalInfo } from '../Fragments';
const EVENTS_EVENTS = gql`
query Hosts_Events{
@@ -8,7 +8,7 @@ const EVENTS_EVENTS = gql`
}
}
${eventMinimalInfo}
`
`;
export default {
EVENTS_EVENTS
}
EVENTS_EVENTS,
};
+5 -5
View File
@@ -1,5 +1,5 @@
import gql from 'graphql-tag'
import { eventFullInfo } from '../Fragments'
import gql from 'graphql-tag';
import { eventFullInfo } from '../Fragments';
const EVENTS_EVENT = gql`
query Hosts_Event($designator: ID!) {
@@ -8,8 +8,8 @@ const EVENTS_EVENT = gql`
}
}
${eventFullInfo}
`
`;
export default {
EVENTS_EVENT
}
EVENTS_EVENT,
};
+3 -3
View File
@@ -1,4 +1,4 @@
import gql from 'graphql-tag'
import gql from 'graphql-tag';
export const eventMinimalInfo = gql`
fragment EventMinimalInfo on events_Event {
@@ -13,7 +13,7 @@ export const eventMinimalInfo = gql`
}
description
}
`
`;
export const eventFullInfo = gql`
fragment EventFullInfo on events_Event {
@@ -58,4 +58,4 @@ export const eventFullInfo = gql`
}
}
}
`
`;
+4 -4
View File
@@ -1,9 +1,9 @@
import {
eventMinimalInfo,
eventFullInfo
} from './event'
eventFullInfo,
} from './event';
export {
eventMinimalInfo,
eventFullInfo
}
eventFullInfo,
};
+24 -24
View File
@@ -1,40 +1,40 @@
import React, { Component } from 'react'
import { Route, BrowserRouter, Switch } from 'react-router-dom'
import React, { Component } from 'react';
import { Route, BrowserRouter, Switch } from 'react-router-dom';
import { MuiPickersUtilsProvider } from 'material-ui-pickers'
import LuxonUtils from 'material-ui-pickers/utils/luxon-utils'
import { MuiPickersUtilsProvider } from 'material-ui-pickers';
import LuxonUtils from 'material-ui-pickers/utils/luxon-utils';
import { getItem } from './utils/local-storage'
import { getItem } from './utils/local-storage';
import TopBar from './Components/TopBar'
import Search from './Components/Search'
import Events from './Components/Events'
import HostedEvents from './Components/HostedEvents'
import EditEvent from './Components/Event/Edit'
import TopBar from './Components/TopBar';
import Search from './Components/Search';
import Events from './Components/Events';
import HostedEvents from './Components/HostedEvents';
import EditEvent from './Components/Event/Edit';
class App extends Component {
constructor (props) {
super(props)
constructor(props) {
super(props);
this.state = {
user: null
}
user: null,
};
}
async componentDidMount () {
let user = await getItem('user')
async componentDidMount() {
let user = await getItem('user');
if (user !== null && user !== undefined && user !== 'undefined') {
user = JSON.parse(user)
this.setState({ user })
user = JSON.parse(user);
this.setState({ user });
}
}
render () {
let loggedIn
render() {
let loggedIn;
if (this.state.user !== null) {
loggedIn = (<TopBar match={this.props.match} user={this.state.user} />)
loggedIn = (<TopBar match={this.props.match} user={this.state.user} />);
} else {
loggedIn = ''
loggedIn = '';
}
return (
<MuiPickersUtilsProvider utils={LuxonUtils}>
@@ -51,8 +51,8 @@ class App extends Component {
</div>
</BrowserRouter>
</MuiPickersUtilsProvider>
)
);
}
}
export default App
export default App;
+10 -8
View File
@@ -1,10 +1,12 @@
export const toLocalTime = (epoch) => {
let localDate = new Date(0)
localDate.setUTCSeconds(epoch)
var options = { year: 'numeric', month: 'long', day: '2-digit' }
const localDate = new Date(0);
localDate.setUTCSeconds(epoch);
const options = { year: 'numeric', month: 'long', day: '2-digit' };
return (
localDate.toLocaleDateString(options) +
' at ' +
localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })
)
}
`${localDate.toLocaleDateString(options)
} at ${
localDate.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}`
);
};
export const temporaryFunction = input => input;
+5 -5
View File
@@ -1,9 +1,9 @@
const getItem = async name => window.localStorage.getItem(name)
const setItem = async (name, value) => window.localStorage.setItem(name, value)
const removeItem = async name => window.localStorage.removeItem(name)
const getItem = async name => window.localStorage.getItem(name);
const setItem = async (name, value) => window.localStorage.setItem(name, value);
const removeItem = async name => window.localStorage.removeItem(name);
export {
getItem,
setItem,
removeItem
}
removeItem,
};
+1 -1
View File
@@ -3,6 +3,6 @@ module.exports = {
extends: 'airbnb-base',
rules: {
'no-underscore-dangle': 'off',
'no-param-reassign': 'off'
'no-param-reassign': 'off',
}
};