Skip to content

Commit 7d45ed3

Browse files
committed
submit dist to git
1 parent 25f5269 commit 7d45ed3

15 files changed

Lines changed: 286 additions & 243 deletions

.DS_Store

0 Bytes
Binary file not shown.

trgmc/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pnpm-debug.log*
88
lerna-debug.log*
99

1010
node_modules
11-
dist
1211
dist-ssr
1312
*.local
1413

@@ -17,6 +16,7 @@ dist-ssr
1716
!.vscode/extensions.json
1817
.idea
1918
.DS_Store
19+
*.DS_Store
2020
*.suo
2121
*.ntvs*
2222
*.njsproj

trgmc/bun.lockb

32.6 KB
Binary file not shown.

trgmc/dist/assets/index--ggdVcbb.js

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trgmc/dist/assets/index-CQ8CwT5T.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trgmc/dist/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
<script type="module" crossorigin src="/assets/index--ggdVcbb.js"></script>
9+
<link rel="stylesheet" crossorigin href="/assets/index-CQ8CwT5T.css">
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
</body>
14+
</html>

trgmc/dist/vite.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,36 @@ function MonthlyPayment({ loanRes, setMonthlyPaymentInput, displayState }) {
77
// 'monthlyPayment': monthlyPayment,
88
// 'monthlyPrincipal': monthlyPrincipal,
99
const widthPrincipleInterest = (100 * (loanRes["monthlyPrincipal"][0] + loanRes["monthlyInterest"][0])) / loanRes["monthlyPayment"][0];
10-
const widthPrincipleInterestFormat = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0, minimumFractionDigits: 0 }).format(
11-
loanRes["monthlyPrincipal"][0] + loanRes["monthlyInterest"][0]
12-
)
10+
const widthPrincipleInterestFormat = new Intl.NumberFormat("en-US", {
11+
style: "currency",
12+
currency: "USD",
13+
maximumFractionDigits: 0,
14+
minimumFractionDigits: 0,
15+
}).format(loanRes["monthlyPrincipal"][0] + loanRes["monthlyInterest"][0]);
1316
const widthOther = (100 * loanRes["monthlyOther"][0]) / loanRes["monthlyPayment"][0];
1417
const widthOtherFormat = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0, minimumFractionDigits: 0 }).format(
1518
loanRes["monthlyOther"][0]
16-
)
19+
);
1720

1821
console.log();
1922
return (
2023
<div className="row shadow border rounded p-2 mb-3">
2124
<div className="col-6 px-0">
2225
<label>Monthly Payment</label>
23-
<input
24-
type="text"
25-
className="form-control"
26-
onChange={(e) => {
27-
setMonthlyPaymentInput(e.target.value.replace(/[^0-9.-]+/g, ""));
28-
}}
29-
value= {new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0, minimumFractionDigits: 0, minimumIntegerDigits: displayState['monthlyPayment'].length }).format(
30-
displayState['monthlyPayment']
31-
)}
26+
<input
27+
type="text"
28+
className="form-control"
29+
onChange={(e) => {
30+
setMonthlyPaymentInput(e.target.value.replace(/[^0-9.-]+/g, ""));
31+
}}
32+
value={new Intl.NumberFormat("en-US", {
33+
style: "currency",
34+
currency: "USD",
35+
maximumFractionDigits: 0,
36+
minimumFractionDigits: 0,
37+
minimumIntegerDigits: displayState["monthlyPayment"].length,
38+
}).format(displayState["monthlyPayment"])}
3239
/>
33-
3440
</div>
3541
{/* <div className="col-6 px-0">
3642
<label> </label>

trgmc/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "eslint src && vite build",
8+
"build": "prettier src --write && eslint src && vite build",
99
"lint": "eslint src",
1010
"preview": "vite preview"
1111
},
@@ -16,7 +16,8 @@
1616
"react-bootstrap": "^2.10.1",
1717
"react-bootstrap-icons": "^1.11.3",
1818
"react-chartjs-2": "^5.2.0",
19-
"react-dom": "^18.2.0"
19+
"react-dom": "^18.2.0",
20+
"serve": "^14.2.3"
2021
},
2122
"devDependencies": {
2223
"@eslint/compat": "^1.0.1",

trgmc/src/App.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ function App() {
169169
newFlash["homeVal"] = !flash["homeVal"];
170170
if (userSetDownPercent) newFlash["downPayCash"] = !flash["downPayCash"];
171171
else newFlash["downPayPercent"] = !flash["downPayPercent"];
172-
173172
} else if (field == "monthlyPayment") {
174173
newChosenInput = "monthlyPayment";
175174
// newFlash["loanAmount"] = !flash["loanAmount"];
@@ -218,7 +217,7 @@ function App() {
218217
if (!isNumber(newUserInput[i])) {
219218
newValid[i] = "Must be a valid number";
220219
} else {
221-
var inputNumber = parseInt(newUserInput[i])
220+
var inputNumber = parseInt(newUserInput[i]);
222221
if (i == "homeVal" || i == "loanAmount" || i == "monthlyPayment") {
223222
if (inputNumber <= 0) {
224223
newValid[i] = "Must be a greater than 0";
@@ -232,23 +231,22 @@ function App() {
232231
}
233232
if (
234233
(i == "downPayPercent" && newUserSetDownPercent) ||
235-
(i == "insurance" && (newUserInput.insuranceUnit>1)) ||
236-
(i == "hoa" && (newUserInput.hoaUnit>1)) ||
237-
(i == "propertyTax" && (newUserInput.propertyTaxUnit>1))
238-
) {
234+
(i == "insurance" && newUserInput.insuranceUnit > 1) ||
235+
(i == "hoa" && newUserInput.hoaUnit > 1) ||
236+
(i == "propertyTax" && newUserInput.propertyTaxUnit > 1)
237+
) {
239238
// var newDownPay = field == "downPayCash" ? newUserInput.downPayCash : downPayCash;
240239
if (inputNumber > 100) {
241240
newValid[i] = "Must be <100%";
242241
}
243242
}
244-
if (((i == "propertyTax") || (i == "hoa") || (i == "insurance")) && (newChosenInput == "monthlyPayment")) {
243+
if ((i == "propertyTax" || i == "hoa" || i == "insurance") && newChosenInput == "monthlyPayment") {
245244
// var newDownPay = field == "downPayCash" ? newUserInput.downPayCash : downPayCash;
246245
if (inputNumber > newUserInput.monthlyPayment) {
247246
newValid[i] = "Must be < than monthly payment";
248247
}
249248
}
250249
}
251-
252250
}
253251
if (newChosenInput == "monthlyPayment") newValid["homeVal"] = null;
254252
else newValid["monthlyPayment"] = null;

0 commit comments

Comments
 (0)