From 23d5fad05dc54bb791717bd7a0b46003171b605f Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Wed, 8 Dec 2021 11:18:15 -0600 Subject: [PATCH 1/6] saving changes to API URL on register.js --- src/components/auth/Register.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/auth/Register.js b/src/components/auth/Register.js index 1e66c6d..ee1df65 100644 --- a/src/components/auth/Register.js +++ b/src/components/auth/Register.js @@ -9,7 +9,7 @@ export const Register = (props) => { const history = useHistory() const existingUserCheck = () => { - return fetch(`http://localhost:8088/customers?email=${customer.email}`) + return fetch(`http://localhost:8088/users?email=${customer.email}`) .then(res => res.json()) .then(user => !!user.length) } @@ -18,7 +18,7 @@ export const Register = (props) => { existingUserCheck() .then((userExists) => { if (!userExists) { - fetch("http://localhost:8088/customers", { + fetch("http://localhost:8088/users", { method: "POST", headers: { "Content-Type": "application/json" From 3adab2d1a49513f28b9bd5b6bc18fb93e0473077 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 9 Dec 2021 13:42:55 -0600 Subject: [PATCH 2/6] saving navbar progress --- src/components/ApplicationViews.js | 13 ++++++ src/components/auth/Login.js | 2 +- src/components/home/GraphicsBayTrackerHome.js | 5 ++ src/components/home/NewsStories.js | 4 ++ src/components/nav/NavBar.js | 46 +++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/src/components/ApplicationViews.js b/src/components/ApplicationViews.js index e69de29..4c66bfd 100644 --- a/src/components/ApplicationViews.js +++ b/src/components/ApplicationViews.js @@ -0,0 +1,13 @@ +import React from "react" +import { Route } from "react-router-dom" +import { GraphicsBayTrackerHome } from "./home/GraphicsBayTrackerHome" + +export const ApplicationViews = () => { + return ( + <> + + + + + ) +} diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index b8f6fd5..9f3aaf0 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js @@ -9,7 +9,7 @@ export const Login = () => { const history = useHistory() const existingUserCheck = () => { - return fetch(`http://localhost:8088/customers?email=${email}`) + return fetch(`http://localhost:8088/users?email=${email}`) .then(res => res.json()) .then(user => user.length ? user[0] : false) } diff --git a/src/components/home/GraphicsBayTrackerHome.js b/src/components/home/GraphicsBayTrackerHome.js index e69de29..bfb2ba6 100644 --- a/src/components/home/GraphicsBayTrackerHome.js +++ b/src/components/home/GraphicsBayTrackerHome.js @@ -0,0 +1,5 @@ + + +export const GraphicsBayTrackerHome =()=>{ + return
+} \ No newline at end of file diff --git a/src/components/home/NewsStories.js b/src/components/home/NewsStories.js index e69de29..e0f4efe 100644 --- a/src/components/home/NewsStories.js +++ b/src/components/home/NewsStories.js @@ -0,0 +1,4 @@ + +export const NewsStories = () => { + return
+} \ No newline at end of file diff --git a/src/components/nav/NavBar.js b/src/components/nav/NavBar.js index e69de29..2ca4b59 100644 --- a/src/components/nav/NavBar.js +++ b/src/components/nav/NavBar.js @@ -0,0 +1,46 @@ +import React, { useEffect, useState } from "react" +import { Link, useHistory } from "react-router-dom" +import "./NavBar.css" + + + +export const NavBar = () => { + const history = useHistory() + + + + return ( +
+ +
+ ) +} From 284c76e6390033a1f3b11fda26e466d238c3c7c9 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 9 Dec 2021 20:44:22 -0600 Subject: [PATCH 3/6] saving syntax fixes to Logout.js --- src/components/ApplicationViews.js | 5 +++++ src/components/auth/Login.js | 5 ++++- src/components/auth/Logout.js | 16 ++++++++++++++++ src/components/pricing/DropDownFilters.js | 0 src/components/pricing/GPUDataInterface.js | 0 src/components/pricing/OEMSelector.js | 0 src/components/pricing/PricingData.js | 0 src/components/profile/Profile.js | 0 src/components/profile/ProfileData.js | 0 src/components/profile/TrackedCards.js | 0 10 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/components/auth/Logout.js create mode 100644 src/components/pricing/DropDownFilters.js create mode 100644 src/components/pricing/GPUDataInterface.js create mode 100644 src/components/pricing/OEMSelector.js create mode 100644 src/components/pricing/PricingData.js create mode 100644 src/components/profile/Profile.js create mode 100644 src/components/profile/ProfileData.js create mode 100644 src/components/profile/TrackedCards.js diff --git a/src/components/ApplicationViews.js b/src/components/ApplicationViews.js index 4c66bfd..512e9b9 100644 --- a/src/components/ApplicationViews.js +++ b/src/components/ApplicationViews.js @@ -1,6 +1,8 @@ import React from "react" import { Route } from "react-router-dom" import { GraphicsBayTrackerHome } from "./home/GraphicsBayTrackerHome" +import { Profile } from ".profile/profile" + export const ApplicationViews = () => { return ( @@ -8,6 +10,9 @@ export const ApplicationViews = () => { + + + ) } diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index 9f3aaf0..4eb4724 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js @@ -20,7 +20,7 @@ export const Login = () => { .then(exists => { if (exists) { localStorage.setItem("graphicsbaytracker_customer", exists.id) - history.push("/") + history.push("") } else { existDialog.current.showModal() } @@ -56,6 +56,9 @@ export const Login = () => {
Not a member yet?
+
+ Skip Login +
) } diff --git a/src/components/auth/Logout.js b/src/components/auth/Logout.js new file mode 100644 index 0000000..1a3f6dd --- /dev/null +++ b/src/components/auth/Logout.js @@ -0,0 +1,16 @@ +import React from "react" +import {useState, useEffect} from "react" +import { useHistory } from "react-router-dom" + +export const Logout = () => { + const [loggedincustomer, setloggedincustomer] = useState(localStorage.graphicsbaytracker_customer) + return ( + <> +
+ +
+ + ) + + +} \ No newline at end of file diff --git a/src/components/pricing/DropDownFilters.js b/src/components/pricing/DropDownFilters.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/pricing/GPUDataInterface.js b/src/components/pricing/GPUDataInterface.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/pricing/OEMSelector.js b/src/components/pricing/OEMSelector.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/pricing/PricingData.js b/src/components/pricing/PricingData.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/profile/Profile.js b/src/components/profile/Profile.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/profile/ProfileData.js b/src/components/profile/ProfileData.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/profile/TrackedCards.js b/src/components/profile/TrackedCards.js new file mode 100644 index 0000000..e69de29 From 0ea113271c931453b2addb9b570ad5a369c29332 Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 9 Dec 2021 21:20:05 -0600 Subject: [PATCH 4/6] inserted ternary to conditionally render login or logout links --- src/components/ApplicationViews.js | 4 ++-- src/components/nav/NavBar.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/ApplicationViews.js b/src/components/ApplicationViews.js index 512e9b9..32486ed 100644 --- a/src/components/ApplicationViews.js +++ b/src/components/ApplicationViews.js @@ -1,7 +1,7 @@ import React from "react" import { Route } from "react-router-dom" import { GraphicsBayTrackerHome } from "./home/GraphicsBayTrackerHome" -import { Profile } from ".profile/profile" +import { Profile } from "./profile/Profile" export const ApplicationViews = () => { @@ -10,7 +10,7 @@ export const ApplicationViews = () => { - + diff --git a/src/components/nav/NavBar.js b/src/components/nav/NavBar.js index 2ca4b59..e600cd3 100644 --- a/src/components/nav/NavBar.js +++ b/src/components/nav/NavBar.js @@ -1,5 +1,7 @@ import React, { useEffect, useState } from "react" import { Link, useHistory } from "react-router-dom" +import { Login } from "../auth/Login" +import { Logout } from "../auth/Logout" import "./NavBar.css" @@ -18,23 +20,23 @@ export const NavBar = () => {