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: block detail pagination #1175

Merged
merged 4 commits into from
Feb 6, 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
7 changes: 6 additions & 1 deletion resources/views/app/block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@

<x-block.page.summary :block="$block" />

<x-general.page-section.confirmations :model="$block" />
<x-general.page-section.confirmations
:model="$block"
no-bottom-padding
/>

@if ($block->transactionCount() > 0)
<x-block.page.transaction-list :block="$block" />
@endif
</div>

<x-block.page.detail-pagination :block="$block" />
@endsection
@endcomponent
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@props(['block'])

@php
$previousUrl = $block->previousBlockUrl();
$nextUrl = $block->nextBlockUrl();
@endphp

<div {{ $attributes->class('px-3 sm:px-6 md:px-10 md:mx-auto md:max-w-7xl group last:mb-8 dark:text-theme-dark-200 mt-2') }}>
<div class="flex space-x-2 sm:justify-end">
<a
@if ($previousUrl !== null)
href="{{ $previousUrl }}"
@endif

@class([
'py-1.5 px-4 font-semibold flex-1 sm:flex-none',
'button-secondary' => $previousUrl !== null,
'button-generic bg-theme-secondary-200 text-theme-secondary-500 dark:bg-theme-secondary-800 dark:text-theme-secondary-700 select-none' => $previousUrl === null,
])
>
<div class="flex justify-center items-center space-x-2">
<x-ark-icon name="arrows.chevron-left-small" size="w-3 h-3" />

<div>
<span class="hidden sm:inline">Previous Block</span>
<span class="inline sm:hidden">Previous</span>
</div>
</div>
</a>

<a
@if ($nextUrl !== null)
href="{{ $nextUrl }}"
@endif

@class([
'py-1.5 px-4 font-semibold flex-1 sm:flex-none',
'button-secondary' => $nextUrl !== null,
'button-generic bg-theme-secondary-200 text-theme-secondary-500 dark:bg-theme-secondary-800 dark:text-theme-secondary-700 select-none' => $nextUrl === null,
])
>
<div class="flex justify-center items-center space-x-2">
<div>
<span class="hidden sm:inline">Next Block</span>
<span class="inline sm:hidden">Next</span>
</div>

<x-ark-icon name="arrows.chevron-right-small" size="w-3 h-3" />
</div>
</a>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<x-general.page-section.container
:title="trans('pages.block.transactions')"
wrapper-class="flex flex-col flex-1 whitespace-nowrap"
no-bottom-padding
no-border
>
<livewire:block-transactions-table :block="$block" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
@props(['model'])
@props([
'model',
'noBottomPadding' => false,
])

<x-general.page-section.container
:title="trans('general.confirmations_only')"
border-class="border-theme-success-200 dark:border-theme-success-500"
wrapper-container-class="py-2 mx-2 rounded-lg border sm:mx-0 bg-theme-success-100 dark:bg-theme-success-900"
:no-bottom-padding="$noBottomPadding"
>
<div class="flex items-center space-x-2 divide-x sm:space-x-3 divide-theme-success-200 dark:divide-theme-success-800">
<div class="flex items-center space-x-2 text-theme-success-700 dark:text-theme-success-500">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
'wrapperContainerClass' => null,
'wrapperClass' => 'flex flex-col flex-1 space-y-3 whitespace-nowrap',
'borderClass' => 'sm:border-theme-secondary-300 dark:border-theme-dark-700',
'noBottomPadding' => false,
])

<div {{ $attributes->class('px-3 sm:px-6 md:px-10 md:mx-auto md:max-w-7xl group last:mb-8 dark:text-theme-dark-200') }}>
<div {{ $attributes->class([
'px-3 sm:px-6 md:px-10 md:mx-auto md:max-w-7xl group dark:text-theme-dark-200',
'last:mb-8' => ! $noBottomPadding,
]) }}>
<div class="flex mt-6 sm:mt-0 sm:space-x-3 group-first:mt-0 group-first:sm:-mt-2">
<div class="hidden flex-col ml-3 sm:flex w-[1.625rem]">
<div class="hidden -mt-2 w-full border-l-2 sm:block group-first:sm:block border-theme-secondary-300 h-[9px] dark:border-theme-dark-700"></div>
Expand Down