From 86b991d0056c5fcf2287f21178abf4a1bd097729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nandy=20B=C3=A2?= Date: Sat, 17 Aug 2024 23:48:45 +0200 Subject: [PATCH] feat: add fully rented APR to property details --- src/components/assetPage/assetPagePropertyTab.tsx | 7 +++++++ src/i18next/locales/en/common.json | 1 + src/i18next/locales/fr/common.json | 1 + src/pages/asset/[assetId].tsx | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/components/assetPage/assetPagePropertyTab.tsx b/src/components/assetPage/assetPagePropertyTab.tsx index 49f6dfb..b3f58a6 100644 --- a/src/components/assetPage/assetPagePropertyTab.tsx +++ b/src/components/assetPage/assetPagePropertyTab.tsx @@ -2,6 +2,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { useCurrencyValue } from 'src/hooks/useCurrencyValue' +import { useFullyRentedAPR } from 'src/hooks/useFullyRentedAPR' import { UserRealtoken } from 'src/store/features/wallets/walletsSelector' import { RealTokenRentalType } from 'src/types/RealToken' @@ -44,6 +45,8 @@ export const AssetPagePropertyTab: FC<{ const propertyStories = realtoken.propertyStories ? tNumbers('integer', { value: realtoken.propertyStories }) : '-' + const fullyRentedAPR = useFullyRentedAPR(realtoken) + const fullyRentedAPRValue = tNumbers('percent', { value: fullyRentedAPR }) return ( <> @@ -106,6 +109,10 @@ export const AssetPagePropertyTab: FC<{ label: t('annualYield'), value: annualYield, }, + { + label: t('fullyRentedAPR'), + value: fullyRentedAPRValue, + }, ]} /> diff --git a/src/i18next/locales/en/common.json b/src/i18next/locales/en/common.json index 53105be..f5facca 100644 --- a/src/i18next/locales/en/common.json +++ b/src/i18next/locales/en/common.json @@ -264,6 +264,7 @@ "grossRentMonth": "Gross monthly rent", "netRentMonth": "Net monthly rent", "annualYield": "Annual yield", + "fullyRentedAPR": "Fully rented APR *", "constructionYear": "Construction year", "propertyStories": "Number of stories", "propertyUnits": "Number of units", diff --git a/src/i18next/locales/fr/common.json b/src/i18next/locales/fr/common.json index 65e42cb..f5bdbfa 100644 --- a/src/i18next/locales/fr/common.json +++ b/src/i18next/locales/fr/common.json @@ -264,6 +264,7 @@ "grossRentMonth": "Loyer brut mensuel", "netRentMonth": "Loyer net mensuel", "annualYield": "Rendement annuel", + "fullyRentedAPR": "Rendement 100% loué *", "constructionYear": "Année de construction", "propertyStories": "Nombre d'étages", "propertyUnits": "Nombre de logements", diff --git a/src/pages/asset/[assetId].tsx b/src/pages/asset/[assetId].tsx index 2d2a1ad..9c93d54 100644 --- a/src/pages/asset/[assetId].tsx +++ b/src/pages/asset/[assetId].tsx @@ -14,6 +14,7 @@ import { AssetPageMainTab } from 'src/components/assetPage/assetPageMainTab' import { AssetPagePropertyTab } from 'src/components/assetPage/assetPagePropertyTab' import { AssetPageTransfersTab } from 'src/components/assetPage/assetPageTransfersTab' import { AssetPageYamStatisticsTab } from 'src/components/assetPage/assetPageYamStatisticsTab' +import FullyRentedAPRDisclaimer from 'src/components/commons/others/FullyRentedAPRDisclaimer' import { selectIsLoading } from 'src/store/features/settings/settingsSelector' import { selectTransfersIsLoaded } from 'src/store/features/transfers/transfersSelector' import { selectAllUserRealtokens } from 'src/store/features/wallets/walletsSelector' @@ -158,6 +159,7 @@ const AssetPage: NextPage = () => { + ) }