- {!modal && user && user.isadmin &&
}
Events
@@ -214,10 +113,3 @@ Events.propTypes = {
updateEvent: PropTypes.func.isRequired,
}).isRequired,
};
-
-EventModal.propTypes = {
- editEvent: PropTypes.bool.isRequired,
- handleSubmit: PropTypes.func.isRequired,
- closeModal: PropTypes.func.isRequired,
- currEvent: PropTypes.object,
-};
diff --git a/frontend/src/routes/profile.jsx b/frontend/src/routes/profile.jsx
index 1123acf..b22ca1c 100644
--- a/frontend/src/routes/profile.jsx
+++ b/frontend/src/routes/profile.jsx
@@ -1,16 +1,16 @@
-import React, {useEffect, useContext, useState} from 'react';
+import React, { useEffect, useContext, useState } from 'react';
import handbook from './../assets/Handbook.png';
-import {useNavigate, useParams} from 'react-router-dom';
+import { useNavigate, useParams } from 'react-router-dom';
import PropTypes from 'prop-types';
-import {Context} from '../services/context';
+import { Context } from '../services/context';
import FooterPad from '../components/footerpad';
-import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
-import {faFacebook} from '@fortawesome/free-brands-svg-icons';
-import {faInstagram} from '@fortawesome/free-brands-svg-icons';
-import {faXTwitter} from '@fortawesome/free-brands-svg-icons';
-import {faYoutube} from '@fortawesome/free-brands-svg-icons';
-import {faPinterest} from '@fortawesome/free-brands-svg-icons';
-import {faTiktok} from '@fortawesome/free-brands-svg-icons';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faFacebook } from '@fortawesome/free-brands-svg-icons';
+import { faInstagram } from '@fortawesome/free-brands-svg-icons';
+import { faXTwitter } from '@fortawesome/free-brands-svg-icons';
+import { faYoutube } from '@fortawesome/free-brands-svg-icons';
+import { faPinterest } from '@fortawesome/free-brands-svg-icons';
+import { faTiktok } from '@fortawesome/free-brands-svg-icons';
import LeavingPageIcon from '../components/LeavingPageIcon';
// Import the Modal used for uploading a new profile picture
@@ -21,15 +21,15 @@ import PolicyModal from '../components/PolicyModal';
import AttendingEvents from '../components/AttendingEvents.jsx';
-export default function Profile({vendorService, violationService}) {
- const {vendorId} = useParams();
+export default function Profile({ vendorService, violationService }) {
+ const { vendorId } = useParams();
const [vendor, setVendor] = useState({});
const [openViolation, setOpenViolation] = useState(false);
const [numViolations, setNumViolations] = useState(0);
const [editModal, setEditModal] = useState(false);
const [policyModal, setPolicyModal] = useState(false);
- const {user, setMessage, setBad} = useContext(Context);
- const [vendorData, setVendorData] = useState({name: '', email: '', phoneNumber: '', website: ''});
+ const { user, setMessage, setBad } = useContext(Context);
+ const [vendorData, setVendorData] = useState({ name: '', email: '', phoneNumber: '', website: '' });
// When true, the upload profile modal appears
const [showUploadModal, setShowUploadModal] = useState(false);
@@ -119,102 +119,100 @@ export default function Profile({vendorService, violationService}) {
setNumViolations(numViolations + 1);
};
- return (
+ return (<>
+ {
+ editModal && (
+
+ )
+ }
+ {
+ showUploadModal ?
: <>>
+ }
+ {
+ openViolation &&
+ }
+ {
+ policyModal && (
)
+ }
- {
- showUploadModal ?
: <>>
- }
-
+
-
+ >
+ {
+ (user.id === vendorId || user.isadmin) &&
+
+ }
+
+
+
+ {vendor.instagram &&
}
+ {vendor.twitter &&
}
+ {vendor.facebook &&
}
+ {vendor.youtube &&
}
+ {vendor.pinterest &&
}
+ {vendor.tiktok &&
}
+
-
+
{ /* Only show policy modal if user is logged in*/
- user &&
-
-
Violations: {numViolations}
- {user.isadmin && (
-
- )}
-
-
-
-
-
Policy Handbook
-
-
}
- <>
- {openViolation && (
-
- )}
-
- >
- {
- editModal && (
-
- )
- }
- {
- policyModal && (
)
- }
-
-
+ user &&
+
+
Violations: {numViolations}
+ {user.isadmin && (
+
+ )}
+
+
+
+
Policy Handbook
+
+
}
+
+
+ >
);
}
diff --git a/frontend/src/services/Events/EventsService.js b/frontend/src/services/Events/EventsService.js
index 7c93ab2..279acf0 100644
--- a/frontend/src/services/Events/EventsService.js
+++ b/frontend/src/services/Events/EventsService.js
@@ -18,7 +18,7 @@ export default class EventsService {
new Date(data.starttime),
new Date(data.endtime),
data.description,
- data.vendorCapacity,
+ data.vendorcapacity,
));
}
diff --git a/frontend/src/services/Vendors/VendorsService.js b/frontend/src/services/Vendors/VendorsService.js
index dd10599..760e842 100644
--- a/frontend/src/services/Vendors/VendorsService.js
+++ b/frontend/src/services/Vendors/VendorsService.js
@@ -13,19 +13,20 @@ export default class VendorsService {
return undefined;
}
- return vendorsData.map((data) => new Vendor(
- data.vendor_id,
- data.name,
- data.email,
- data.website,
- data.phone_number,
- data.image,
- data.instagram,
- data.facebook,
- data.twitter,
- data.youtube,
- data.tiktok,
- data.pinterest,
+ return vendorsData.map((vendorData) => new Vendor(
+ vendorData.vendor_id,
+ vendorData.name,
+ vendorData.email,
+ vendorData.website,
+ vendorData.phone_number,
+ vendorData.image,
+ vendorData.instagram,
+ vendorData.facebook,
+ vendorData.twitter,
+ vendorData.youtube,
+ vendorData.tiktok,
+ vendorData.pinterest,
+ vendorData.is_public
));
}
@@ -35,14 +36,20 @@ export default class VendorsService {
return undefined;
}
- return vendorsData.map((data) => new Vendor(
- data.vendor_id,
- data.name,
- data.email,
- data.website,
- data.phone_number,
- data.image,
- data.is_public,
+ return vendorsData.map((vendorData) => new Vendor(
+ vendorData.vendor_id,
+ vendorData.name,
+ vendorData.email,
+ vendorData.website,
+ vendorData.phone_number,
+ vendorData.image,
+ vendorData.instagram,
+ vendorData.facebook,
+ vendorData.twitter,
+ vendorData.youtube,
+ vendorData.tiktok,
+ vendorData.pinterest,
+ vendorData.is_public
));
}
@@ -56,7 +63,13 @@ export default class VendorsService {
vendorData.website,
vendorData.phone_number,
vendorData.image,
- vendorData.is_public,
+ vendorData.instagram,
+ vendorData.facebook,
+ vendorData.twitter,
+ vendorData.youtube,
+ vendorData.tiktok,
+ vendorData.pinterest,
+ vendorData.is_public
);
};
@@ -72,7 +85,13 @@ export default class VendorsService {
vendorData.website,
vendorData.phone_number,
vendorData.image,
- vendorData.is_public,
+ vendorData.instagram,
+ vendorData.facebook,
+ vendorData.twitter,
+ vendorData.youtube,
+ vendorData.tiktok,
+ vendorData.pinterest,
+ vendorData.is_public
);
}
@@ -86,13 +105,13 @@ export default class VendorsService {
vendorData.website,
vendorData.phone_number,
vendorData.image,
- vendorData.is_public,
vendorData.instagram,
vendorData.facebook,
vendorData.twitter,
vendorData.youtube,
vendorData.tiktok,
vendorData.pinterest,
+ vendorData.is_public
);
} else {
return undefined;