Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task
I fetched the user's data, implemented a load more button, and a sorting selection, and added a loading state.
How
![Screenshot 2025-01-18 103324](https://private-user-images.githubusercontent.com/110201584/404555523-b395ea8b-aa7b-4adb-b5c0-fed3abfc5ec6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MjkwMjMsIm5iZiI6MTczOTcyODcyMywicGF0aCI6Ii8xMTAyMDE1ODQvNDA0NTU1NTIzLWIzOTVlYThiLWFhN2ItNGFkYi1iNWMwLWZlZDNhYmZjNWVjNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQxNzU4NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZGMzZTNhOTc0YjU2NjRhMzM4ZmQ4MWFhNzJmMWQ0YTAxOGE3MWM5ZWQ0MmViMGQ3NTM5ZWNmOWE1YjVhYmFlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.tW6d8EggeAXMX8zSp9O5i8ae5g9Q61YGctRqEGY6fJo)
I used Axois to fetch the user's data. I created a useState that loads the first eight items in the array, and then I created a function that displays four items on the page when a user clicks the button. For the sorting selection, I created a function that sorts high prices to low prices, and low prices to high prices, then most likes to less likes. After I implemented a loading state.