Skip to content

Commit

Permalink
Merge pull request #90 from DTS-STN/develop
Browse files Browse the repository at this point in the history
Main release
  • Loading branch information
JeremyKennedy authored Jan 14, 2022
2 parents 408dfe3 + 7951ed8 commit e28326f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions components/ResultsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ export const ResultsTable = observer(() => {
<td colSpan={2}>Total Monthly Benefit Amount</td>
<td>
$
{root.oas.entitlementResult +
{(
root.oas.entitlementResult +
root.gis.entitlementResult +
root.allowance?.entitlementResult +
root.afs?.entitlementResult}
root.afs?.entitlementResult
).toFixed(2)}
</td>
</tr>
</tbody>
Expand Down
15 changes: 11 additions & 4 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type { NextPage } from 'next'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useState } from 'react'
import { Alert } from '../components/Alert'
import { CurrencyField } from '../components/Forms/CurrencyField'
import { Layout } from '../components/Layout'
import { EstimationSummaryState } from '../utils/api/definitions/enums'

const Home: NextPage = () => {
const router = useRouter()
const [error, setError] = useState(null)
return (
<Layout>
<div className="mt-18 text-content">
Expand Down Expand Up @@ -55,23 +57,28 @@ const Home: NextPage = () => {
const input = document.querySelector(
'input[name="income"]'
) as HTMLInputElement
const sanitizedValue = input.value
.replaceAll('$', '')
.replaceAll(',', '')
router.push(`/eligibility?income=${sanitizedValue}`)
const sanitizedValue = input.value.replaceAll('$', '').replaceAll(',', '')
if (sanitizedValue == null || sanitizedValue == '') {
setError('This field is required')
} else {
router.push(`/eligibility?income=${sanitizedValue}`)
}
}}
onReset={(e) => {
const input = document.querySelector(
'input[name="income"]'
) as HTMLInputElement
input.setAttribute('value', '')
setError('')
}}
noValidate
>
<CurrencyField
type="text"
name="income"
label="What is your current annual net income in Canadian dollars"
placeholder="$20,000"
error={error}
required
/>
<div className="mt-10 flex space-x-5">
Expand Down

1 comment on commit e28326f

@vercel
Copy link

@vercel vercel bot commented on e28326f Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.