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

Hide next/prev block buttons on mobile lists and search results #1219

Merged
merged 1 commit into from
Feb 1, 2024
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
1 change: 1 addition & 0 deletions .changelog/1219.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide next/prev block buttons on mobile lists
13 changes: 9 additions & 4 deletions src/app/pages/BlockDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const BlockDetailPage: FC = () => {
return (
<PageLayout>
<SubPageCard featured title={t('common.block')}>
<BlockDetailView isLoading={isLoading} block={block} />
<BlockDetailView enableBlockNavigation isLoading={isLoading} block={block} />
</SubPageCard>
{!!block?.num_transactions && <TransactionsCard scope={scope} blockHeight={blockHeight} />}
<EventsCard scope={scope} blockHeight={blockHeight} />
Expand All @@ -59,7 +59,8 @@ export const BlockDetailView: FC<{
block: BlockDetailRuntimeBlock | undefined
showLayer?: boolean
standalone?: boolean
}> = ({ isLoading, block, showLayer, standalone = false }) => {
enableBlockNavigation?: boolean
}> = ({ enableBlockNavigation, isLoading, block, showLayer, standalone = false }) => {
const { t } = useTranslation()
const { isMobile } = useScreenSize()
const formattedTime = useFormattedTimestampStringWithDistance(block?.timestamp)
Expand Down Expand Up @@ -89,8 +90,12 @@ export const BlockDetailView: FC<{
<dd>
<BlockLink scope={block} height={block.round} />
<CopyToClipboard value={block.round.toString()} />
<PrevBlockButton scope={block} currentRound={block.round} />
<NextBlockButton scope={block} currentRound={block.round} />
{enableBlockNavigation && (
<>
<PrevBlockButton scope={block} currentRound={block.round} />
<NextBlockButton scope={block} currentRound={block.round} />
</>
)}
</dd>

<dt>{t('common.hash')}</dt>
Expand Down
Loading