File tree Expand file tree Collapse file tree 3 files changed +6
-23
lines changed Expand file tree Collapse file tree 3 files changed +6
-23
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import React , { useState } from 'react'
1+ import React from 'react'
22import type { Meta , StoryFn } from '@storybook/react'
33import type { ComponentProps } from '../utils/types'
44import Pagination from './Pagination'
@@ -26,21 +26,9 @@ const parseShowPagesArg = (value: boolean | string) => {
2626 }
2727}
2828
29- export const Default = ( ) => {
30- const [ page , setPage ] = useState ( 2 )
31-
32- return (
33- < Pagination
34- pageCount = { 15 }
35- currentPage = { page }
36- onPageChange = { ( e , n ) => {
37- e . preventDefault ( )
38- setPage ( n )
39- } }
40- showPages = { { narrow : false } }
41- />
42- )
43- }
29+ export const Default = ( ) => (
30+ < Pagination pageCount = { 15 } currentPage = { 2 } onPageChange = { e => e . preventDefault ( ) } showPages = { { narrow : false } } />
31+ )
4432
4533export const Playground : StoryFn < ComponentProps < typeof Pagination > > = ( { showPages, ...args } ) => {
4634 return (
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export function buildComponentData(
148148 key = 'page-prev'
149149 content = 'Previous'
150150 if ( page . disabled ) {
151- Object . assign ( props , { 'aria-hidden ' : 'true' } )
151+ Object . assign ( props , { 'aria-disabled ' : 'true' , role : 'link '} )
152152 } else {
153153 Object . assign ( props , {
154154 rel : 'prev' ,
@@ -163,7 +163,7 @@ export function buildComponentData(
163163 key = 'page-next'
164164 content = 'Next'
165165 if ( page . disabled ) {
166- Object . assign ( props , { 'aria-hidden ' : 'true' } )
166+ Object . assign ( props , { 'aria-disabled ' : 'true' , role : 'link '} )
167167 } else {
168168 Object . assign ( props , {
169169 rel : 'next' ,
You can’t perform that action at this time.
0 commit comments