Skip to content

Commit

Permalink
fix(explorer): move View all button to the top in Top Validators
Browse files Browse the repository at this point in the history
  • Loading branch information
cpl121 committed Dec 20, 2024
1 parent e7cd554 commit 90bee59
Showing 1 changed file with 36 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
// SPDX-License-Identifier: Apache-2.0

import { useIotaClientQuery } from '@iota/dapp-kit';
import { PlaceholderTable, TableCard } from '~/components/ui';
import { Link, PlaceholderTable, TableCard } from '~/components/ui';
import { generateValidatorsTableColumns } from '~/lib/ui';
import { InfoBox, InfoBoxStyle, InfoBoxType, Panel, Title } from '@iota/apps-ui-kit';
import {
Button,
ButtonSize,
ButtonType,
InfoBox,
InfoBoxStyle,
InfoBoxType,
Panel,
Title,
} from '@iota/apps-ui-kit';
import { ErrorBoundary } from '../error-boundary/ErrorBoundary';
import { Warning } from '@iota/ui-icons';

Expand Down Expand Up @@ -45,26 +54,33 @@ export function TopValidatorsCard({ limit, showIcon }: TopValidatorsCardProps):

return (
<Panel>
<Title title="Top Validators" />

<div className="p-md">
{isPending && (
<PlaceholderTable
rowCount={limit || NUMBER_OF_VALIDATORS}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
)}
<div className="relative">
<div className="absolute right-0 mr-4 mt-2">
<Link to="/validators">
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
text="View All"
/>
</Link>
</div>
<Title title="Top Validators" />

{isSuccess && (
<ErrorBoundary>
<TableCard
data={topActiveValidators}
columns={tableColumns}
viewAll="/validators"
<div className="p-md">
{isPending && (
<PlaceholderTable
rowCount={limit || NUMBER_OF_VALIDATORS}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
</ErrorBoundary>
)}
)}

{isSuccess && (
<ErrorBoundary>
<TableCard data={topActiveValidators} columns={tableColumns} />
</ErrorBoundary>
)}
</div>
</div>
</Panel>
);
Expand Down

0 comments on commit 90bee59

Please sign in to comment.