Skip to content

Commit

Permalink
Merge pull request #80 from RealToken-Community/revert-77-preprod
Browse files Browse the repository at this point in the history
Revert "merge preprod <> master"
  • Loading branch information
AlexRLT authored Aug 31, 2024
2 parents 68daad5 + 158465f commit ed61a4c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 100 deletions.
60 changes: 1 addition & 59 deletions src/components/assetsView/views/AssetTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AssetTable: FC<{
{props.realtokens.map((item, index) => {
const isAProperty = item.hasOwnProperty('rentStatus')
if (!isAProperty) {
return <RWATableRow key={'0'} value={item as RWARealtoken} />
return <AssetTableRow key={'0'} value={item as UserRealtoken} />
}
return <AssetTableRow key={index} value={item as UserRealtoken} />
})}
Expand Down Expand Up @@ -159,62 +159,4 @@ const AssetTableRow: FC<{ value: UserRealtoken }> = (props) => {
</Table.Tr>
)
}

const RWATableRow: FC<{ value: RWARealtoken }> = (props) => {
const { t } = useTranslation('common', { keyPrefix: 'numbers' })
const transfersIsLoaded = useSelector(selectTransfersIsLoaded)

const { shortName, value, unitPriceCost, amount, totalInvestment } =
props.value

return (
<Table.Tr>
<Table.Td style={{ minWidth: '150px' }}>
<Anchor>{shortName}</Anchor>
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(value)}
</Table.Td>
{transfersIsLoaded ? (
<>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
</>
) : null}

<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(unitPriceCost)}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{t('decimal', { value: amount })}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{useCurrencyValue(totalInvestment)}
</Table.Td>
<Table.Td style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
{'-'}
</Table.Td>
</Table.Tr>
)
}

AssetTableRow.displayName = 'AssetTableRow'
7 changes: 0 additions & 7 deletions src/components/layouts/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ export const Header: FC = () => {
label={t('YAM')}
leftSection={<IconExternalLink size={'1rem'} stroke={1.5} />}
/>
<NavLink
component={'a'}
href={'https://bridge.realtoken.network/'}
target={'_blank'}
label={t('Bridge')}
leftSection={<IconExternalLink size={'1rem'} stroke={1.5} />}
/>
</Drawer>
<div>
<Box className={styles.container}>
Expand Down
31 changes: 3 additions & 28 deletions src/hooks/useFullyRentedAPR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import {
} from 'src/types/RentCalculation'

const fullyRentedAPREstimation = (token: UserRealtoken) => {
// VEFA properties
if (isVEFA(token)) {
return VEFAAPRs[token.shortName as keyof typeof VEFAAPRs]
}

// Case of fully rented property
if (token.rentedUnits === token.totalUnits) {
return token.annualPercentageYield
Expand Down Expand Up @@ -63,7 +58,7 @@ export const useFullyRentedAPR = (token: UserRealtoken) => {

const fullyRentedAPR = useMemo(() => {
const isDisabled = APRDisabled(rentCalculation, token)
if (isDisabled && !isVEFA(token)) return 0
if (isDisabled) return 0
return fullyRentedAPREstimation(token)
}, [token, rentCalculation])

Expand All @@ -75,12 +70,12 @@ export const useGeneralFullyRentedAPR = (tokens: UserRealtoken[]) => {
// Fully rented APR average using valuation ponderation
const fullyRentedAPR = useMemo(() => {
const totalValue = tokens.reduce((acc, token) => {
const isDisabled = APRDisabled(rentCalculation, token) && !isVEFA(token)
const isDisabled = APRDisabled(rentCalculation, token)
if (isDisabled) return acc
return acc + token.value
}, 0)
const totalAPR = tokens.reduce((acc, token) => {
const isDisabled = APRDisabled(rentCalculation, token) && !isVEFA(token)
const isDisabled = APRDisabled(rentCalculation, token)
if (isDisabled) return acc
return acc + token.value * fullyRentedAPREstimation(token)
}, 0)
Expand All @@ -101,23 +96,3 @@ const APRDisabled = (
rentStartDate > realtimeDate.toDate()
return isDisabled
}

export const isVEFA = (token: UserRealtoken) => {
return (
token.shortName === 'Playa Caracol Cottage 10' ||
token.shortName === 'Playa Caracol 303300' ||
token.shortName === 'Playa Caracol 303200' ||
token.shortName === 'PH Pinoalto A002' ||
token.shortName === 'PH Pinoalto A003' ||
token.shortName === 'Vervana T1 '
)
}

const VEFAAPRs = {
'Playa Caracol Cottage 10': 10.77,
'Playa Caracol 303300': 10.69,
'Playa Caracol 303200': 10.8,
'PH Pinoalto A002': 10.11,
'PH Pinoalto A003': 10.11,
'Vervana T1 ': 11.33,
}
3 changes: 1 addition & 2 deletions src/i18next/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"home": "Home",
"realt": "RealT",
"RMM": "RMM",
"YAM": "YAM",
"Bridge": "Bridge"
"YAM": "YAM"
},
"settings": {
"title": "Language",
Expand Down
5 changes: 2 additions & 3 deletions src/i18next/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"home": "Accueil",
"realt": "RealT",
"RMM": "RMM",
"YAM": "YAM",
"Bridge": "Bridge"
"YAM": "YAM"
},
"settings": {
"title": "Langue",
Expand Down Expand Up @@ -396,6 +395,6 @@
"description": "Récupération de vos transactions en cours. Ce chargement peut prendre un certain temps en fonction du nombre de transactions effecutées (10-20 secondes / 1000 transactions). Lors de vos prochaines visites, seul les nouvelles transactions seront récupérées."
},
"disclaimer":{
"fullyRentedAPR": "Cette estimation est en phase bêta et a été développée par la communauté RealT. Nous vous invitons à signaler tout problème éventuel. Les informations fournies sont à titre indicatif uniquement. La communauté RealT ou RealT ne peut être tenue responsable en cas de décision prise à partir de données inexactes."
"fullyRentedAPR": "Cette estimation est en phase bêta et a été développée par la communauté RealT. Nous vous invitons à signaler tout problème éventuel. Les informations fournies sont à titre indicatif uniquement. La communauté RealT ou RealT ne peut être tenu responsable en cas de décision prise à partir de données inexactites."
}
}
2 changes: 1 addition & 1 deletion src/pages/yamStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const YamStatisticsPage = () => {
<th>Token Price</th>
<th>Yam Price</th>
<th>Yam Difference (30 days)</th>
<th>Yam Volume (30 days)</th>
<th>Yam Volume</th>
</tr>
{paginationYamStatistics.map((statistics, index) => (
<YamStatisticsRow
Expand Down

0 comments on commit ed61a4c

Please sign in to comment.