Skip to content

Commit

Permalink
Merge pull request #24 from michacurri/release
Browse files Browse the repository at this point in the history
Release v1.1
  • Loading branch information
michacurri authored Jan 2, 2021
2 parents 8925b7d + f9f364a commit 198036d
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 89 deletions.
144 changes: 88 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/core": "^4.11.2",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
Expand All @@ -22,7 +22,8 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.1"
"react-scripts": "^4.0.1",
"react-virtualized": "^9.22.3"
},
"scripts": {
"start:client": "react-scripts start",
Expand Down
4 changes: 2 additions & 2 deletions src/components/admin/WorkorderCreate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment, useState } from "react";
import WorkorderEditor from "../root/WorkorderEditor";

const WorkorderAdd = ({ currentUserProfile }) => {
const WorkorderAdd = ({ currentProfile }) => {
const [workorder, setWorkorder] = useState();

const updateWorkorderField = (e) => {
Expand All @@ -13,7 +13,7 @@ const WorkorderAdd = ({ currentUserProfile }) => {
const addRecord = async (e) => {
e.preventDefault();
try {
const userId = currentUserProfile.id;
const userId = currentProfile.id;
const { brand, model, colour } = workorder;
const response = await fetch(`/api/workorder/create/${userId}`, {
method: "POST",
Expand Down
6 changes: 3 additions & 3 deletions src/components/root/MainContentSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import AdvertHero from "./AdvertHero";
import AuthContainer from "../../backend/authorization/AuthContainer";

function MainContentSection({ loginClick }) {
const [currentUserProfile] = useContext(UserContext);
const [currentProfile] = useContext(UserContext);

let content;
if (loginClick) {
if (currentUserProfile) {
if (currentProfile) {
content = (
<div className="mainContentSection">
<section id="sidebar__wrapper">
Expand All @@ -26,7 +26,7 @@ function MainContentSection({ loginClick }) {
{/* prettier-ignore */}
<Switch>
<Route path="/home" render={() => <Home />} />
<Route path="/profile" render={() => <Profile currentUserProfile={currentUserProfile} />} />
<Route path="/profile" render={() => <Profile currentProfile={currentProfile} />} />
<Route path="/workorder" render={() => <Workorder />} />
<Route path="/settings" render={() => <Settings />} />
</Switch>
Expand Down
4 changes: 2 additions & 2 deletions src/components/root/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { UserContext } from "../../backend/authorization/UserContext";
// TODO - IF user is ADMIN show everything

const Profile = () => {
const [impersonator] = useContext(ImpersonatorContext);
const [admin] = useContext(ImpersonatorContext);
const [currentProfile, setCurrentProfile] = useContext(UserContext);
const [searchOrAdd, setSearchOrAdd] = useState(null);

Expand All @@ -23,7 +23,7 @@ const Profile = () => {
};

let content;
if (impersonator) {
if (admin) {
if (!currentProfile._id) {
content = (
<Fragment>
Expand Down
Loading

0 comments on commit 198036d

Please sign in to comment.