Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nit: fix placeholder copy in form #263

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions app/components/ui/CalculatorInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Household } from "@/app/models/Household";
import Dashboard from "./Dashboard";
import { formSchema, FormFrontend } from "@/app/schemas/formSchema";
import { useSearchParams } from "next/navigation";
import { DEFAULT_INTEREST_RATE, DEFAULT_MORTGAGE_TERM, DEFAULT_INITIAL_DEPOSIT } from "../../models/constants"

import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { ClipLoader } from "react-spinners";
Expand Down Expand Up @@ -206,7 +207,7 @@ const CalculatorInput = () => {
</FormLabel>
<FormControl>
<Input
placeholder="e.g. 80 for 80 square meters"
placeholder="e.g. 80 for 80 square metres"
{...field}
value={field.value ?? ""}
className="inputfield-style"
Expand All @@ -228,7 +229,7 @@ const CalculatorInput = () => {
</FormLabel>
<FormControl>
<Input
placeholder="e.g. 1 for a new house"
placeholder="e.g. 0 for a new house"
{...field}
value={field.value ?? ""}
className="inputfield-style"
Expand All @@ -249,7 +250,7 @@ const CalculatorInput = () => {
</FormLabel>
<FormControl>
<Input
placeholder=" e.g. 2 for twp bedrooms"
placeholder=" e.g. 2 for two bedrooms"
{...field}
value={field.value ?? ""}
className="inputfield-style"
Expand Down Expand Up @@ -327,19 +328,19 @@ const CalculatorInput = () => {
<span className="h3-style inaccessible-input-style">
Mortgage interest rate
</span>
<span className="inaccessible-input-style">6%</span>
<span className="inaccessible-input-style">{DEFAULT_INTEREST_RATE * 100}%</span>
</div>
<div className="flex flex-col">
<span className="h3-style inaccessible-input-style">
Mortgage term
</span>
<span className="inaccessible-input-style">25 years</span>
<span className="inaccessible-input-style">{DEFAULT_MORTGAGE_TERM} years</span>
</div>
<div className="flex flex-col">
<span className="h3-style inaccessible-input-style">
Mortgage deposit
</span>
<span className="inaccessible-input-style">25 years</span>
<span className="inaccessible-input-style">{DEFAULT_INITIAL_DEPOSIT * 100}%</span>
</div>
</div>

Expand Down
7 changes: 1 addition & 6 deletions app/models/Mortgage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { MONTHS_PER_YEAR } from "./constants";

const DEFAULT_INTEREST_RATE = 0.06;
const DEFAULT_MORTGAGE_TERM = 30;
const DEFAULT_INITIAL_DEPOSIT = 0.15;

import { MONTHS_PER_YEAR, DEFAULT_INTEREST_RATE, DEFAULT_MORTGAGE_TERM, DEFAULT_INITIAL_DEPOSIT } from "./constants";
interface MortgageParams {
propertyValue: number;
interestRate?: number;
Expand Down
4 changes: 4 additions & 0 deletions app/models/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export const MONTHS_PER_YEAR = 12;
export const WEEKS_PER_MONTH = 4.2;

export const DEFAULT_INTEREST_RATE = 0.06;
export const DEFAULT_MORTGAGE_TERM = 30;
export const DEFAULT_INITIAL_DEPOSIT = 0.15;

export type BedWeightsAndCaps = {
numberOfBedrooms: number[];
weight: number[];
Expand Down
Loading