diff --git a/build/manifest.json b/build/manifest.json deleted file mode 100644 index 080d6c7..0000000 --- a/build/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/build/robots.txt b/build/robots.txt deleted file mode 100644 index e9e57dc..0000000 --- a/build/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/package.json b/package.json index 3b88cdc..ac15a56 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "sales control application", + "name": "sales flow application", "version": "0.1.0", "homepage": ".", "private": false, diff --git a/src/components/Vehicle.js b/src/components/Vehicle.js index e8144c8..2e2d4d5 100644 --- a/src/components/Vehicle.js +++ b/src/components/Vehicle.js @@ -52,7 +52,7 @@ const Vehicle = (props) => { {`$${formatNums(price / 100)}.00`}
- Id: + ISDM: {id}
diff --git a/src/components/Vehicles.js b/src/components/Vehicles.js index 6eef7b1..1dc90e2 100644 --- a/src/components/Vehicles.js +++ b/src/components/Vehicles.js @@ -17,15 +17,16 @@ const Vehicles = () => { const [inputs, setInputs] = useState({}); const [vehId, setVehId] = useState(); const [fetchedVeh, setfetchedVeh] = useState([]); + const [alert, setAlert] = useState(false); const inputTypes = [ "Make", "Model", "Trim", "Color", - "Year", + "Prod Year", "Category", "Mileage", - "Price", + "Pre-QRV-Price", ]; const handleIdInput = (e) => setVehId(e.target.value); @@ -52,7 +53,7 @@ const Vehicles = () => { const formatMiles = parseFloat(inputs.mileage.replace(/,/g, "")); const formatPrice = parseFloat(inputs.price.replace(/,/g, "") * 100); inputs.Mileage = formatMiles; - inputs.price = formatPrice; + //inputs.price = formatPrice; }; useEffect(() => { @@ -92,9 +93,40 @@ const Vehicles = () => { setVehId(""); } + function validate() { + const make = inputs.Make; + const model = inputs.Model; + const trim = inputs.Trim; + const color = inputs.Color; + const year = inputs["Prod Year"]; + const cat = inputs.Category; + const miles = inputs.Mileage; + const price = inputs["Pre-QRV-Price"]; + + if ( + !make || + !model || + !trim || + !color || + !year || + !cat || + !miles || + !price + ) { + setAlert("Please fill out all fields"); + return false; + } + return true; + } + async function addData(e) { e.preventDefault(); //format(e); + const valid = validate(); + if (!valid) { + return; + } + console.log("inputs~~~~~~~~~~", inputs); setSavedVehicles([...savedVehicles, inputs]); try { const docRef = await addDoc(collection(db, "hdepot"), inputs); @@ -143,6 +175,7 @@ const Vehicles = () => { ))} +