@@ -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"
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# https://www.robotstxt.org/robotstxt.html
|
|
||||||
User-agent: *
|
|
||||||
Disallow:
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "sales control application",
|
"name": "sales flow application",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"homepage": ".",
|
"homepage": ".",
|
||||||
"private": false,
|
"private": false,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const Vehicle = (props) => {
|
|||||||
{`$${formatNums(price / 100)}.00`}
|
{`$${formatNums(price / 100)}.00`}
|
||||||
</p>
|
</p>
|
||||||
<p className="veh-text">
|
<p className="veh-text">
|
||||||
<b>Id: </b>
|
<b>ISDM: </b>
|
||||||
{id}
|
{id}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,15 +17,16 @@ const Vehicles = () => {
|
|||||||
const [inputs, setInputs] = useState({});
|
const [inputs, setInputs] = useState({});
|
||||||
const [vehId, setVehId] = useState();
|
const [vehId, setVehId] = useState();
|
||||||
const [fetchedVeh, setfetchedVeh] = useState([]);
|
const [fetchedVeh, setfetchedVeh] = useState([]);
|
||||||
|
const [alert, setAlert] = useState(false);
|
||||||
const inputTypes = [
|
const inputTypes = [
|
||||||
"Make",
|
"Make",
|
||||||
"Model",
|
"Model",
|
||||||
"Trim",
|
"Trim",
|
||||||
"Color",
|
"Color",
|
||||||
"Year",
|
"Prod Year",
|
||||||
"Category",
|
"Category",
|
||||||
"Mileage",
|
"Mileage",
|
||||||
"Price",
|
"Pre-QRV-Price",
|
||||||
];
|
];
|
||||||
const handleIdInput = (e) => setVehId(e.target.value);
|
const handleIdInput = (e) => setVehId(e.target.value);
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ const Vehicles = () => {
|
|||||||
const formatMiles = parseFloat(inputs.mileage.replace(/,/g, ""));
|
const formatMiles = parseFloat(inputs.mileage.replace(/,/g, ""));
|
||||||
const formatPrice = parseFloat(inputs.price.replace(/,/g, "") * 100);
|
const formatPrice = parseFloat(inputs.price.replace(/,/g, "") * 100);
|
||||||
inputs.Mileage = formatMiles;
|
inputs.Mileage = formatMiles;
|
||||||
inputs.price = formatPrice;
|
//inputs.price = formatPrice;
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -92,9 +93,40 @@ const Vehicles = () => {
|
|||||||
setVehId("");
|
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) {
|
async function addData(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
//format(e);
|
//format(e);
|
||||||
|
const valid = validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("inputs~~~~~~~~~~", inputs);
|
||||||
setSavedVehicles([...savedVehicles, inputs]);
|
setSavedVehicles([...savedVehicles, inputs]);
|
||||||
try {
|
try {
|
||||||
const docRef = await addDoc(collection(db, "hdepot"), inputs);
|
const docRef = await addDoc(collection(db, "hdepot"), inputs);
|
||||||
@@ -143,6 +175,7 @@ const Vehicles = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>{alert ? <div className="alert">{alert}</div> : <></>}</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
className="auxButton"
|
className="auxButton"
|
||||||
@@ -153,7 +186,7 @@ const Vehicles = () => {
|
|||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
{savedVehicles.length > 0 ? (
|
{savedVehicles.length > 0 ? (
|
||||||
<h2 className="formHeader"> Your Saved Vehicles</h2>
|
<h2 className="formHeader"> Your Vehicles</h2>
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
@@ -174,14 +207,14 @@ const Vehicles = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="getHeader">
|
<div className="getHeader">
|
||||||
<h2 className="formHeader2">Get A Vehicle By Id</h2>
|
<h2 className="formHeader2">Get Vehicle By ISDM</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="fetchBox">
|
<div className="fetchBox">
|
||||||
<div className="inputContainer">
|
<div className="inputContainer">
|
||||||
<TextInput
|
<TextInput
|
||||||
className="text-input"
|
className="text-input"
|
||||||
name="vehId"
|
name="vehId"
|
||||||
placeholder="Vehicle Id"
|
placeholder="Vehicle ISDM"
|
||||||
value={vehId}
|
value={vehId}
|
||||||
onChange={handleIdInput}
|
onChange={handleIdInput}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||||
sans-serif;
|
sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||||
monospace;
|
monospace;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100%;
|
|
||||||
padding: 0px 30px;
|
padding: 0px 30px;
|
||||||
margin: 5px 20px;
|
margin: 5px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vehiclesRow {
|
.vehiclesRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -40,6 +40,7 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
height: 205px;
|
height: 205px;
|
||||||
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.veh-col {
|
.veh-col {
|
||||||
@@ -60,10 +61,10 @@ body {
|
|||||||
.vehBox {
|
.vehBox {
|
||||||
padding: 5px 5px 8px 8px;
|
padding: 5px 5px 8px 8px;
|
||||||
border: 1px solid #5d86a8;
|
border: 1px solid #5d86a8;
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
max-width: 535px;
|
max-width: 535px;
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
|
background-color: #f9f5ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.veh-text {
|
.veh-text {
|
||||||
@@ -82,32 +83,39 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text-input {
|
.text-input {
|
||||||
width: 100%;
|
width: 220px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
margin: 8px 0px;
|
margin: 8px 0px;
|
||||||
border: 1px solid #c0c8cf;
|
border: 1px solid #c0c8cf;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
color: red;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
padding-top: 8px;
|
||||||
|
margin: 8px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.auxButton {
|
.auxButton {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
border: 1px solid #c0c8cf;
|
border: 1px solid #8ac8ff;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: white;
|
|
||||||
color: #0f1111;
|
color: #0f1111;
|
||||||
font-family: "Open Sans", sans-serif;
|
font-family: "Open Sans", sans-serif;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 7px 0px 26px 0px;
|
padding: 7px 0px 26px 0px;
|
||||||
margin: 25px auto;
|
margin: 25px auto;
|
||||||
|
background-color: #ffefef;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auxButton2 {
|
.auxButton2 {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 125px;
|
width: 125px;
|
||||||
border: 1px solid #c0c8cf;
|
border: 1px solid #8ac8ff;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: white;
|
background-color: #ffefef;
|
||||||
color: #0f1111;
|
color: #0f1111;
|
||||||
font-family: "Open Sans", sans-serif;
|
font-family: "Open Sans", sans-serif;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -158,17 +166,16 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
min-width: 250px;
|
|
||||||
max-width: 250px;
|
width: 250px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navBarContainer {
|
.navBarContainer {
|
||||||
width: 100%;
|
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding: 15px 20px 0px 20px;
|
padding: 15px 20px 0px 20px;
|
||||||
background-color: white;
|
|
||||||
border-bottom: 2px solid #a9a9a9;
|
border-bottom: 2px solid #a9a9a9;
|
||||||
|
background-color: #fcf6ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navRow {
|
.navRow {
|
||||||
@@ -202,9 +209,19 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 460px) {
|
@media only screen and (max-width: 460px) {
|
||||||
|
.vehicles-container {
|
||||||
|
max-width: 400px;
|
||||||
|
padding: 0px 10px;
|
||||||
|
margin: 2px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputContainer {
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
.vehiclesColumn {
|
.vehiclesColumn {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navBarContainer {
|
.navBarContainer {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user