Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improvements #101

Open
wants to merge 15 commits into
base: src
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
globals: {
__PATH_PREFIX__: true,
},
extends: `react-app`,
rules: {
"jsx-a11y/anchor-is-valid": 0,
},
};
45 changes: 18 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
{
"env": {
"browser": true,
"es6": true
"env": {
"browser": true,
"es6": true
},
"extends": ["plugin:react/recommended", "standard"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"extends": [
"plugin:react/recommended",
"standard"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": [
"react",
"babel"
],
"rules": {
"quotes": [
"off",
"double"
],
"react/prop-types": 0,
"semi": "always"
}
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": ["react", "babel"],
"rules": {
"quotes": ["off", "double"],
"react/prop-types": 0,
"semi": "always"
}
}
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

18 changes: 0 additions & 18 deletions firebase.json

This file was deleted.

61 changes: 0 additions & 61 deletions firestore.indexes.json

This file was deleted.

8 changes: 0 additions & 8 deletions firestore.rules

This file was deleted.

44 changes: 29 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"firebase-functions": "^3.7.0",
"firebase-tools": "^8.4.3",
"generate-password": "^1.5.1",
"husky": "^6.0.0",
"moment": "^2.24.0",
"pg": "^7.18.2",
"react": "^16.13.0",
Expand All @@ -33,6 +34,33 @@
"reactstrap": "^8.4.1",
"recompose": "^0.30.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.2",
"eslint-plugin-standard": "^4.0.1",
"prettier": "^2.3.0"
},
"lint-staged": {
"src/**/*.{js,jsx}": [
"eslint --max-warnings=0"
],
"src/**/*.{js,jsx,json,md}": [
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
Expand All @@ -53,19 +81,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.2",
"eslint-plugin-standard": "^4.0.1",
"prettier": "^2.0.5"
}
}
}
30 changes: 17 additions & 13 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ import { compose } from "recompose";

import * as ROUTES from "./constants/routes";

import MainLanding from "./pages/main-site/Landing";
import Panel from "./pages/main-site/Panel";
import About from "./pages/main-site/About";
import Contact from "./pages/main-site/Contact";
import Members from "./pages/main-site/Members";
import EboardM from "./pages/main-site/EboardM";
import EboardU from "./pages/main-site/EboardU";
import EboardE from "./pages/main-site/EboardE";
import Events from "./pages/main-site/Events";
import NotFound from "./pages/main-site/404";
import Login from "./pages/main-site/Login";
import Logout from "./pages/main-site/Logout";
import MainLanding from "./pages/Landing";
import Panel from "./pages/Panel";
import About from "./pages/About";
import Contact from "./pages/Contact";
import Members from "./pages/Members";
import EboardM from "./pages/EboardM";
import EboardU from "./pages/EboardU";
import EboardE from "./pages/EboardE";
import Events from "./pages/Events";
import NotFound from "./pages/404";
import Login from "./pages/Login";
import Logout from "./pages/Logout";





import { withAuthentication } from "./api/Session";

Expand All @@ -35,7 +39,7 @@ const AppBase = () => (
<Route exact path={ROUTES.PANEL} component={Panel} />
<Route exact path={ROUTES.MEMBEREDIT} component={EboardM} />
<Route exact path={ROUTES.EVENTEDIT} component={EboardE} />
<Route exact path={ROUTES.USEREDIT} component={EboardU} />
<Route exact path={ROUTES.USEREDIT} component={EboardU} />
<Route component={NotFound} />
</Switch>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/api/Firebase/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class Firebase {
this.storage = app.storage();
this.functions = app.functions();
}

getConfig = () => this.firestore.doc("config/general").get();

configDoc = () => this.firestore.doc("config/general");
generalSettings = () => this.firestore.doc("website/generalSettings");

generalSettings = () => this.firestore.doc("website/generalSettings");

// *** Auth API ***

Expand Down Expand Up @@ -147,7 +147,7 @@ class Firebase {
uploadImage = (className, fileName) =>
this.storage.ref("profiles").child(className).child(fileName);
delImage = (className, fileName) =>
this.storage.ref("profiles").child(className).child(fileName).delete();
this.storage.ref("profiles").child(className).child(fileName).delete();

// *** Events API ***

Expand Down
6 changes: 3 additions & 3 deletions src/api/Session/withAuthorization.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

import AuthUserContext from "./context";
import { withFirebase } from "../Firebase";
import NotEboard from "../../components/main-site/NotEboard";
import NotEboard from "../../components/NotEboard";

const withAuthorization = (condition) => (Component) => {
class WithAuthorization extends React.Component {
Expand All @@ -21,13 +21,13 @@ const withAuthorization = (condition) => (Component) => {
this.listener = this.props.firebase.onAuthUserListener(
(authUser) => {
if (!authUser) {
console.log("no auth user found")
console.log("no auth user found");
this.savePathname();
window.location.href = "/login";
}
},
() => {
console.log("authorization fallback")
console.log("authorization fallback");
this.savePathname();
window.location.href = "/login";
}
Expand Down
Binary file added src/assets/img/UPEclass.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/img/logo_resized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/img/projects.jpg
Binary file not shown.
Loading