Skip to content

Commit d8ed4d4

Browse files
authored
fix: fix table example: (#18)
- fix button styling - fix source code url
1 parent 3a6b27c commit d8ed4d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk-explorer/src/document-collections/DocumentTable/DocumentTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function DocumentTable() {
8282
return (
8383
<ExampleLayout
8484
title='Document table'
85-
codeUrl='https://github.com/sanity-io/sdk-examples/blob/main/sdk-explorer/src/document-collections/PreviewGrid/PreviewGrid.tsx'
85+
codeUrl='https://github.com/sanity-io/sdk-examples/blob/main/sdk-explorer/src/document-collections/DocumentTable/DocumentTable.tsx'
8686
hooks={['usePaginatedList', 'useProjection']}
8787
styling='Tailwind'
8888
>
@@ -106,7 +106,7 @@ export default function DocumentTable() {
106106
{/* Table navigation */}
107107
<nav className='flex justify-between items-center my-8'>
108108
<button
109-
className='rounded-sm px-4 py-2 bg-blue-500 text-white font-medium hover:bg-blue-700 transition'
109+
className={`rounded-sm px-4 py-2 bg-blue-500 text-white font-medium transition ${!hasPreviousPage ? 'opacity-50 cursor-not-allowed' : 'hover:bg-blue-700'}`}
110110
onClick={previousPage}
111111
disabled={!hasPreviousPage}
112112
>
@@ -116,7 +116,7 @@ export default function DocumentTable() {
116116
Page {currentPage}/{totalPages}
117117
</div>
118118
<button
119-
className='rounded-sm px-4 py-2 bg-blue-500 text-white font-medium hover:bg-blue-700 transition'
119+
className={`rounded-sm px-4 py-2 bg-blue-500 text-white font-medium transition ${!hasNextPage ? 'opacity-50 cursor-not-allowed' : 'hover:bg-blue-700'}`}
120120
onClick={nextPage}
121121
disabled={!hasNextPage}
122122
>

0 commit comments

Comments
 (0)