Skip to content

Commit

Permalink
Merge pull request #1712 from streamr-dev/front-1649-slashing-history…
Browse files Browse the repository at this point in the history
…-rows-should-link-to-sponsorships

FRONT-1649: Link slashing history rows to sponsorships
  • Loading branch information
mondoreale authored Nov 13, 2023
2 parents 3e84254 + f307cf9 commit a1c1a2d
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/pages/SingleOperatorPage.tsx
Original file line number Diff line number Diff line change
@@ -640,7 +640,9 @@ export const SingleOperatorPage = () => {
columns={[
{
displayName: 'Stream ID',
valueMapper: (element) => element.streamId,
valueMapper: ({ streamId }) => (
<StreamIdCell streamId={streamId} />
),
align: 'start',
isSticky: true,
key: 'id',
@@ -694,6 +696,9 @@ export const SingleOperatorPage = () => {
key: 'reason',
},
]}
linkMapper={({ sponsorshipId: id }) =>
routes.network.sponsorship({ id })
}
/>
</SlashingHistoryTableContainer>
</NetworkPageSegment>
6 changes: 4 additions & 2 deletions src/parsers/OperatorParser.ts
Original file line number Diff line number Diff line change
@@ -56,14 +56,16 @@ export const OperatorParser = z
amount: z.string().transform(toBN),
date: z.coerce.number(),
sponsorship: z.object({
id: z.string(),
stream: z.object({
id: z.string(),
}),
}),
})
.transform(({ sponsorship, ...rest }) => ({
.transform(({ sponsorship: { id: sponsorshipId, stream }, ...rest }) => ({
...rest,
streamId: sponsorship.stream.id,
sponsorshipId,
streamId: stream.id,
})),
),
stakes: z.array(

0 comments on commit a1c1a2d

Please sign in to comment.