diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..30646b6 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,9 @@ +module.exports = { + globals: { + __PATH_PREFIX__: true, + }, + extends: `react-app`, + rules: { + "jsx-a11y/anchor-is-valid": 0, + }, +}; \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index e8183db..19bd1c0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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" + } } diff --git a/.firebaserc b/.firebaserc deleted file mode 100644 index 8fc70dc..0000000 --- a/.firebaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "upe-website-fa07a" - } -} diff --git a/firebase.json b/firebase.json deleted file mode 100644 index 3047637..0000000 --- a/firebase.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "firestore": { - "rules": "firestore.rules", - "indexes": "firestore.indexes.json" - }, - "functions": {}, - "storage": { - "rules": "storage.rules" - }, - "emulators": { - "functions": { - "port": 5001 - }, - "firestore": { - "port": 8080 - } - } -} diff --git a/firestore.indexes.json b/firestore.indexes.json deleted file mode 100644 index cae3f17..0000000 --- a/firestore.indexes.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "indexes": [ - { - "collectionGroup": "events", - "queryScope": "COLLECTION", - "fields": [ - { - "fieldPath": "index", - "order": "ASCENDING" - }, - { - "fieldPath": "title", - "order": "ASCENDING" - } - ] - }, - { - "collectionGroup": "users", - "queryScope": "COLLECTION", - "fields": [ - { - "fieldPath": "class", - "order": "ASCENDING" - }, - { - "fieldPath": "name", - "order": "ASCENDING" - } - ] - }, - { - "collectionGroup": "users", - "queryScope": "COLLECTION", - "fields": [ - { - "fieldPath": "eboard", - "order": "ASCENDING" - }, - { - "fieldPath": "positionRank", - "order": "ASCENDING" - } - ] - }, - { - "collectionGroup": "users", - "queryScope": "COLLECTION", - "fields": [ - { - "fieldPath": "email", - "order": "ASCENDING" - }, - { - "fieldPath": "name", - "order": "ASCENDING" - } - ] - } - ], - "fieldOverrides": [] -} diff --git a/firestore.rules b/firestore.rules deleted file mode 100644 index 8d700cd..0000000 --- a/firestore.rules +++ /dev/null @@ -1,8 +0,0 @@ -rules_version = '2'; -service cloud.firestore { - match /databases/{database}/documents { - match /{document=**} { - allow read, write: if true; - } - } -} \ No newline at end of file diff --git a/package.json b/package.json index 4717a34..8694d1e 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } -} \ No newline at end of file +} diff --git a/src/App.js b/src/App.js index 9c5dccd..352ab0f 100644 --- a/src/App.js +++ b/src/App.js @@ -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"; @@ -35,7 +39,7 @@ const AppBase = () => ( - + diff --git a/src/api/Firebase/firebase.js b/src/api/Firebase/firebase.js index 2b15754..1a658a9 100644 --- a/src/api/Firebase/firebase.js +++ b/src/api/Firebase/firebase.js @@ -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 *** @@ -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 *** diff --git a/src/api/Session/withAuthorization.js b/src/api/Session/withAuthorization.js index 62b8755..4a2bb74 100644 --- a/src/api/Session/withAuthorization.js +++ b/src/api/Session/withAuthorization.js @@ -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 { @@ -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"; } diff --git a/src/assets/img/UPEclass.jpg b/src/assets/img/UPEclass.jpg new file mode 100644 index 0000000..cac7fd8 Binary files /dev/null and b/src/assets/img/UPEclass.jpg differ diff --git a/src/assets/img/logo_resized.png b/src/assets/img/logo_resized.png new file mode 100644 index 0000000..b6bf92d Binary files /dev/null and b/src/assets/img/logo_resized.png differ diff --git a/src/assets/img/projects.jpg b/src/assets/img/projects.jpg deleted file mode 100644 index 510d825..0000000 Binary files a/src/assets/img/projects.jpg and /dev/null differ diff --git a/src/components/main-site/AddClass.js b/src/components/AddClass.js similarity index 84% rename from src/components/main-site/AddClass.js rename to src/components/AddClass.js index 44c3678..84e1a8b 100644 --- a/src/components/main-site/AddClass.js +++ b/src/components/AddClass.js @@ -9,10 +9,9 @@ import Col from "react-bootstrap/Col"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; - const styles = { card: { width: "400px", @@ -83,16 +82,18 @@ const INITIAL_STATE = { class AddClassesBase extends Component { state = { ...INITIAL_STATE }; - + componentDidMount() { this.getClasses(); } - + getClasses() { this.props.firebase.getConfig().then((doc) => { - const indexes = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[1]); + const indexes = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[1]); this.setState({ index: indexes[0] }); - const memberClasses = doc.data().classes; + const memberClasses = doc.data().classes; this.setState({ memberClasses }); }); } @@ -102,33 +103,29 @@ class AddClassesBase extends Component { }; onSubmit = (event) => { - const { - name, - index, - memberClasses, - } = this.state; - - const i = index + 1; - const data = { ...memberClasses, [name]: i}; - - this.props.firebase.configDoc().update({'classes': data}).then(() => { - console.log("Success"); - this.props.updateFunc(); - }).catch(err => { - console.log(err); - }); + const { name, index, memberClasses } = this.state; + + const i = index + 1; + const data = { ...memberClasses, [name]: i }; + + this.props.firebase + .configDoc() + .update({ classes: data }) + .then(() => { + console.log("Success"); + this.props.updateFunc(); + }) + .catch((err) => { + console.log(err); + }); event.preventDefault(); }; render() { const { classes } = this.props; - const { - name, - error, - } = this.state; - const isInvalid = - name === ""; + const { name, error } = this.state; + const isInvalid = name === ""; return ( diff --git a/src/components/main-site/AddEvent.js b/src/components/AddEvent.js similarity index 99% rename from src/components/main-site/AddEvent.js rename to src/components/AddEvent.js index 1e7ac9b..3266b96 100644 --- a/src/components/main-site/AddEvent.js +++ b/src/components/AddEvent.js @@ -9,7 +9,7 @@ import Col from "react-bootstrap/Col"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { diff --git a/src/components/main-site/AddMember.js b/src/components/AddMember.js similarity index 95% rename from src/components/main-site/AddMember.js rename to src/components/AddMember.js index 00a1a86..0524499 100644 --- a/src/components/main-site/AddMember.js +++ b/src/components/AddMember.js @@ -9,7 +9,7 @@ import Col from "react-bootstrap/Col"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const axios = require("axios"); @@ -98,14 +98,16 @@ const INITIAL_STATE = { class AddMemberBase extends Component { state = { ...INITIAL_STATE }; - + componentDidMount() { this.getClasses(); } - + getClasses() { this.props.firebase.getConfig().then((doc) => { - const memberClasses = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[0]); + const memberClasses = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[0]); this.setState({ memberClasses }); }); } @@ -121,8 +123,8 @@ class AddMemberBase extends Component { console.log("Invalid file type"); f = null; } else { - var fileExtension = "jpg"; - if (f.type.split("/")[1] === "png") fileExtension = "png"; + var fileExtension = "jpg"; + if (f.type.split("/")[1] === "png") fileExtension = "png"; this.setState({ fileExtension: fileExtension }); } @@ -188,8 +190,8 @@ class AddMemberBase extends Component { position: position, positionRank: positionRank, class: className, - rp: 0, - bp: 0 + rp: 0, + bp: 0, }, socials: { facebook: facebook, @@ -200,7 +202,7 @@ class AddMemberBase extends Component { roles: { eboard: eboard, upemember: true, - nonmember: false, + nonmember: false, }, }; @@ -245,7 +247,7 @@ class AddMemberBase extends Component { res.data[0].uid ); this.props.updateFunc(); - this.setState({ ...INITIAL_STATE }, this.getClasses()); + this.setState({ ...INITIAL_STATE }, this.getClasses()); }) .catch((error) => { console.log(error); @@ -270,7 +272,11 @@ class AddMemberBase extends Component { error, } = this.state; const isInvalid = - name === "" || email === "" || className === "" || gradYear === 0 || position === ""; + name === "" || + email === "" || + className === "" || + gradYear === 0 || + position === ""; const year = new Date().getFullYear(); const years = []; diff --git a/src/components/main-site/BPEdit.js b/src/components/BPEdit.js similarity index 92% rename from src/components/main-site/BPEdit.js rename to src/components/BPEdit.js index 1ea9291..902b32c 100644 --- a/src/components/main-site/BPEdit.js +++ b/src/components/BPEdit.js @@ -6,7 +6,7 @@ import InputGroup from "react-bootstrap/InputGroup"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; @@ -65,7 +65,7 @@ const INITIAL_STATE = { class BPEditBase extends Component { state = { ...INITIAL_STATE }; - + componentDidMount() { this.props.firebase.getUID(this.props.value.email).then((snapshot) => { this.setState({ uid: snapshot.data().value }); @@ -77,15 +77,12 @@ class BPEditBase extends Component { }; onSubmit = (event) => { - const { - rp, - bp, - } = this.state; - + const { rp, bp } = this.state; + const data = { upe: { bp: parseInt(this.props.value.upe.bp) + parseInt(bp) + parseInt(rp), - rp: parseInt(this.props.value.upe.rp) + parseInt(rp), + rp: parseInt(this.props.value.upe.rp) + parseInt(rp), }, }; @@ -102,19 +99,12 @@ class BPEditBase extends Component { render() { const { classes } = this.props; - const { - bp, - rp, - error, - } = this.state; - - const isInvalid = - bp === "" && - rp === ""; + const { bp, rp, error } = this.state; + + const isInvalid = bp === "" && rp === ""; return (
-

Brownie Points

diff --git a/src/components/main-site/ClassesManagement.js b/src/components/ClassesManagement.js similarity index 84% rename from src/components/main-site/ClassesManagement.js rename to src/components/ClassesManagement.js index 77f4447..f3a590a 100644 --- a/src/components/main-site/ClassesManagement.js +++ b/src/components/ClassesManagement.js @@ -8,15 +8,15 @@ import AddClass from "./AddClass.js"; import ClassesMngCard from "./ClassesMngCard.js"; import "bootstrap/dist/css/bootstrap.min.css"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { background: { backgroundColor: "#f6f6f6", - borderRadius: "25px", + borderRadius: "25px", }, center: { textAlign: "center", @@ -51,7 +51,7 @@ class ClassListBase extends Component { }; this.handleToggleAdd = this.handleToggleAdd.bind(this); - this.getClasses = this.getClasses.bind(this); + this.getClasses = this.getClasses.bind(this); } componentDidMount() { @@ -66,16 +66,18 @@ class ClassListBase extends Component { getClasses() { this.props.firebase.getConfig().then((doc) => { - const memberClasses = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[0]); + const memberClasses = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[0]); this.setState({ memberClasses }); }); - - this.setState({addClasses: false}); + + this.setState({ addClasses: false }); } render() { const { classes } = this.props; - + const memberClasses = this.state.memberClasses.map((item, index) => ( )); @@ -96,15 +98,13 @@ class ClassListBase extends Component { - + - - {memberClasses} - + {memberClasses}
); diff --git a/src/components/main-site/ClassesMngCard.js b/src/components/ClassesMngCard.js similarity index 90% rename from src/components/main-site/ClassesMngCard.js rename to src/components/ClassesMngCard.js index 2dff1d7..db4dd15 100644 --- a/src/components/main-site/ClassesMngCard.js +++ b/src/components/ClassesMngCard.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import "bootstrap/dist/css/bootstrap.min.css"; @@ -71,7 +71,7 @@ class ClassesMngCardBase extends Component { this.state = { deleteData: false, - memberClasses: null, + memberClasses: null, }; this.handleToggleDelete = this.handleToggleDelete.bind(this); @@ -79,23 +79,27 @@ class ClassesMngCardBase extends Component { } componentDidMount() {} - + handleToggleDelete = () => { this.setState({ deleteData: !this.state.deleteData, }); }; - + deleteData() { this.props.firebase.getConfig().then((doc) => { const memberClasses = doc.data().classes; delete memberClasses[this.props.data]; - this.props.firebase.configDoc().update({'classes': memberClasses}).then(() => { - console.log("Successfully updated Classes"); - this.props.updateFunc(); - }).catch(err => { - console.log(err); - }); + this.props.firebase + .configDoc() + .update({ classes: memberClasses }) + .then(() => { + console.log("Successfully updated Classes"); + this.props.updateFunc(); + }) + .catch((err) => { + console.log(err); + }); }); } diff --git a/src/components/main-site/ContactForm.js b/src/components/ContactForm.js similarity index 97% rename from src/components/main-site/ContactForm.js rename to src/components/ContactForm.js index c615a48..d4d920c 100644 --- a/src/components/main-site/ContactForm.js +++ b/src/components/ContactForm.js @@ -5,11 +5,11 @@ import InputGroup from "react-bootstrap/InputGroup"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import "bootstrap/dist/css/bootstrap.min.css"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; const styles = { contactFormh5: { diff --git a/src/components/main-site/DataEdit.js b/src/components/DataEdit.js similarity index 97% rename from src/components/main-site/DataEdit.js rename to src/components/DataEdit.js index 6633f59..d3e37ac 100644 --- a/src/components/main-site/DataEdit.js +++ b/src/components/DataEdit.js @@ -6,7 +6,7 @@ import InputGroup from "react-bootstrap/InputGroup"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; @@ -76,21 +76,23 @@ const INITIAL_STATE = { class DataEditBase extends Component { state = { ...INITIAL_STATE }; - + componentDidMount() { this.getUID(); - this.getClasses(); + this.getClasses(); } - + getUID() { this.props.firebase.getUID(this.props.value.email).then((snapshot) => { this.setState({ uid: snapshot.data().value }); }); } - + getClasses() { this.props.firebase.getConfig().then((doc) => { - const memberClasses = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[0]); + const memberClasses = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[0]); this.setState({ memberClasses }); }); } @@ -106,8 +108,8 @@ class DataEditBase extends Component { console.log("Invalid file type"); f = null; } else { - var fileExtension = "jpg"; - if (f.type.split("/")[1] === "png") fileExtension = "png"; + var fileExtension = "jpg"; + if (f.type.split("/")[1] === "png") fileExtension = "png"; this.setState({ fileExtension: fileExtension }); } diff --git a/src/components/main-site/DataForm.js b/src/components/DataForm.js similarity index 97% rename from src/components/main-site/DataForm.js rename to src/components/DataForm.js index 1b63cca..d6ee822 100644 --- a/src/components/main-site/DataForm.js +++ b/src/components/DataForm.js @@ -9,7 +9,7 @@ import Col from "react-bootstrap/Col"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -171,7 +171,7 @@ class DataFormBase extends Component { .editUser(this.props.value.uid, data) .then(() => { this.props.updateFunc(); - this.setState({ ...INITIAL_STATE }); + this.setState({ ...INITIAL_STATE }); }) .catch((error) => { this.setState({ error }); @@ -191,8 +191,8 @@ class DataFormBase extends Component { console.log("Invalid file type"); f = null; } else { - var fileExtension = "jpg"; - if (f.type.split("/")[1] === "png") fileExtension = "png"; + var fileExtension = "jpg"; + if (f.type.split("/")[1] === "png") fileExtension = "png"; this.setState({ fileExtension: fileExtension }); } diff --git a/src/components/main-site/EventEdit.js b/src/components/EventEdit.js similarity index 99% rename from src/components/main-site/EventEdit.js rename to src/components/EventEdit.js index 59700f2..684b0f0 100644 --- a/src/components/main-site/EventEdit.js +++ b/src/components/EventEdit.js @@ -6,7 +6,7 @@ import InputGroup from "react-bootstrap/InputGroup"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; diff --git a/src/components/main-site/EventMngCard.js b/src/components/EventMngCard.js similarity index 92% rename from src/components/main-site/EventMngCard.js rename to src/components/EventMngCard.js index 4e738f0..ed949aa 100644 --- a/src/components/main-site/EventMngCard.js +++ b/src/components/EventMngCard.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import EventEdit from "./EventEdit.js"; @@ -86,14 +86,14 @@ class EventMngCardBase extends Component { this.handleToggleEdit = this.handleToggleEdit.bind(this); this.handleToggleDelete = this.handleToggleDelete.bind(this); this.deleteData = this.deleteData.bind(this); - this.updateSubFunc = this.updateSubFunc.bind(this); + this.updateSubFunc = this.updateSubFunc.bind(this); } - + updateSubFunc = () => { - this.props.updateFunc(); - this.setState({editEvent: false, deleteEvent: false}); - } - + this.props.updateFunc(); + this.setState({ editEvent: false, deleteEvent: false }); + }; + componentDidMount() { this.props.firebase .getEvent(this.props.data.index) @@ -185,7 +185,11 @@ class EventMngCardBase extends Component { } >
- +
-
-
All events hosted on Zoom, click here to join.
+
+
+ {" "} + All events hosted on Zoom, click{" "} + here to join.{" "} +
); } diff --git a/src/components/main-site/EventsManagement.js b/src/components/EventsManagement.js similarity index 91% rename from src/components/main-site/EventsManagement.js rename to src/components/EventsManagement.js index 28f8bad..ac4836b 100644 --- a/src/components/main-site/EventsManagement.js +++ b/src/components/EventsManagement.js @@ -8,9 +8,9 @@ import EventMngCard from "./EventMngCard.js"; import AddEvent from "./AddEvent.js"; import "bootstrap/dist/css/bootstrap.min.css"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -50,7 +50,7 @@ class MemberListBase extends Component { }; this.handleToggleAdd = this.handleToggleAdd.bind(this); - this.getEvents = this.getEvents.bind(this); + this.getEvents = this.getEvents.bind(this); } componentDidMount() { @@ -73,8 +73,8 @@ class MemberListBase extends Component { .catch((error) => { console.error("Error getting documents: ", error); }); - - this.setState({addEvent: false}); + + this.setState({ addEvent: false }); } render() { @@ -102,7 +102,7 @@ class MemberListBase extends Component { - + diff --git a/src/components/main-site/Footer.js b/src/components/Footer.js similarity index 84% rename from src/components/main-site/Footer.js rename to src/components/Footer.js index eaea98c..41df601 100644 --- a/src/components/main-site/Footer.js +++ b/src/components/Footer.js @@ -7,6 +7,7 @@ import { faGithub, faFacebook, faTwitterSquare, + faYoutubeSquare, } from "@fortawesome/free-brands-svg-icons"; import { withStyles } from "@material-ui/styles"; @@ -16,7 +17,7 @@ const styles = { }, footer: { backgroundColor: "#333", - borderBottom: "3px solid #f21131", + borderBottom: "3px solid #871a13", textAlign: "center", }, footerIcon: { @@ -66,7 +67,7 @@ const Footer = ({ classes }) => ( /> - {""} + ( /> - {""} + - {""} + + + + + + diff --git a/src/components/main-site/Header.js b/src/components/Header.js similarity index 85% rename from src/components/main-site/Header.js rename to src/components/Header.js index 6f313fb..603916e 100644 --- a/src/components/main-site/Header.js +++ b/src/components/Header.js @@ -9,34 +9,37 @@ import { withStyles } from "@material-ui/styles"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faUserCircle } from "@fortawesome/free-solid-svg-icons"; -import * as ROUTES from "../../constants/routes"; +import * as ROUTES from "../constants/routes"; -import img from "../../assets/img/header.jpg"; +import img from "../assets/img/header.jpg"; +import logo from "../assets/img/logo_resized.png"; +import UPEclass from "../assets/img/UPEclass.jpg"; const styles = { mainNav: { paddingTop: "10px", + paddingLeft: "200px", paddingBottom: "10px", - fontfamily: "Andale Mono, monospace", - borderTop: "3px solid #f21131", + fontfamily: "Recursive", + borderTop: "3px solid #871a13", backgroundColor: "#333", }, mainNavBrand: { "& span": { - fontFamily: "Gruppo", fontSize: "36px", + color: "#fff", margin: 0, lineHeight: 1, fontWeight: 800, letterSpacing: "3px", textTransform: "uppercase", - color: "#f21131", transition: "all .3s", + paddingLeft: "0px", "@media only screen and (max-width:992px)": { paddingLeft: "20px", }, "@media only screen and (min-width:992px)": { - paddingLeft: "300px", + paddingLeft: "50px", }, "&:hover": { color: "#C30000", @@ -53,14 +56,14 @@ const styles = { paddingLeft: "20px", color: "#fff", "&:hover": { - color: "#f21131", + color: "#871a13", textDecoration: "none", }, "& span": { paddingLeft: "30px", color: "#fff", "&:hover": { - color: "#f21131", + color: "#871a13", textDecoration: "none", }, }, @@ -78,7 +81,7 @@ const styles = { textDecoration: "none", "&:hover": { textDecoration: "none", - color: "#f21131", + color: "#871a13", }, }, masthead: { @@ -88,13 +91,13 @@ const styles = { backgroundAttachment: "scroll", position: "relative", backgroundSize: "cover", - backgroundImage: `url(${img})`, + backgroundImage: `url(${UPEclass})`, }, mastheadSiteHeading: { - padding: "200px 0 150px", + padding: "350px 0 150px", color: "#fff", "@media only screen and (min-width:768px)": { - padding: "200px 0!important", + padding: "325px 0!important", }, }, loginIcon: { @@ -102,7 +105,7 @@ const styles = { fontSize: "30px", transition: "all .3s linear", "&:hover": { - color: "#f21131", + color: "#f871a13", "-webkit-transform": "translateY(-2px)", transform: "translateY(-2px)", transition: "all .3s linear", @@ -116,6 +119,7 @@ const Header = ({ classes }) => ( + Logo of UPE BU UPE @@ -172,17 +176,7 @@ const Header = ({ classes }) => ( - -
-
-
-
-
-
-
-
-
); -export default withStyles(styles)(Header); +export default withStyles(styles)(Header); \ No newline at end of file diff --git a/src/components/main-site/Header2.js b/src/components/Header2.js similarity index 97% rename from src/components/main-site/Header2.js rename to src/components/Header2.js index b3a9ea3..c72bb5f 100644 --- a/src/components/main-site/Header2.js +++ b/src/components/Header2.js @@ -7,9 +7,9 @@ import "bootstrap/dist/css/bootstrap.min.css"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; -import * as ROUTES from "../../constants/routes"; +import * as ROUTES from "../constants/routes"; -import img from "../../assets/img/header.jpg"; +import img from "../assets/img/header.jpg"; const styles = { mainNav: { diff --git a/src/components/main-site/Header3.js b/src/components/Header3.js similarity index 97% rename from src/components/main-site/Header3.js rename to src/components/Header3.js index b9cdadf..ea8592f 100644 --- a/src/components/main-site/Header3.js +++ b/src/components/Header3.js @@ -8,9 +8,9 @@ import "bootstrap/dist/css/bootstrap.min.css"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; -import * as ROUTES from "../../constants/routes"; +import * as ROUTES from "../constants/routes"; -import img from "../../assets/img/header.jpg"; +import img from "../assets/img/header.jpg"; const styles = { mainNav: { @@ -155,7 +155,7 @@ class Header3Base extends Component { Event Management

-

+

( +

+
+
+
+
+
+
+
+
+); + +export default withStyles(styles)(HeaderPhoto); diff --git a/src/components/main-site/LoginForm.js b/src/components/LoginForm.js similarity index 90% rename from src/components/main-site/LoginForm.js rename to src/components/LoginForm.js index d4f923a..bed3eba 100644 --- a/src/components/main-site/LoginForm.js +++ b/src/components/LoginForm.js @@ -4,11 +4,11 @@ import Form from "react-bootstrap/Form"; import Container from "react-bootstrap/Container"; import { withStyles } from "@material-ui/styles"; -import logo from "../../assets/img/logo.png"; +import logo from "../assets/img/logo.png"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -41,7 +41,7 @@ const styles = { class LoginFormBase extends Component { componentDidMount = () => { - console.log("login form mounted") + console.log("login form mounted"); if (this.props.firebase) { const urlParams = new URLSearchParams(window.location.search); const token = urlParams.get("token"); @@ -51,7 +51,7 @@ class LoginFormBase extends Component { window.localStorage.removeItem("pathname"); this.props.firebase .doSignInWithToken(token) - .then(() => (this.props.history.push(pathname ? pathname : "/panel"))) + .then(() => this.props.history.push(pathname ? pathname : "/panel")) .catch(console.error); } else { window.location.href = "https://upe-authenticator.herokuapp.com/"; diff --git a/src/components/main-site/MemberCard.js b/src/components/MemberCard.js similarity index 95% rename from src/components/main-site/MemberCard.js rename to src/components/MemberCard.js index fb953eb..f9f260a 100644 --- a/src/components/main-site/MemberCard.js +++ b/src/components/MemberCard.js @@ -8,7 +8,7 @@ import { faLinkedin, } from "@fortawesome/free-brands-svg-icons"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import "bootstrap/dist/css/bootstrap.min.css"; @@ -20,7 +20,7 @@ const styles = { borderRadius: "150px", }, cardImgTopAlum: { - opacity: '0.5', + opacity: "0.5", width: "75%", margin: "10% auto", borderRadius: "150px", @@ -39,12 +39,12 @@ const styles = { }, cardTitle: { fontSize: "30px", - fontFamily: "Gruppo", + fontFamily: "Montserrat", fontWeight: 1000, }, cardSubtitle: { fontSize: "25px", - fontFamily: "Gruppo", + fontFamily: "Montserrat", fontWeight: 1000, color: "#f21131", }, @@ -102,8 +102,8 @@ class MemberCardBase extends Component { const { classes } = this.props; var item = this.props.data; - - var alum = (item.roles && !!item.roles.alum); + + var alum = item.roles && !!item.roles.alum; var defaultIMG = "https://firebasestorage.googleapis.com/v0/b/upe-website-fa07a.appspot.com/o/default.png?alt=media&token=6cced97e-fb1e-4604-8b5b-81318a52fcc2"; @@ -158,9 +158,7 @@ class MemberCardBase extends Component {

{item.upe.position}

-

- Alumni -

+

Alumni


diff --git a/src/components/main-site/MemberList.js b/src/components/MemberList.js similarity index 87% rename from src/components/main-site/MemberList.js rename to src/components/MemberList.js index ee4bd92..872e6ec 100644 --- a/src/components/main-site/MemberList.js +++ b/src/components/MemberList.js @@ -7,7 +7,7 @@ import MemberCard from "./MemberCard.js"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -33,7 +33,9 @@ class MemberListBase extends Component { getClasses() { this.props.firebase.getConfig().then((doc) => { - const memberClasses = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[0]); + const memberClasses = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[0]); this.setState({ memberClasses }, this.getMembers); }); } @@ -49,10 +51,10 @@ class MemberListBase extends Component { console.error("Error getting documents: ", error); }); } - + getMembers() { - const { classes } = this.props; - + const { classes } = this.props; + const members = this.state.memberClasses.map(async (className) => { const classMembers = await this.props.firebase .getClass(className) @@ -77,10 +79,10 @@ class MemberListBase extends Component { ); }); - - Promise.all(members).then(values => { - this.setState({members: values}); - }); + + Promise.all(members).then((values) => { + this.setState({ members: values }); + }); } render() { @@ -89,7 +91,7 @@ class MemberListBase extends Component { const eboard = this.state.eboard.map((item, index) => ( )); - + return (
@@ -99,9 +101,9 @@ class MemberListBase extends Component { {eboard} - - {this.state.members} - + + {this.state.members} +
); } diff --git a/src/components/main-site/MemberManagement.js b/src/components/MemberManagement.js similarity index 76% rename from src/components/main-site/MemberManagement.js rename to src/components/MemberManagement.js index 2754cfe..f7aa937 100644 --- a/src/components/main-site/MemberManagement.js +++ b/src/components/MemberManagement.js @@ -9,9 +9,9 @@ import AddMember from "./AddMember.js"; import ClassList from "./ClassesManagement.js"; import "bootstrap/dist/css/bootstrap.min.css"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -52,12 +52,12 @@ class MemberListBase extends Component { this.state = { members: [], addMember: false, - manageClasses: false, + manageClasses: false, }; this.handleToggleAdd = this.handleToggleAdd.bind(this); - this.handleToggleClasses = this.handleToggleClasses.bind(this); - this.getMembers = this.getMembers.bind(this); + this.handleToggleClasses = this.handleToggleClasses.bind(this); + this.getMembers = this.getMembers.bind(this); } componentDidMount() { @@ -86,16 +86,20 @@ class MemberListBase extends Component { .catch((error) => { console.error("Error getting documents: ", error); }); - this.setState({addMember: false}); + this.setState({ addMember: false }); } render() { const { classes } = this.props; const members = this.state.members.map((item, index) => ( - + )); - return (
@@ -106,8 +110,11 @@ class MemberListBase extends Component { - - @@ -118,18 +125,22 @@ class MemberListBase extends Component { - - + + - + - - {members} - + {members}
); diff --git a/src/components/main-site/MemberMngCard.js b/src/components/MemberMngCard.js similarity index 72% rename from src/components/main-site/MemberMngCard.js rename to src/components/MemberMngCard.js index eeda133..d4cb7ec 100644 --- a/src/components/main-site/MemberMngCard.js +++ b/src/components/MemberMngCard.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import DataEdit from "./DataEdit.js"; @@ -81,22 +81,22 @@ class MemberMngCardBase extends Component { this.state = { uid: "", editData: false, - editBP: false, + editBP: false, demote: false, deleteData: false, - toggleAdmin: false, - admin: (this.props.data.roles && !!this.props.data.roles.admin) + toggleAdmin: false, + admin: this.props.data.roles && !!this.props.data.roles.admin, }; this.handleToggleData = this.handleToggleData.bind(this); - this.handleToggleBP = this.handleToggleBP.bind(this); + this.handleToggleBP = this.handleToggleBP.bind(this); this.handleToggleDelete = this.handleToggleDelete.bind(this); this.deleteData = this.deleteData.bind(this); this.handleToggleDemote = this.handleToggleDemote.bind(this); this.demote = this.demote.bind(this); - this.handleToggleAdmin = this.handleToggleAdmin.bind(this); + this.handleToggleAdmin = this.handleToggleAdmin.bind(this); this.adminSwitch = this.adminSwitch.bind(this); - this.updateSubFun = this.updateSubFun.bind(this); + this.updateSubFun = this.updateSubFun.bind(this); } componentDidMount() { @@ -110,7 +110,7 @@ class MemberMngCardBase extends Component { editData: !this.state.editData, }); }; - + handleToggleBP = () => { this.setState({ editBP: !this.state.editBP, @@ -122,11 +122,18 @@ class MemberMngCardBase extends Component { deleteData: !this.state.deleteData, }); }; - + updateSubFun = () => { - this.props.updateFunc(); - - this.setState({editBP: false, editData: false, deleteData: false, demote: false, toggleAdmin: false, admin: (!this.state.admin)}); + this.props.updateFunc(); + + this.setState({ + editBP: false, + editData: false, + deleteData: false, + demote: false, + toggleAdmin: false, + admin: !this.state.admin, + }); }; deleteData = () => { @@ -154,7 +161,7 @@ class MemberMngCardBase extends Component { const data = { roles: { upemember: false, - nonmember: true, + nonmember: true, }, }; @@ -167,7 +174,7 @@ class MemberMngCardBase extends Component { this.setState({ error }); }); }; - + handleToggleAdmin = () => { this.setState({ toggleAdmin: !this.state.toggleAdmin, @@ -177,7 +184,7 @@ class MemberMngCardBase extends Component { adminSwitch = () => { const data = { roles: { - admin: (!this.state.admin), + admin: !this.state.admin, }, }; @@ -194,10 +201,9 @@ class MemberMngCardBase extends Component { render() { const { classes } = this.props; - var adminButton = "Make Admin"; - if (this.state.admin) - adminButton = "Remove Adminship"; - + var adminButton = "Make Admin"; + if (this.state.admin) adminButton = "Remove Adminship"; + var item = this.props.data; return ( @@ -206,7 +212,9 @@ class MemberMngCardBase extends Component {
{item.name}
{item.email}
-
BP: {item.upe.bp} | RP: {item.upe.rp}
+
+ BP: {item.upe.bp} | RP: {item.upe.rp} +

@@ -218,42 +226,45 @@ class MemberMngCardBase extends Component { Edit Data
- -
-
- -
-
- -
- -
+ +
+
+ +
+ +
+
+ +
+
- -
- -
- -
+ +
@@ -265,30 +276,34 @@ class MemberMngCardBase extends Component { Remove Membership
- -
-
-
- + +
+
+
+ +
-
- -
-
-
- + +
+
+
+ +
-
- -
+ +
-
diff --git a/src/components/main-site/NotEboard.js b/src/components/NotEboard.js similarity index 100% rename from src/components/main-site/NotEboard.js rename to src/components/NotEboard.js diff --git a/src/components/main-site/PanelInfo.js b/src/components/PanelInfo.js similarity index 81% rename from src/components/main-site/PanelInfo.js rename to src/components/PanelInfo.js index 73c8a61..2ef012b 100644 --- a/src/components/main-site/PanelInfo.js +++ b/src/components/PanelInfo.js @@ -3,8 +3,8 @@ import React, { Component } from "react"; import Spacer from "./Spacer"; import UserPanel from "./UserPanel"; -import { withFirebase } from "../../api/Firebase"; -import { AuthUserContext } from "../../api/Session"; +import { withFirebase } from "../api/Firebase"; +import { AuthUserContext } from "../api/Session"; import "bootstrap/dist/css/bootstrap.min.css"; diff --git a/src/components/main-site/PromoteUser.js b/src/components/PromoteUser.js similarity index 51% rename from src/components/main-site/PromoteUser.js rename to src/components/PromoteUser.js index 9be1ec9..08a1f63 100644 --- a/src/components/main-site/PromoteUser.js +++ b/src/components/PromoteUser.js @@ -8,7 +8,7 @@ import Col from "react-bootstrap/Col"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -68,17 +68,19 @@ const INITIAL_STATE = { class AddMemberBase extends Component { state = { ...INITIAL_STATE }; - + componentDidMount() { this.props.firebase.getUID(this.props.value.email).then((snapshot) => { this.setState({ uid: snapshot.data().value }); }); this.getClasses(); } - + getClasses() { this.props.firebase.getConfig().then((doc) => { - const memberClasses = Object.entries(doc.data().classes).sort((a,b) => b[1] > a[1] ? 1 : -1).map(c => c[0]); + const memberClasses = Object.entries(doc.data().classes) + .sort((a, b) => (b[1] > a[1] ? 1 : -1)) + .map((c) => c[0]); this.setState({ memberClasses }); }); } @@ -94,8 +96,8 @@ class AddMemberBase extends Component { console.log("Invalid file type"); f = null; } else { - var fileExtension = "jpg"; - if (f.type.split("/")[1] === "png") fileExtension = "png"; + var fileExtension = "jpg"; + if (f.type.split("/")[1] === "png") fileExtension = "png"; this.setState({ fileExtension: fileExtension }); } @@ -147,8 +149,8 @@ class AddMemberBase extends Component { linkedin, fileExtension, } = this.state; - - event.preventDefault(); + + event.preventDefault(); var im = this.props.value.name.split(" ")[0] + "." + fileExtension; @@ -159,8 +161,8 @@ class AddMemberBase extends Component { position: position, positionRank: positionRank, class: className, - rp: 0, - bp: 0 + rp: 0, + bp: 0, }, socials: { facebook: facebook, @@ -171,7 +173,7 @@ class AddMemberBase extends Component { roles: { eboard: eboard, upemember: true, - nonmember: false, + nonmember: false, }, }; @@ -193,19 +195,19 @@ class AddMemberBase extends Component { } ); } - this.props.firebase - .editUser(this.state.uid, data) - .then(() => { - console.log( - "Successfully created database entry for user ", - this.state.uid - ); - this.props.updateFunc(); - this.setState({ ...INITIAL_STATE }, this.getClasses()); - }) - .catch((error) => { - console.log(error); - }); + this.props.firebase + .editUser(this.state.uid, data) + .then(() => { + console.log( + "Successfully created database entry for user ", + this.state.uid + ); + this.props.updateFunc(); + this.setState({ ...INITIAL_STATE }, this.getClasses()); + }) + .catch((error) => { + console.log(error); + }); }; render() { @@ -242,136 +244,135 @@ class AddMemberBase extends Component { ]; return ( - - -
-

Class

- - - - {classList.map((c) => ( - - ))} - - -
- -
-

Grad. Year

- - - - {years.map((year) => ( - - ))} - - -
- -
-

Position

- - - - {positionList.map((p) => ( - - ))} - - -
- -
-

Profile Image

- -
- -
-

Twitter

- - - -
- -
-

Github

- - - -
- -
-

Facebook

- - - -
- -
-

Linkedin

- - - -
- -
- - - - - -
- - {error &&

{error.message}

} - +
+
+

Class

+ + + + {classList.map((c) => ( + + ))} + + +
+ +
+

Grad. Year

+ + + + {years.map((year) => ( + + ))} + + +
+ +
+

Position

+ + + + {positionList.map((p) => ( + + ))} + + +
+ +
+

Profile Image

+ +
+ +
+

Twitter

+ + + +
+ +
+

Github

+ + + +
+ +
+

Facebook

+ + + +
+ +
+

Linkedin

+ + + +
+ +
+ + + + + +
+ + {error &&

{error.message}

} +
); } } diff --git a/src/components/main-site/Spacer.js b/src/components/Spacer.js similarity index 100% rename from src/components/main-site/Spacer.js rename to src/components/Spacer.js diff --git a/src/components/main-site/UserManagement.js b/src/components/UserManagement.js similarity index 83% rename from src/components/main-site/UserManagement.js rename to src/components/UserManagement.js index 4f6d405..2da2f01 100644 --- a/src/components/main-site/UserManagement.js +++ b/src/components/UserManagement.js @@ -6,9 +6,9 @@ import { withStyles } from "@material-ui/styles"; import UserMngCard from "./UserMngCard.js"; import "bootstrap/dist/css/bootstrap.min.css"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; const styles = { @@ -49,8 +49,8 @@ class UserManagementBase extends Component { this.state = { members: [], }; - - this.getMembers = this.getMembers.bind(this); + + this.getMembers = this.getMembers.bind(this); } componentDidMount() { @@ -73,9 +73,13 @@ class UserManagementBase extends Component { const { classes } = this.props; const members = this.state.members.map((item, index) => ( - + )); - return (
@@ -87,14 +91,15 @@ class UserManagementBase extends Component { - - {members} - + {members}
); } } -const UserManagement = compose(withFirebase, withStyles(styles))(UserManagementBase); +const UserManagement = compose( + withFirebase, + withStyles(styles) +)(UserManagementBase); export default UserManagement; diff --git a/src/components/main-site/UserMngCard.js b/src/components/UserMngCard.js similarity index 92% rename from src/components/main-site/UserMngCard.js rename to src/components/UserMngCard.js index 848a88f..c61c441 100644 --- a/src/components/main-site/UserMngCard.js +++ b/src/components/UserMngCard.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import Col from "react-bootstrap/Col"; import Button from "react-bootstrap/Button"; import { withStyles } from "@material-ui/styles"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import PromoteUser from "./PromoteUser.js"; @@ -86,7 +86,7 @@ class UserMngCardBase extends Component { this.handleToggleDelete = this.handleToggleDelete.bind(this); this.deleteData = this.deleteData.bind(this); this.handleTogglePromote = this.handleTogglePromote.bind(this); - this.updateSubFun = this.updateSubFun.bind(this); + this.updateSubFun = this.updateSubFun.bind(this); } componentDidMount() { @@ -106,10 +106,10 @@ class UserMngCardBase extends Component { deleteData: !this.state.deleteData, }); }; - + updateSubFun = () => { - this.props.updateFunc(); - this.setState({deleteData: false, promote: false}); + this.props.updateFunc(); + this.setState({ deleteData: false, promote: false }); }; deleteData = () => { @@ -166,14 +166,17 @@ class UserMngCardBase extends Component {
- +

- +
- @@ -197,9 +199,6 @@ class UserMngCardBase extends Component { } } -const UserMngCard = compose( - withFirebase, - withStyles(styles) -)(UserMngCardBase); +const UserMngCard = compose(withFirebase, withStyles(styles))(UserMngCardBase); export default UserMngCard; diff --git a/src/components/main-site/UserPanel.js b/src/components/UserPanel.js similarity index 81% rename from src/components/main-site/UserPanel.js rename to src/components/UserPanel.js index 372deac..eb54a65 100644 --- a/src/components/main-site/UserPanel.js +++ b/src/components/UserPanel.js @@ -7,7 +7,7 @@ import Button from "react-bootstrap/Button"; import { withStyles } from "@material-ui/styles"; import "bootstrap/dist/css/bootstrap.min.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import DataForm from "./DataForm"; @@ -70,24 +70,24 @@ class UserPanelBase extends Component { this.state = { url: "", editInfo: false, - name: "", - eboardS: "", - pos: "", - git: "", - face: "", - tw: "", - lin: "", + name: "", + eboardS: "", + pos: "", + git: "", + face: "", + tw: "", + lin: "", }; this.handleToggleInfo = this.handleToggleInfo.bind(this); - this.getData = this.getData.bind(this); + this.getData = this.getData.bind(this); } getData = () => { - this.getUrl(); - this.getUser(); - } - + this.getUrl(); + this.getUser(); + }; + componentDidMount() { this.getData(); } @@ -99,19 +99,22 @@ class UserPanelBase extends Component { this.setState({ url }); }); } - + getUser() { - this.props.firebase.user(this.props.value.uid).get().then((snapshot) => { - const item = snapshot.data(); - - var eboardS = "Not EBoard"; - var pos = "Not Listed"; - var git = "Not Listed"; - var face = "Not Listed"; - var tw = "Not Listed"; - var lin = "Not Listed"; - var name = item.name; - + this.props.firebase + .user(this.props.value.uid) + .get() + .then((snapshot) => { + const item = snapshot.data(); + + var eboardS = "Not EBoard"; + var pos = "Not Listed"; + var git = "Not Listed"; + var face = "Not Listed"; + var tw = "Not Listed"; + var lin = "Not Listed"; + var name = item.name; + if (item.roles && !!item.roles.eboard) { eboardS = "On EBoard"; } @@ -130,8 +133,17 @@ class UserPanelBase extends Component { if (item.socials && !!item.socials.linkedin) { lin = item.socials.linkedin; } - this.setState({name: name, eboardS: eboardS, pos: pos, git: git, tw: tw, face: face, lin: lin, editInfo: false,}); - }); + this.setState({ + name: name, + eboardS: eboardS, + pos: pos, + git: git, + tw: tw, + face: face, + lin: lin, + editInfo: false, + }); + }); } handleToggleInfo = () => { @@ -142,8 +154,8 @@ class UserPanelBase extends Component { render() { const { classes } = this.props; - const { eboardS, pos, git, tw, face, lin, name } = this.state; - + const { eboardS, pos, git, tw, face, lin, name } = this.state; + var defaultIMG = "https://firebasestorage.googleapis.com/v0/b/upe-website-fa07a.appspot.com/o/default.png?alt=media&token=6cced97e-fb1e-4604-8b5b-81318a52fcc2"; @@ -164,7 +176,8 @@ class UserPanelBase extends Component {

{" "} - Class: {this.props.value.upe.class}{" "} + Class:{" "} + {this.props.value.upe.class}{" "}

{" "} @@ -176,7 +189,8 @@ class UserPanelBase extends Component {

{" "} - Email: {this.props.value.email}{" "} + Email:{" "} + {this.props.value.email}{" "}

{" "} @@ -204,11 +218,13 @@ class UserPanelBase extends Component {

{" "} - Brownie Points: {this.props.value.upe.bp}{" "} + Brownie Points:{" "} + {this.props.value.upe.bp}{" "}

{" "} - Recruitment Points: {this.props.value.upe.rp}{" "} + Recruitment Points:{" "} + {this.props.value.upe.rp}{" "}

diff --git a/src/pages/main-site/404.js b/src/pages/404.js similarity index 89% rename from src/pages/main-site/404.js rename to src/pages/404.js index 934d47b..6322206 100644 --- a/src/pages/main-site/404.js +++ b/src/pages/404.js @@ -4,8 +4,8 @@ import Container from "react-bootstrap/Container"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; -import "../../styles/main-site/main.css"; -import logo from "../../assets/img/logo.png"; +import "../styles/main.css"; +import logo from "../assets/img/logo.png"; const NotFound = () => ( diff --git a/src/pages/main-site/About.js b/src/pages/About.js similarity index 94% rename from src/pages/main-site/About.js rename to src/pages/About.js index 33246f7..a7697b9 100644 --- a/src/pages/main-site/About.js +++ b/src/pages/About.js @@ -1,10 +1,10 @@ import React from "react"; import { withRouter } from "react-router-dom"; -import Header from "../../components/main-site/Header"; -import Footer from "../../components/main-site/Footer"; +import Header from "../components/Header"; +import Footer from "../components/Footer"; -import * as ROUTES from "../../constants/routes"; +import * as ROUTES from "../constants/routes"; import { Link } from "react-router-dom"; import Container from "react-bootstrap/Container"; @@ -16,8 +16,7 @@ const About = () => { return (
- - +
@@ -34,7 +33,7 @@ const About = () => {

UPE BU Members are both undergraduate & graduate students from Boston University who are either actively studying information - techniologies and computing disciplines or have shown exceeding + technologies and computing disciplines or have shown exceeding interest and/or talent in them.

diff --git a/src/pages/main-site/Contact.js b/src/pages/Contact.js similarity index 71% rename from src/pages/main-site/Contact.js rename to src/pages/Contact.js index 0d7afd1..b85bba8 100644 --- a/src/pages/main-site/Contact.js +++ b/src/pages/Contact.js @@ -1,11 +1,11 @@ import React from "react"; import { withRouter } from "react-router-dom"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import Header from "../../components/main-site/Header"; -import Footer from "../../components/main-site/Footer"; -import ContactForm from "../../components/main-site/ContactForm"; +import Header from "../components/Header"; +import Footer from "../components/Footer"; +import ContactForm from "../components/ContactForm"; import Container from "react-bootstrap/Container"; import Row from "react-bootstrap/Row"; @@ -15,8 +15,7 @@ const About = () => { return (
- - +
diff --git a/src/pages/main-site/EboardE.js b/src/pages/EboardE.js similarity index 55% rename from src/pages/main-site/EboardE.js rename to src/pages/EboardE.js index 187284d..c19a8d4 100644 --- a/src/pages/main-site/EboardE.js +++ b/src/pages/EboardE.js @@ -1,18 +1,18 @@ import React, { Component } from "react"; -import Header2 from "../../components/main-site/Header2"; -import Header3 from "../../components/main-site/Header3"; -import Footer from "../../components/main-site/Footer"; +import Header2 from "../components/Header2"; +import Header3 from "../components/Header3"; +import Footer from "../components/Footer"; -import "../../styles/main-site/main.css"; -import { withAuthorization, AuthUserContext } from "../../api/Session"; +import "../styles/main.css"; +import { withAuthorization, AuthUserContext } from "../api/Session"; import { compose } from "recompose"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; -import NotEboard from "../../components/main-site/NotEboard"; -import Spacer from "../../components/main-site/Spacer"; -import EventsManagement from "../../components/main-site/EventsManagement"; +import NotEboard from "../components/NotEboard"; +import Spacer from "../components/Spacer"; +import EventsManagement from "../components/EventsManagement"; class EboardMBase extends Component { static contextType = AuthUserContext; diff --git a/src/pages/main-site/EboardM.js b/src/pages/EboardM.js similarity index 55% rename from src/pages/main-site/EboardM.js rename to src/pages/EboardM.js index 0473369..0a71aad 100644 --- a/src/pages/main-site/EboardM.js +++ b/src/pages/EboardM.js @@ -1,18 +1,18 @@ import React, { Component } from "react"; -import Header2 from "../../components/main-site/Header2"; -import Header3 from "../../components/main-site/Header3"; -import Footer from "../../components/main-site/Footer"; +import Header2 from "../components/Header2"; +import Header3 from "../components/Header3"; +import Footer from "../components/Footer"; -import "../../styles/main-site/main.css"; -import { withAuthorization, AuthUserContext } from "../../api/Session"; +import "../styles/main.css"; +import { withAuthorization, AuthUserContext } from "../api/Session"; import { compose } from "recompose"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; -import NotEboard from "../../components/main-site/NotEboard"; -import Spacer from "../../components/main-site/Spacer"; -import MemberManagement from "../../components/main-site/MemberManagement"; +import NotEboard from "../components/NotEboard"; +import Spacer from "../components/Spacer"; +import MemberManagement from "../components/MemberManagement"; class EboardMBase extends Component { static contextType = AuthUserContext; diff --git a/src/pages/main-site/EboardU.js b/src/pages/EboardU.js similarity index 55% rename from src/pages/main-site/EboardU.js rename to src/pages/EboardU.js index b0dc378..ae8a526 100644 --- a/src/pages/main-site/EboardU.js +++ b/src/pages/EboardU.js @@ -1,18 +1,18 @@ import React, { Component } from "react"; -import Header2 from "../../components/main-site/Header2"; -import Header3 from "../../components/main-site/Header3"; -import Footer from "../../components/main-site/Footer"; +import Header2 from "../components/Header2"; +import Header3 from "../components/Header3"; +import Footer from "../components/Footer"; -import "../../styles/main-site/main.css"; -import { withAuthorization, AuthUserContext } from "../../api/Session"; +import "../styles/main.css"; +import { withAuthorization, AuthUserContext } from "../api/Session"; import { compose } from "recompose"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; -import NotEboard from "../../components/main-site/NotEboard"; -import Spacer from "../../components/main-site/Spacer"; -import UserManagement from "../../components/main-site/UserManagement"; +import NotEboard from "../components/NotEboard"; +import Spacer from "../components/Spacer"; +import UserManagement from "../components/UserManagement"; class EboardUBase extends Component { static contextType = AuthUserContext; diff --git a/src/pages/Events.js b/src/pages/Events.js new file mode 100644 index 0000000..3bef8be --- /dev/null +++ b/src/pages/Events.js @@ -0,0 +1,25 @@ +import React from "react"; +import { withRouter } from "react-router-dom"; + +import Header from "../components/Header"; +import Footer from "../components/Footer"; +import EventsCalendar from "../components/EventsCalendar"; + +import Container from "react-bootstrap/Container"; + +import "../styles/main.css"; + +const Members = () => { + return ( +
+
+ + + + +
+
+ ); +}; + +export default withRouter(Members); diff --git a/src/pages/Landing.js b/src/pages/Landing.js new file mode 100644 index 0000000..8071a2b --- /dev/null +++ b/src/pages/Landing.js @@ -0,0 +1,224 @@ +import React, { Component } from "react"; +import { Link } from "react-router-dom"; +import { withRouter } from "react-router-dom"; + +import Header from "../components/Header"; +import Footer from "../components/Footer"; + +import * as ROUTES from "../constants/routes"; +import { withFirebase } from "../api/Firebase"; +import "../styles/main.css"; +import { compose } from "recompose"; +import { withStyles } from "@material-ui/styles"; + +import Container from "react-bootstrap/Container"; +import Row from "react-bootstrap/Row"; +import Col from "react-bootstrap/Col"; +import Button from "react-bootstrap/Button"; +import HeaderPhoto from "../components/HeaderPhoto"; + +const styles = { + bobble: { + backgroundColor: "#e8e88c", + fontWeight: "600", + fontSize: "20px", + borderRadius: "10px", + textAlign: "center", + paddingBottom: "1px", + paddingTop: "15px", + }, + container: { + maxWidth: "1000px", + }, + col1: { + position: "relative", + left: "-100px", + }, + col2: { + position: "relative", + left: "+40px", + }, +}; + +class MainLandingBase extends Component { + constructor(props) { + super(props); + + this.state = { + displayApplyPage: false, + displayInterestForm: false, + ytEmbed: "https://www.youtube.com/embed/NTuI2b9hZGM", + }; + } + + getData = () => { + this.props.firebase + .generalSettings() + .get() + .then((querySnapshot) => { + const data = querySnapshot.data(); + + this.setState({ + displayApplyPage: data.displayApplyPage, + displayInterestForm: data.displayInterestForm, + ytEmbed: data.ytEmbed, + }); + }) + .catch((err) => { + console.log(err); + }); + }; + + componentDidMount() { + this.getData(); + } + + render() { + const { classes } = this.props; + const { displayApplyPage, displayInterestForm, ytEmbed } = this.state; + + const BobbleForm = () => { + return ( + +

+ Interested in joining UPE? Click + here. +

+
+ ); + }; + + const BobbleApply = () => { + return ( + +

+ We are now accepting applications! Click + here to apply. +

+
+ ); + }; + + const DisplayBobble = () => { + if (displayApplyPage) { + return ( + + + + + + + ); + } else if (displayInterestForm) { + return ( + + + + + + + ); + } else { + return <> ; + } + }; + + return ( +
+
+ + + + + + + +
+

About Us

+
+ + + + + +
+

Our Projects

+
+ +
+
+ + + + +
+

+ Upsilon Pi Epsilon (UPE) at BU is an honor society dedicated + to promoting excellence in technical and computing + disciplines. UPE's chapter at BU has as it's main focus the + improvement of it's member's technical skills, as to + complement the school's great theoretical teaching. +

+
+ +
+ +
+ + + +
+

+ Both UPE as an organization, and each of our dedicated members + are constantly working on amazing projects both related to the + org. or otherwise! +

+
+ +
+ +
+ +
+
+ +
+ + +

Check out the latest episode of our podcast!

+ + + +
+
+
+
+
+ ); + } +} + +const MainLanding = compose( + withFirebase, + withStyles(styles), + withRouter +)(MainLandingBase); + +export default MainLanding; diff --git a/src/pages/main-site/Login.js b/src/pages/Login.js similarity index 53% rename from src/pages/main-site/Login.js rename to src/pages/Login.js index 0a40405..87283a7 100644 --- a/src/pages/main-site/Login.js +++ b/src/pages/Login.js @@ -1,9 +1,9 @@ import React from "react"; -import "../../styles/main-site/main.css"; -import LoginForm from "../../components/main-site/LoginForm"; -import { AuthUserContext } from "../../api/Session"; -import * as ROUTES from "../../constants/routes"; +import "../styles/main.css"; +import LoginForm from "../components/LoginForm"; +import { AuthUserContext } from "../api/Session"; +import * as ROUTES from "../constants/routes"; class Login extends React.Component { static contextType = AuthUserContext; @@ -16,7 +16,7 @@ class Login extends React.Component { if (this.context) { return null; } else { - return ; + return ; } } } diff --git a/src/pages/main-site/Logout.js b/src/pages/Logout.js similarity index 86% rename from src/pages/main-site/Logout.js rename to src/pages/Logout.js index 979cf37..1ac9d7a 100644 --- a/src/pages/main-site/Logout.js +++ b/src/pages/Logout.js @@ -1,11 +1,11 @@ import Container from "react-bootstrap/Container"; import React, { Component } from "react"; -import * as ROUTES from "../../constants/routes"; +import * as ROUTES from "../constants/routes"; -import "../../styles/main-site/main.css"; +import "../styles/main.css"; -import { withFirebase } from "../../api/Firebase"; +import { withFirebase } from "../api/Firebase"; import { compose } from "recompose"; import { withStyles } from "@material-ui/styles"; diff --git a/src/pages/Members.js b/src/pages/Members.js new file mode 100644 index 0000000..1f047f7 --- /dev/null +++ b/src/pages/Members.js @@ -0,0 +1,27 @@ +import React from "react"; +import { withRouter } from "react-router-dom"; + +import Header from "../components/Header"; +import Footer from "../components/Footer"; +import MemberList from "../components/MemberList"; + +import Container from "react-bootstrap/Container"; + +import "../styles/main.css"; + +const Members = () => { + return ( +
+
+
+ + + + + +
+
+ ); +}; + +export default withRouter(Members); diff --git a/src/pages/main-site/Panel.js b/src/pages/Panel.js similarity index 54% rename from src/pages/main-site/Panel.js rename to src/pages/Panel.js index e57d6b0..c0eed44 100644 --- a/src/pages/main-site/Panel.js +++ b/src/pages/Panel.js @@ -1,13 +1,13 @@ import React, { useContext } from "react"; -import Footer from "../../components/main-site/Footer"; -import Header2 from "../../components/main-site/Header2"; -import Header3 from "../../components/main-site/Header3"; +import Footer from "../components/Footer"; +import Header2 from "../components/Header2"; +import Header3 from "../components/Header3"; -import "../../styles/main-site/main.css"; -import { withAuthorization, AuthUserContext } from "../../api/Session"; +import "../styles/main.css"; +import { withAuthorization, AuthUserContext } from "../api/Session"; -import UserPanel from "../../components/main-site/UserPanel"; +import UserPanel from "../components/UserPanel"; const Panel = () => { const authUser = useContext(AuthUserContext); @@ -19,7 +19,7 @@ const Panel = () => {