Skip to content

Commit

Permalink
Stats dApp fixes and adds rotated key status to key timeline (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
devpavan04 authored Sep 1, 2023
1 parent a006862 commit 55e7581
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { FC, useMemo, useState } from 'react';
import { Link } from 'react-router-dom';
import { AuthoritiesTableProps } from './types';
import { CountryIcon } from '../../components/CountryIcon/CountryIcon';
import { Spinner } from '@webb-tools/icons';

const columnHelper = createColumnHelper<AuthorityListItem>();

Expand Down Expand Up @@ -266,12 +267,18 @@ export const AuthoritiesTable: FC<AuthoritiesTableProps> = ({
</Filter>
}
>
<Table
tableProps={table as RTTable<unknown>}
isPaginated
totalRecords={totalItems}
title="DKG Authorities"
/>
{!authorities.isLoading ? (
<Table
tableProps={table as RTTable<unknown>}
isPaginated
totalRecords={totalItems}
title="DKG Authorities"
/>
) : (
<div className="h-[400px] flex items-center flex-col justify-center">
<Spinner size="xl" />
</div>
)}
</CardTable>
);
};
Expand Down
39 changes: 0 additions & 39 deletions apps/stats-dapp/src/containers/KeyDetail/KeyDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ export const KeyDetail = forwardRef<HTMLDivElement, KeyDetailProps>(
time={at}
blockHash={hash}
externalUrl={POLKADOT_EXPLORER_URL + hash}
extraContent={
<div className="flex items-center space-x-2">
{/* <KeyValueWithButton
keyValue={keyDetail.uncompressed}
size="sm"
/> */}
</div>
}
/>
);
}
Expand All @@ -256,37 +248,6 @@ export const KeyDetail = forwardRef<HTMLDivElement, KeyDetailProps>(
time={at}
blockHash={hash}
externalUrl={POLKADOT_EXPLORER_URL + hash}
extraContent={
<div className="flex items-center space-x-4">
<LabelWithValue
label="Height"
value={keyDetail.height}
/>
{/** TODO: Proposal type */}
<LabelWithValue
label="Proposal"
value="KeyRotation"
/>
{keyDetail.authorities.length && (
<LabelWithValue
label="Proposers"
value={
<AvatarGroup
total={keyDetail.authorities.length}
>
{keyDetail.authorities.map((author, idx) => (
<Avatar
key={author.id}
value={author.account}
sourceVariant="address"
/>
))}
</AvatarGroup>
}
/>
)}
</div>
}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/stats-dapp/src/provider/hooks/useAuthorities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export function useAuthority(pageQuery: AuthorityQuery): AuthorityDetails {
return {
id: publicKey.id,
session: session && session.id ? session.id : '',
publicKey: '', // publicKey.uncompressed!
publicKey: publicKey.compressed ?? '',
height: `${publicKey.block?.number ?? '-'}`,
authority: {
count: session.sessionValidators.totalCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const TitleWithInfo = forwardRef<HTMLDivElement, TitleWithInfoProps>(
</TooltipTrigger>
<TooltipBody>
{typeof info === 'string' ? (
<Typography variant={'body3'} className="break-normal">
<Typography variant={'body1'} className="break-normal">
{info}
</Typography>
) : (
Expand Down
3 changes: 1 addition & 2 deletions libs/webb-ui-components/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ export const TooltipBody: React.FC<TooltipBodyProps> = ({
'bg-mono-20 dark:bg-mono-160',
'webb-shadow-sm'
)}
side="bottom"
{...props}
>
<TooltipPrimitive.Arrow className="fill-current text-mono-20 dark:text-mono-160 webb-shadow-sm" />
<div
className={twMerge(
'text-mono-140 dark:text-mono-80 font-normal',
'body4 text-mono-140 dark:text-mono-80 font-normal',
className
)}
>
Expand Down

0 comments on commit 55e7581

Please sign in to comment.