Skip to content

Commit

Permalink
Merge pull request #82 from City-of-Helsinki/develop
Browse files Browse the repository at this point in the history
Added a new field release_payment (#81)
  • Loading branch information
tvalimaa committed Feb 15, 2023
2 parents 8efd364 + 336e43a commit 5e37d59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/search/components/result/list/ApartmentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const ApartmentRow = ({
debt_free_sales_price,
right_of_occupancy_payment,
url,
release_payment,
} = apartment;

const { t } = useTranslation();
Expand All @@ -51,6 +52,8 @@ const ApartmentRow = ({
const isDesktopSize = width > BREAK_POINT;
const isMobileSize = width <= BREAK_POINT;

const hasoVariablePrice = release_payment && release_payment > 0 ? release_payment : right_of_occupancy_payment;

const handleResize = () => {
setWidth(window.innerWidth);
};
Expand Down Expand Up @@ -119,7 +122,7 @@ const ApartmentRow = ({
<span className={isDesktopSize ? 'sr-only' : css.cellMobileTitle}>
{t('SEARCH:right-of-occupancy-payment')}&nbsp;{' '}
</span>
<span>{formattedPrice(right_of_occupancy_payment)}</span>
<span>{formattedPrice(hasoVariablePrice)}</span>
</div>
) : (
<div className={css.cell}>
Expand Down
1 change: 1 addition & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export type Apartment = {
project_zoning_info: string;
project_zoning_status: string;
right_of_occupancy_payment: number;
release_payment: number;
room_count: number;
sales_price: number;
services: string[];
Expand Down

0 comments on commit 5e37d59

Please sign in to comment.