Skip to content

Commit

Permalink
Improving functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
JKarina-code committed Jun 15, 2023
1 parent c78406f commit 46c49f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ function App() {

<select
className="mt-5 w-full p-2 bg-white border border-gray-300 rounded-lg text-center text-xl font-bold text-gray-500"
value="months"
onChange={changeMonths}
onChange={changeMonths}
>
<option value="6">6 Months</option>
<option value="12">12 Months</option>
Expand All @@ -94,7 +93,7 @@ function App() {
pay
</p>
<p className="text-xl text-gray-500 text-center font-bold">
<span className="text-indigo-600">{formatMoney(pay)}</span>Monthly
<span className="text-indigo-600">{formatMoney(pay)}</span> Monthly
</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const calculateTotalPay = (amount, term) => {
total = amount * 1.2;
}

if (term === 6) {
if (term === "6") {
total *= 1.1;
} else if (term === 12) {
} else if (term === "12") {
total *= 1.2;
} else {
total *= 1.3;
Expand Down

0 comments on commit 46c49f4

Please sign in to comment.