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

fix: covering pagination buttons into 'a' tag #23

Merged
merged 9 commits into from
Apr 5, 2023

Conversation

VitaliiDC8
Copy link
Contributor

No description provided.

@VitaliiDC8 VitaliiDC8 requested a review from NikitaCG as a code owner April 3, 2023 10:32
@gravity-ui-bot
Copy link
Contributor

Preview is ready.

className={b('item', mods)}
onClick={() => onClick?.(itemKey)}
loading={loading && Boolean(mods.active)}
<a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using an tag this way will reload an app every time we click on a paginator button. We need to be able eigther configure an tag we use or develop a way to prevent reloading

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it cannot be like this. we use event.preventDefault() on click an tag. App should be not reloaded

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Issue resolved

@NikitaCG
Copy link
Collaborator

NikitaCG commented Apr 3, 2023

you need to rebase from main, because your branch have old dependencies, for example https://github.com/gravity-ui/blog-constructor/blob/fix/cover_pagination_into_a_tag/package.json#L82

@VitaliiDC8 VitaliiDC8 requested a review from niktverd April 3, 2023 11:28
@@ -33,6 +35,9 @@ export const Paginator = ({
getPagesCount({itemsPerPage, totalItems, maxPages}),
);

const {locale} = useContext(LocaleContext);
const blogPath = getBlogPath(locale?.pathPrefix || '');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the logic of creating an url is divided into two components. Maybe we should put this code in the Pagination Item ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will do it

@VitaliiDC8 VitaliiDC8 requested a review from NikitaCG April 4, 2023 16:07
@VitaliiDC8 VitaliiDC8 merged commit e603f2e into main Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants