Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display link to proposer in consensus block data #1706

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/1706.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show proposer link in consensus block details
16 changes: 15 additions & 1 deletion src/app/pages/ConsensusBlockDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useHref, useOutletContext, useParams } from 'react-router-dom'
import Typography from '@mui/material/Typography'
import { AppErrors } from '../../../types/errors'
import { useScreenSize } from '../../hooks/useScreensize'
import { Block, Layer, useGetConsensusBlockByHeight } from '../../../oasis-nexus/api'
import { Block, EntityMetadata, Layer, useGetConsensusBlockByHeight } from '../../../oasis-nexus/api'
import { SearchScope } from '../../../types/searchScope'
import { useFormattedTimestampStringWithDistance } from '../../hooks/useFormattedTimestamp'
import { useRequiredScopeParam } from '../../hooks/useScopeParam'
Expand All @@ -19,6 +19,7 @@ import { SubPageCard } from '../../components/SubPageCard'
import { AdaptiveTrimmer } from '../../components/AdaptiveTrimmer/AdaptiveTrimmer'
import { DashboardLink } from '../ParatimeDashboardPage/DashboardLink'
import { eventsContainerId } from './ConsensusBlockEventsCard'
import { ValidatorLink } from '../../components/Validators/ValidatorLink'

export type BlockDetailConsensusBlock = Block & {
markAsNew?: boolean
Expand Down Expand Up @@ -132,6 +133,19 @@ export const ConsensusBlockDetailView: FC<{
</>
)}

{!!block.proposer?.entity_address && (
<>
<dt>{t('common.proposer')}</dt>
<dd>
<ValidatorLink
name={(block.proposer?.entity_metadata as EntityMetadata)?.name}
address={block.proposer?.entity_address}
alwaysTrim
network={block.network}
/>
</dd>
</>
)}
<dt>{t('common.timestamp')}</dt>
<dd>{formattedTime}</dd>

Expand Down
Loading