Skip to content

Commit

Permalink
chore: bump to v0.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaveWPM committed Apr 23, 2024
1 parent f789b3a commit a2f2418
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rtm-dashboard",
"version": "0.8.7",
"version": "0.8.8",
"author": "gustaveWPM (github.com/gustaveWPM)",
"contributors": [
"Tirraa (github.com/Tirraa)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('buildTopLeftWidgets', () => {
describe('buildTopRightWidgets', () => {
const __filtersAssoc: FiltersAssoc = [
{
// eslint-disable-next-line no-magic-numbers,no-unused-vars
// eslint-disable-next-line no-magic-numbers, @typescript-eslint/no-unused-vars
score: (post1: BlogPostPreviewComponentWithMetadatas, post2: BlogPostPreviewComponentWithMetadatas) => 0,
// @ts-ignore
i18nTitle: ''
Expand Down
40 changes: 20 additions & 20 deletions src/components/ui/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,6 @@ const PaginationEllipsis = ({
</button>
</DropdownMenuTrigger>
<DropdownMenuContent
onAnimationEnd={() => {
if (!isOpened) return;
const dropdownContentInstance = getRefCurrentPtr(dropdownContentRef);
if (!dropdownContentInstance) return;

const SCROLL_OFFSET_Y: PxValue = 4;

let activePageNodeIndex = 0;
const links = dropdownContentInstance.querySelectorAll('a');
for (let i = 0; i < links.length; i++) {
if (links[i].getAttribute('aria-current') === 'page') break;
activePageNodeIndex++;
}

let scrollDist = 0;
for (let i = 0; i < activePageNodeIndex; i++) scrollDist += links[i].getBoundingClientRect().height;
// eslint-disable-next-line no-magic-numbers
if (activePageNodeIndex !== 0) scrollDist += SCROLL_OFFSET_Y;
dropdownContentInstance.scrollTo({ behavior: 'smooth', top: scrollDist });
}}
onClick={(event) => {
if (isBottomWidget) setIsOpened(false);
if (!(event.target instanceof HTMLAnchorElement)) return;
Expand All @@ -151,6 +131,26 @@ const PaginationEllipsis = ({
for (let i = 0; i < newActivePageNodeIndex; i++) scrollDist += links[i].getBoundingClientRect().height;
dropdownContentInstance.scrollTo({ top: scrollDist - SCROLL_OFFSET_Y, behavior: 'smooth' });
}}
onAnimationEnd={() => {
if (!isOpened) return;
const dropdownContentInstance = getRefCurrentPtr(dropdownContentRef);
if (!dropdownContentInstance) return;

const SCROLL_OFFSET_Y: PxValue = 4;

let activePageNodeIndex = 0;
const links = dropdownContentInstance.querySelectorAll('a');
for (let i = 0; i < links.length; i++) {
if (links[i].getAttribute('aria-current') === 'page') break;
activePageNodeIndex++;
}

let scrollDist = 0;
for (let i = 0; i < activePageNodeIndex; i++) scrollDist += links[i].getBoundingClientRect().height;
// eslint-disable-next-line no-magic-numbers
if (activePageNodeIndex !== 0) scrollDist += SCROLL_OFFSET_Y;
dropdownContentInstance.scrollTo({ behavior: 'smooth', top: scrollDist });
}}
className={cn('max-h-[228px] w-fit overflow-y-auto', {
'max-h-[210px] overflow-y-auto': pageNumberIndicator
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const fakeTagsIndexes = [0, 1, 2, 3];

const __filtersAssoc: FiltersAssoc = [
{
// eslint-disable-next-line no-magic-numbers,no-unused-vars
// eslint-disable-next-line no-magic-numbers, @typescript-eslint/no-unused-vars
score: (post1: BlogPostPreviewComponentWithMetadatas, post2: BlogPostPreviewComponentWithMetadatas) => 0,
// @ts-ignore
i18nTitle: ''
},
{
// eslint-disable-next-line no-magic-numbers,no-unused-vars
// eslint-disable-next-line no-magic-numbers, @typescript-eslint/no-unused-vars
score: (post1: BlogPostPreviewComponentWithMetadatas, post2: BlogPostPreviewComponentWithMetadatas) =>
compareDesc(new Date(post1.date), new Date(post2.date)),
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('getPaginatedElementsCurrentSlice', () => {
const pagesAmount = 10;
const totalPages = pageSize * pagesAmount;

// eslint-disable-next-line no-magic-numbers, no-unused-vars
// eslint-disable-next-line no-magic-numbers, @typescript-eslint/no-unused-vars
const elements = Array.from({ length: totalPages }, (_, i) => createElement('div', { key: i }, `ReactElement ${i + 1}`));

it('should return the correct slice for the first page', () => {
Expand Down

0 comments on commit a2f2418

Please sign in to comment.