mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Add prop to hide pagination dividers
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
import { Pagination as MantinePagination, PaginationProps } from '@mantine/core';
|
import {
|
||||||
|
Pagination as MantinePagination,
|
||||||
|
PaginationProps as MantinePaginationProps,
|
||||||
|
} from '@mantine/core';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const StyledPagination = styled(MantinePagination)`
|
const StyledPagination = styled(MantinePagination)<PaginationProps>`
|
||||||
& .mantine-Pagination-item {
|
& .mantine-Pagination-item {
|
||||||
color: var(--btn-default-fg);
|
color: var(--btn-default-fg);
|
||||||
background-color: var(--btn-default-bg);
|
background-color: var(--btn-default-bg);
|
||||||
@@ -24,14 +27,20 @@ const StyledPagination = styled(MantinePagination)`
|
|||||||
}
|
}
|
||||||
|
|
||||||
&[data-dots] {
|
&[data-dots] {
|
||||||
|
display: ${({ $hideDividers }) => ($hideDividers ? 'none' : 'block')};
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const Pagination = ({ ...props }: PaginationProps) => {
|
interface PaginationProps extends MantinePaginationProps {
|
||||||
|
$hideDividers?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Pagination = ({ $hideDividers, ...props }: PaginationProps) => {
|
||||||
return (
|
return (
|
||||||
<StyledPagination
|
<StyledPagination
|
||||||
|
$hideDividers={$hideDividers}
|
||||||
radius="xl"
|
radius="xl"
|
||||||
size="md"
|
size="md"
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in New Issue
Block a user