diff --git a/src/App.js b/src/App.js
index e08c7e0..fea1463 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,5 +1,20 @@
import React from "react";
+const RenderInput = ({ name, value, onChange }) => {
+ return (
+
+ );
+};
+
class App extends React.Component {
constructor(props) {
super(props);
@@ -38,6 +53,7 @@ class App extends React.Component {
const name = target.name;
let value = target.type === "checkbox" ? target.checked : target.value;
+ // input was entered and later cleared, or entered non-numeric input
if (value === "") {
value = 0;
}
@@ -94,7 +110,7 @@ class App extends React.Component {
if (isNaN(taxableIncome)) {
taxableIncome = 0.0;
- // tax rates are progressive, no tax below earning SGD 20,000.00
+ // tax rates are progressive starting above earning SGD 20,000.00
} else if (taxableIncome <= 20000) {
tax = 0.0;
} else if (taxableIncome <= 30000) {
@@ -185,13 +201,9 @@ class App extends React.Component {
Employment income |
-
|
@@ -199,13 +211,9 @@ class App extends React.Component {
Employment expenses |
-
|
@@ -213,13 +221,9 @@ class App extends React.Component {
Income from trade, business etc. |
-
|
@@ -228,13 +232,9 @@ class App extends React.Component {
Dividends earned |
{" "}
-
|
@@ -242,13 +242,9 @@ class App extends React.Component {
Interests earned |
-
|
@@ -256,13 +252,9 @@ class App extends React.Component {
Rent from property |
-
|
@@ -270,13 +262,9 @@ class App extends React.Component {
Royalty, estate/trust income |
-
|
@@ -284,13 +272,9 @@ class App extends React.Component {
Gains/Profits of an income nature |
-
|
@@ -298,13 +282,9 @@ class App extends React.Component {
Approved donations |
-
|
@@ -312,13 +292,9 @@ class App extends React.Component {
Earned income relief |
-
|
@@ -326,13 +302,9 @@ class App extends React.Component {
Spouse/handicapped spouse relief |
-
|
@@ -340,13 +312,9 @@ class App extends React.Component {
Qualifying/handicapped child relief |
-
|
@@ -354,13 +322,9 @@ class App extends React.Component {
Working mother's child relief |
-
|
@@ -368,13 +332,9 @@ class App extends React.Component {
Parent/handicapped parent relief |
-
|
@@ -382,13 +342,9 @@ class App extends React.Component {
Grandparent caregiver relief |
-
|
@@ -396,13 +352,9 @@ class App extends React.Component {
Handicapped brother/sister relief |
-
|
@@ -410,13 +362,9 @@ class App extends React.Component {
CPF/provident fund relief |
-
|
@@ -424,13 +372,9 @@ class App extends React.Component {
Life insurance relief |
-
|
@@ -438,13 +382,9 @@ class App extends React.Component {
Course fees relief |
-
|
@@ -452,13 +392,9 @@ class App extends React.Component {
Foreign domestic worker levy relief |
-
|
@@ -466,13 +402,9 @@ class App extends React.Component {
CPF cash top-up relief |
-
|
@@ -480,13 +412,9 @@ class App extends React.Component {
SRS relief |
-
|
@@ -494,13 +422,9 @@ class App extends React.Component {
National Service relief |
-
|
@@ -508,13 +432,9 @@ class App extends React.Component {
Parenthood tax rebate |
-
|
@@ -527,13 +447,9 @@ class App extends React.Component {
Please enter your yearly taxable income (in Singapore dollar):
-