Skip to content

Commit

Permalink
fix: show area in onboarding confirm page
Browse files Browse the repository at this point in the history
  • Loading branch information
cephaschapa committed Apr 15, 2024
1 parent cbad07f commit f84c79f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/app/[lng]/onboarding/setup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useTranslation } from "@/i18n/client";
import { useAppDispatch, useAppSelector } from "@/lib/hooks";
import type { CityAttributes } from "@/models/City";
import {
api,
useAddCityMutation,
useAddCityPopulationMutation,
useAddInventoryMutation,
Expand Down Expand Up @@ -641,7 +642,7 @@ function ConfirmStep({
{area > 0 ? (
<>
{" "}
{area}km<sup>2</sup>
{Math.round(area)}km<sup>2</sup>
</>
) : (
"N/A"
Expand Down Expand Up @@ -716,6 +717,10 @@ export default function OnboardingSetup({
const regionPopulationYear = watch("regionPopulationYear");
const countryPopulationYear = watch("countryPopulationYear");

const { data: cityArea, isLoading: isCityAreaLoading } = api.useGetCityBoundaryQuery(data.locode!, {
skip: !data.locode,
});

const onConfirm = async () => {
// save data in backend
setConfirming(true);
Expand Down Expand Up @@ -831,7 +836,7 @@ export default function OnboardingSetup({
cityName={getValues("city")}
t={t}
locode={data.locode}
area={ocCityData?.area!}
area={cityArea?.area!}
population={cityPopulation}
/>
)}
Expand Down

0 comments on commit f84c79f

Please sign in to comment.