Skip to content

Commit

Permalink
added rent start date inside AssetCard
Browse files Browse the repository at this point in the history
  • Loading branch information
JSmithOner committed Dec 5, 2023
1 parent 67a3f05 commit 822acd7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@
"resolutions": {
"@radix-ui/react-scroll-area": "^0.1.5-rc.44"
}
}
}
10 changes: 9 additions & 1 deletion src/components/cards/AssetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ const AssetCardComponent: FC<AssetCardProps> = (props) => {

let disabled = false

const rentStartDate = moment(props.value.rentStartDate.date)

if (rentCalculation === RentCalculation.Realtime) {
const now = moment(new Date().toUTCString())
const rentStartDate = moment(props.value.rentStartDate.date)
const diff = now.diff(rentStartDate, 'day')
disabled = diff < 0
}
Expand Down Expand Up @@ -190,6 +191,13 @@ const AssetCardComponent: FC<AssetCardProps> = (props) => {
</div>
</div>

<div className={classes.groupApart}>
<div className={classes.textSm}>{t('rentStartDate')}</div>
<div className={classes.textSm}>
{rentStartDate.format('DD/MM/YYYY')}
</div>
</div>

<div style={{ flex: '1 1 auto' }} />
<Divider height={1} my={'xs'} />

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 @@ -152,6 +152,7 @@
"yearly": "Yearly rents",
"rentedUnits": "Rented units",
"propertyValue": "Property value",
"rentStartDate": "Rent Start",
"isRmmAvailable": "RMM",
"rentStatus": {
"full": "Rented",
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 @@ -152,6 +152,7 @@
"yearly": "Loyers annuels",
"rentedUnits": "Logements loués",
"propertyValue": "Valeur de la propriété",
"rentStartDate": "Début de la rente",
"isRmmAvailable": "RMM",
"rentStatus": {
"full": "Louée",
Expand Down

0 comments on commit 822acd7

Please sign in to comment.