Completed profile form, tenative final merge for MVP #6

Merged
JMR-dev merged 9 commits from jr-createprofile into main 2021-12-21 19:53:31 +00:00
2 changed files with 24 additions and 15 deletions
Showing only changes of commit e12b0aba03 - Show all commits
+11 -10
View File
@@ -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>
+13 -5
View File
@@ -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>
</>
)
}