diff --git a/src/components/ApplicationViews.js b/src/components/ApplicationViews.js index b8ebf48..f89353c 100644 --- a/src/components/ApplicationViews.js +++ b/src/components/ApplicationViews.js @@ -5,6 +5,7 @@ import { Profile } from "./profile/Profile" import { GPUDataInterface } from "./pricing/GPUDataInterface" + export const ApplicationViews = () => { return ( <> @@ -12,16 +13,13 @@ export const ApplicationViews = () => { - - - - - + - + + ) } diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js index 49538a0..d584ebf 100644 --- a/src/components/auth/Login.js +++ b/src/components/auth/Login.js @@ -42,7 +42,7 @@ const redirectToRegister = () => { } return ( - + <>
User does not exist
@@ -68,13 +68,9 @@ const redirectToRegister = () => { -
-
- - - -
+ + ) } diff --git a/src/components/auth/Logout.js b/src/components/auth/Logout.js index 3738f08..d3229c4 100644 --- a/src/components/auth/Logout.js +++ b/src/components/auth/Logout.js @@ -1,20 +1,25 @@ import React from "react" import {useState, useEffect} from "react" import { useHistory } from "react-router-dom" +import { props } from "react" -export const Logout = () => { - const [loggedincustomer, setloggedincustomer] = useState(localStorage.getItem("graphicsbaytracker_customer")) +export const Logout = (props) => { + const [loggedIn, setLoggedIn] = useState(true) - const setItemFromLocalStorage = () => { - setloggedincustomer() - } - return ( - <> -
- -
- - ) + + + useEffect(() => { + if (localStorage.getItem("graphicsbaytracker_customer") !== "1") { + setLoggedIn(true) + } + }, []); + + const logOutCustomer = () => { + localStorage.removeItem("graphicsbaytracker_customer"); + setLoggedIn(false) + + } + } \ No newline at end of file diff --git a/src/components/home/GraphicsBayTrackerHome.js b/src/components/home/GraphicsBayTrackerHome.js index 70358ae..6cdeb24 100644 --- a/src/components/home/GraphicsBayTrackerHome.js +++ b/src/components/home/GraphicsBayTrackerHome.js @@ -1,19 +1,15 @@ import React from "react" import { Link } from "react-router-dom" -import { - Route -} from "react-router-dom/cjs/react-router-dom.min" -import { - useState, - useEffect -} from "react" -import { - NewsStories -} from "./NewsStories" +import {Route} from "react-router-dom/cjs/react-router-dom.min" +import {useState,useEffect } from "react" +import {NewsStories} from "./NewsStories" +import { GPUDataInterface } from "../pricing/GPUDataInterface" +import { useHistory } from "react-router-dom/cjs/react-router-dom.min" export const GraphicsBayTrackerHome = () => { const [keyprices, fetchkeyprices] = useState([]) + const history = useHistory() useEffect( () => { @@ -26,8 +22,8 @@ export const GraphicsBayTrackerHome = () => { return ( <> -

GraphicsBay Tracker

- +

GraphicsBay Tracker

+ {NewsStories()}
+ ) } diff --git a/src/components/pricing/GPUDataInterface.js b/src/components/pricing/GPUDataInterface.js index d87dca5..af8f2b4 100644 --- a/src/components/pricing/GPUDataInterface.js +++ b/src/components/pricing/GPUDataInterface.js @@ -16,10 +16,16 @@ export const GPUDataInterface = () => { return ( <>

GPUDataInterface

-
+ - + + + + + + {gpucarddata.map(gpudataobj => {return (

{gpudataobj.brand} {gpudataobj.model} {gpudataobj.price.toLocaleString('en-US', { style: 'currency', currency: 'USD' })}

)})} +
BrandModelPrice
-
+ )} \ No newline at end of file