From 0f606b6c7422851cf04c22f7ffc57b43871d9c51 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 8 Mar 2025 18:37:32 -0500 Subject: [PATCH 1/8] more --- build/manifest.json | 25 ------------------------- build/robots.txt | 3 --- package.json | 2 +- src/components/Vehicles.js | 12 ++++++------ src/styles/App.css | 12 ++++++++++-- 5 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 build/manifest.json delete mode 100644 build/robots.txt 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/Vehicles.js b/src/components/Vehicles.js index 983be46..25cc8af 100644 --- a/src/components/Vehicles.js +++ b/src/components/Vehicles.js @@ -20,12 +20,12 @@ const Vehicles = () => { const inputTypes = [ "Make", "Model", - "Trim", + "Trim Package", "Color", - "Year", + "Prod Year", "Category", "Mileage", - "Price", + "Pre-QR Price", ]; const handleIdInput = (e) => setVehId(e.target.value); @@ -117,7 +117,7 @@ const Vehicles = () => { return ( <>
-

Add A Vehicle to Your Queue

+

Add Vehicle to Queue

@@ -170,14 +170,14 @@ const Vehicles = () => { ))}
-

Get A Vehicle By Id

+

Get Vehicle By ISDM

diff --git a/src/styles/App.css b/src/styles/App.css index 3ce9be7..4c31129 100644 --- a/src/styles/App.css +++ b/src/styles/App.css @@ -59,6 +59,7 @@ body { border-radius: 6px; max-width: 535px; flex: 1 0 auto; + background-color: #fcf6ff; } .veh-text { @@ -94,6 +95,7 @@ body { cursor: pointer; padding: 7px 0px 26px 0px; margin: 25px auto; + background-color: #fffef9; } .auxButton2 { @@ -101,7 +103,7 @@ body { width: 125px; border: 1px solid #c0c8cf; border-radius: 6px; - background-color: white; + background-color: #fffef9; color: #0f1111; font-family: "Open Sans", sans-serif; cursor: pointer; @@ -159,8 +161,8 @@ body { width: 100%; height: 50px; padding: 15px 20px 0px 20px; - background-color: white; border-bottom: 2px solid #a9a9a9; + background-color: #fcf6ff; } .navRow { @@ -194,15 +196,21 @@ body { } @media only screen and (max-width: 460px) { + .vehicles-container { + margin: 2px auto; + } + .vehiclesColumn { height: 100%; } + .navBarContainer { display: none; } .formHeader { max-width: 250px; + text-align: center; } .vehBox { From a6f142c365dd55a6222cd12f034db94404d56236 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 8 Mar 2025 18:57:44 -0500 Subject: [PATCH 2/8] m --- src/components/Vehicle.js | 2 +- src/components/Vehicles.js | 2 +- src/index.css | 6 +++--- src/styles/App.css | 14 ++++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) 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 25cc8af..44a34e4 100644 --- a/src/components/Vehicles.js +++ b/src/components/Vehicles.js @@ -149,7 +149,7 @@ const Vehicles = () => { />
{savedVehicles.length > 0 ? ( -

Your Saved Vehicles

+

Your Vehicles

) : ( <> )} diff --git a/src/index.css b/src/index.css index ec2585e..4a1df4d 100644 --- a/src/index.css +++ b/src/index.css @@ -1,13 +1,13 @@ body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } diff --git a/src/styles/App.css b/src/styles/App.css index 4c31129..4c2530b 100644 --- a/src/styles/App.css +++ b/src/styles/App.css @@ -1,6 +1,11 @@ @import url("https://fonts.googleapis.com/css?family=Open+Sans"); +html { + height: 100%; +} + body { + margin: 0; font-family: "Open Sans", sans-serif; } @@ -16,7 +21,7 @@ body { display: flex; flex-direction: column; align-items: center; - width: 100%; + padding: 0px 30px; margin: 5px 20px; } @@ -66,10 +71,6 @@ body { margin: 4px 5px; } -.formHeader { - letter-spacing: 0.08rem; -} - .formHeader2 { letter-spacing: 0.08rem; margin-top: 10px; @@ -158,7 +159,6 @@ body { } .navBarContainer { - width: 100%; height: 50px; padding: 15px 20px 0px 20px; border-bottom: 2px solid #a9a9a9; @@ -197,6 +197,8 @@ body { @media only screen and (max-width: 460px) { .vehicles-container { + max-width: 400px; + padding: 0px 10px; margin: 2px auto; } From 7aa2c0a69d41c887f6510170bb079f27d33fd24d Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 8 Mar 2025 19:17:46 -0500 Subject: [PATCH 3/8] more --- src/components/Vehicles.js | 37 +++++++++++++++++++++++++++---------- src/styles/App.css | 19 ++++++++++++------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/components/Vehicles.js b/src/components/Vehicles.js index 44a34e4..8ca6eb3 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 Package", + "Trim", "Color", "Prod Year", "Category", "Mileage", - "Pre-QR 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(() => { @@ -91,17 +92,32 @@ const Vehicles = () => { setVehId(""); } + function validate() { + const make = inputs.Make; + const model = inputs.Model; + const trim = inputs.Trim; + const color = inputs.Color; + if (!make || !model || !trim || !color) { + setAlert("Please fill out all fields"); + return false; + } + return true; + } + async function addData(e) { e.preventDefault(); //format(e); - setSavedVehicles([...savedVehicles, inputs]); - try { - const docRef = await addDoc(collection(db, "hdepot"), inputs); - inputs.id = docRef.id; + const valid = validate(); + if (valid) { setSavedVehicles([...savedVehicles, inputs]); - setInputs({}); - } catch (error) { - console.log(`Error saving vehicle to db: ${error}`); + try { + const docRef = await addDoc(collection(db, "hdepot"), inputs); + inputs.id = docRef.id; + setSavedVehicles([...savedVehicles, inputs]); + setInputs({}); + } catch (error) { + console.log(`Error saving vehicle to db: ${error}`); + } } } @@ -139,6 +155,7 @@ const Vehicles = () => { ))}
+
{alert ?
{alert}
: <>}