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

Prettier pagination #213

Merged
merged 5 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion public/assets/icons/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/assets/icons/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/common/PaginationControls/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LeftArrowIcon from '@/public/assets/icons/page-left-icon.svg';
import RightArrowIcon from '@/public/assets/icons/page-right-icon.svg';
import LeftArrowIcon from '@/public/assets/icons/arrow-left.svg';
import RightArrowIcon from '@/public/assets/icons/arrow-right.svg';
import { useEffect, useState } from 'react';
import style from './style.module.scss';

Expand Down Expand Up @@ -54,7 +54,7 @@ const PaginationControls = ({ page, onPage, pages }: PaginationControlsProps) =>
}
}}
/>
<span>of</span>
<span>/</span>
<span className={style.pageNumber}>{pages}</span>
</div>
<button
Expand Down
21 changes: 15 additions & 6 deletions src/components/common/PaginationControls/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,40 @@
justify-content: center;

.paginationBtn {
SheepTester marked this conversation as resolved.
Show resolved Hide resolved
background: none;
background: var(--theme-elevated-background);
border: 1px solid var(--theme-elevated-stroke);
border-radius: 50%;
color: var(--theme-primary-2);
font-size: 0;
padding: 0;

&:disabled {
color: var(--theme-elevated-stroke);
cursor: auto;
opacity: 0.5;
}
}

.paginationText {
align-items: center;
background-color: var(--theme-elevated-background);
border: 1px solid var(--theme-elevated-stroke);
border-radius: 1rem;
display: flex;
font-weight: bold;
gap: 1em;
gap: 0.5rem;
padding: 0.375rem 1rem;

.pageNumber {
text-align: center;
width: 24px;

&:is(input) {
border: 1px solid var(--theme-text-on-background-1);
border-radius: 2px;
color: inherit;
background-color: inherit;
border-bottom: 1.5px solid var(--theme-text-on-background-1);
color: var(--theme-text-on-background-1);
font: inherit;
height: 24px;
margin-bottom: -1.5px;
text-align: center;
}
}
Expand Down
Loading