M: Improve hover effects on pagination
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
Frontend CI / notify-failure (push) Blocked by required conditions

This commit is contained in:
Ivan 2025-06-18 00:25:04 +03:00
parent 78efdb8743
commit e75ac119e0
2 changed files with 13 additions and 5 deletions

View File

@ -20,6 +20,8 @@ export function PaginationTools<TData>({
onChangePaginationOption, onChangePaginationOption,
paginationOptions paginationOptions
}: PaginationToolsProps<TData>) { }: PaginationToolsProps<TData>) {
const buttonClass =
'cc-hover-text cc-controls cc-animate-color focus-outline rounded-md not-[:disabled]:cursor-pointer';
return ( return (
<div className='flex justify-end items-center my-2 text-sm cc-controls select-none'> <div className='flex justify-end items-center my-2 text-sm cc-controls select-none'>
<span className='mr-3'> <span className='mr-3'>
@ -36,7 +38,7 @@ export function PaginationTools<TData>({
<button <button
type='button' type='button'
aria-label='Первая страница' aria-label='Первая страница'
className='cc-hover-bg cc-controls cc-animate-color focus-outline' className={buttonClass}
onClick={() => table.setPageIndex(0)} onClick={() => table.setPageIndex(0)}
disabled={!table.getCanPreviousPage()} disabled={!table.getCanPreviousPage()}
> >
@ -45,7 +47,7 @@ export function PaginationTools<TData>({
<button <button
type='button' type='button'
aria-label='Предыдущая страница' aria-label='Предыдущая страница'
className='cc-hover-bg cc-controls cc-animate-color focus-outline' className={buttonClass}
onClick={() => table.previousPage()} onClick={() => table.previousPage()}
disabled={!table.getCanPreviousPage()} disabled={!table.getCanPreviousPage()}
> >
@ -67,7 +69,7 @@ export function PaginationTools<TData>({
<button <button
type='button' type='button'
aria-label='Следующая страница' aria-label='Следующая страница'
className='cc-hover-bg cc-controls cc-animate-color focus-outline' className={buttonClass}
onClick={() => table.nextPage()} onClick={() => table.nextPage()}
disabled={!table.getCanNextPage()} disabled={!table.getCanNextPage()}
> >
@ -76,7 +78,7 @@ export function PaginationTools<TData>({
<button <button
type='button' type='button'
aria-label='Последняя страница' aria-label='Последняя страница'
className='cc-hover-bg cc-controls cc-animate-color focus-outline' className={buttonClass}
onClick={() => table.setPageIndex(table.getPageCount() - 1)} onClick={() => table.setPageIndex(table.getPageCount() - 1)}
disabled={!table.getCanNextPage()} disabled={!table.getCanNextPage()}
> >

View File

@ -3,6 +3,7 @@
import { useCallback } from 'react'; import { useCallback } from 'react';
import { type Table } from '@tanstack/react-table'; import { type Table } from '@tanstack/react-table';
import clsx from 'clsx';
import { prefixes } from '@/utils/constants'; import { prefixes } from '@/utils/constants';
@ -30,7 +31,12 @@ export function SelectPagination<TData>({ id, table, paginationOptions, onChange
<SelectTrigger <SelectTrigger
id={id} id={id}
aria-label='Выбор количества строчек на странице' aria-label='Выбор количества строчек на странице'
className='mx-2 cursor-pointer bg-transparent focus-outline border-0 w-28 max-h-6 px-2 justify-end' className={clsx(
'w-28 max-h-6 mx-2',
'px-2 justify-end',
'bg-transparent cc-hover-text cc-animate-color focus-outline border-0 rounded-md',
'cursor-pointer'
)}
> >
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>