Skip to content

Commit

Permalink
feat: add fully rented APR to property details
Browse files Browse the repository at this point in the history
  • Loading branch information
NandyBa committed Aug 17, 2024
1 parent 791ef77 commit 86b991d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/assetPage/assetPagePropertyTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 (
<>
Expand Down Expand Up @@ -106,6 +109,10 @@ export const AssetPagePropertyTab: FC<{
label: t('annualYield'),
value: annualYield,
},
{
label: t('fullyRentedAPR'),
value: fullyRentedAPRValue,
},
]}
/>

Expand Down
1 change: 1 addition & 0 deletions src/i18next/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/i18next/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/pages/asset/[assetId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -158,6 +159,7 @@ const AssetPage: NextPage = () => {
</Button>
</div>
</div>
<FullyRentedAPRDisclaimer />
</Flex>
)
}
Expand Down

0 comments on commit 86b991d

Please sign in to comment.