We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We don't have to use libraries.source.parse and libraries.source.stringify for next and previous page anymore, so we can simplify this code: https://github.com/chakra-ui/frontity-chakra-ui-theme/blob/master/packages/frontity-chakra-theme/src/components/archive/pagination.js#L63-L78
libraries.source.parse
libraries.source.stringify
const { totalPages } = state.source.get(state.router.link); const { path, page, query } = libraries.source.parse(state.router.link); const isThereNextPage = page > 1; const isTherePreviousPage = page < totalPages; const nextPageLink = libraries.source.stringify({ path, page: page + 1, query, }); const prevPageLink = libraries.source.stringify({ path, page: page - 1, query, });
And just use the next and previous we get from data:
next
previous
const { totalPages, route, page, next, previous } = state.source.get( state.router.link );
Please note that path has been renamed and is now route.
path
route
Docs: https://docs.frontity.org/api-reference-1/wordpress-source#state
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We don't have to use
libraries.source.parse
andlibraries.source.stringify
for next and previous page anymore, so we can simplify this code: https://github.com/chakra-ui/frontity-chakra-ui-theme/blob/master/packages/frontity-chakra-theme/src/components/archive/pagination.js#L63-L78And just use the
next
andprevious
we get from data:Please note that
path
has been renamed and is nowroute
.Docs: https://docs.frontity.org/api-reference-1/wordpress-source#state
The text was updated successfully, but these errors were encountered: