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

feat(explorer): polish validators view and bring back actions in Table #4153

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export function TopValidatorsCard({ limit, showIcon }: TopValidatorsCardProps):
data={data.activeValidators}
columns={tableColumns}
viewAll="/validators"
totalLabel={data ? data.activeValidators.length.toString() : '--'}
/>
</ErrorBoundary>
)}
Expand Down
44 changes: 23 additions & 21 deletions apps/explorer/src/pages/validators/Validators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
InfoBox,
InfoBoxStyle,
InfoBoxType,
TableHeader,
Panel,
Title,
TooltipPosition,
} from '@iota/apps-ui-kit';
import { useIotaClientQuery } from '@iota/dapp-kit';
Expand Down Expand Up @@ -155,26 +156,27 @@ function ValidatorPageResult(): JSX.Element {
/>
))}
</div>
<div>
<ErrorBoundary>
<TableHeader>All Validators</TableHeader>
{(isPending || validatorsEventsLoading) && (
<PlaceholderTable
rowCount={20}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
)}

{isSuccess && tableData && tableColumns && (
<TableCard
data={tableData}
columns={tableColumns}
areHeadersCentered={false}
/>
)}
</ErrorBoundary>
</div>
<Panel>
<Title title="All Validators" />
<div className="p-md">
<ErrorBoundary>
{(isPending || validatorsEventsLoading) && (
<PlaceholderTable
rowCount={20}
rowHeight="13px"
colHeadings={['Name', 'Address', 'Stake']}
/>
)}
{isSuccess && tableData && tableColumns && (
<TableCard
data={tableData}
columns={tableColumns}
areHeadersCentered={false}
/>
)}
</ErrorBoundary>
</div>
</Panel>
</div>
)
}
Expand Down
64 changes: 34 additions & 30 deletions apps/ui-kit/src/lib/components/organisms/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,41 @@ export function Table({
'justify-end': !paginationOptions && action,
})}
>
{paginationOptions && (
{(paginationOptions || action) && (
<div className="flex gap-2">
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<DoubleArrowLeft />}
disabled={!paginationOptions.hasFirst}
onClick={paginationOptions.onFirst}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<ArrowLeft />}
disabled={!paginationOptions.hasPrev}
onClick={paginationOptions.onPrev}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<ArrowRight />}
disabled={!paginationOptions.hasNext}
onClick={paginationOptions.onNext}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<DoubleArrowRight />}
disabled={!paginationOptions.hasLast}
onClick={paginationOptions.onLast}
/>
{action}
{paginationOptions && (
<>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<DoubleArrowLeft />}
disabled={!paginationOptions.hasFirst}
onClick={paginationOptions.onFirst}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<ArrowLeft />}
disabled={!paginationOptions.hasPrev}
onClick={paginationOptions.onPrev}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<ArrowRight />}
disabled={!paginationOptions.hasNext}
onClick={paginationOptions.onNext}
/>
<Button
type={ButtonType.Secondary}
size={ButtonSize.Small}
icon={<DoubleArrowRight />}
disabled={!paginationOptions.hasLast}
onClick={paginationOptions.onLast}
/>
</>
)}
{action && action}
</div>
)}
{supportingLabel || pageSizeSelector ? (
Expand Down
Loading