Skip to content

Commit

Permalink
Show delegate contract information in the delegates list
Browse files Browse the repository at this point in the history
  • Loading branch information
torhector2 committed Sep 30, 2024
1 parent d563231 commit 89887a4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions modules/migration/components/DelegateContractInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function DelegateContractInfo({
const [modalOpen, setModalOpen] = useState(false);

const openModal = () => {
if (!delegate.isAboutToExpire && !delegate.expired) {
if (delegate.version === '2' || (!delegate.isAboutToExpire && !delegate.expired)) {
return;
}
setModalOpen(true);
Expand All @@ -43,15 +43,23 @@ export default function DelegateContractInfo({
}}
onClick={openModal}
>
<Text variant="caps" color="onSecondary" sx={{ mr: 1 }}>
V1 |
</Text>
{delegate.version !== '2' && (
<Text variant="caps" color="onSecondary" sx={{ mr: 1 }}>
V1 |
</Text>
)}
<Text variant="caps" color={'onSecondary'} sx={{ mr: 2 }}>
<Flex>
<Text sx={{ mr: 1 }}>
{delegate.expired ? 'EXPIRED' : delegate.isAboutToExpire ? 'EXPIRING' : 'EXPIRES'}
{delegate.version === '2'
? 'NO EXPIRATION'
: delegate.expired
? 'EXPIRED'
: delegate.isAboutToExpire
? 'EXPIRING'
: 'EXPIRES'}
</Text>{' '}
<DateWithHover date={delegate.expirationDate} />
{delegate.version !== '2' && <DateWithHover date={delegate.expirationDate} />}
</Flex>
</Text>
<Flex
Expand Down

0 comments on commit 89887a4

Please sign in to comment.