Archived
Completed profile form, tenative final merge for MVP #6
@@ -19,14 +19,14 @@ export const GPUDataInterface = () => {
|
||||
[]
|
||||
)
|
||||
|
||||
|
||||
const selectOEM = (event) => {
|
||||
if (event.target.value === "1") {
|
||||
return (fetchgpucarddata(gpucarddata.filter((gpudataobj) => gpudataobj.oem === "AMD")))
|
||||
} else if (event.target.value === "2") {
|
||||
return (fetchgpucarddata(gpucarddata.filter((gpudataobj) => gpudataobj.oem === "NVIDIA")))
|
||||
}
|
||||
}
|
||||
{/* unfinished feature, will implement in production version*/}
|
||||
// const selectOEM = (event) => {
|
||||
// if (event.target.value === "1") {
|
||||
// return (fetchgpucarddata(gpucarddata.filter((gpudataobj) => gpudataobj.oem === "AMD")))
|
||||
// } else if (event.target.value === "2") {
|
||||
// return (fetchgpucarddata(gpucarddata.filter((gpudataobj) => gpudataobj.oem === "NVIDIA")))
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
const saveTrackedCards = (gpudataobj) => {
|
||||
@@ -51,7 +51,8 @@ export const GPUDataInterface = () => {
|
||||
<>
|
||||
<h1>Graphics Card Prices</h1>
|
||||
<>
|
||||
<div>
|
||||
{/* unfinished feature, will implement in production version*/}
|
||||
{/* <div>
|
||||
<form>
|
||||
<b> Filter by OEM</b>
|
||||
<select defaultValue= "Select an OEM"
|
||||
@@ -61,7 +62,7 @@ export const GPUDataInterface = () => {
|
||||
<option value="2">NVIDIA</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
</>
|
||||
<table>
|
||||
|
||||
@@ -2,8 +2,9 @@ import react from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export const Profile = () => {
|
||||
const [currentUser, changecurrentUser] = useState(localStorage.getItem("graphicsbaytracker_customer"))
|
||||
const [currentUsertrackedcards, setcurrentUsertrackedcards] = useState(localStorage.getItem("graphicsbaytracker_customer"))
|
||||
const [Users, fetchUsers] = useState([])
|
||||
const [currentuser, setcurrentuser] = useState(localStorage.getItem("graphicsbaytracker_customer"))
|
||||
const [currentUsertrackedcards, setcurrentUsertrackedcards] = useState([]))
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
@@ -11,9 +12,16 @@ export const Profile = () => {
|
||||
.then(res => res.json())
|
||||
.then(setcurrentUsertrackedcards)
|
||||
},[])
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
fetch("http://localhost:8088/users")
|
||||
.then(res => res.json())
|
||||
.then(fetchUsers)
|
||||
},[])
|
||||
return(
|
||||
|
||||
<h2>My Tracked Cards</h2>
|
||||
<>
|
||||
{/* why is this returning duplicate elements?*/}
|
||||
<p>returning something. This is a test</p>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user