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

Feature: randomize collection on page load #19

Open
almndbtr opened this issue Sep 3, 2022 · 1 comment · May be fixed by #20
Open

Feature: randomize collection on page load #19

almndbtr opened this issue Sep 3, 2022 · 1 comment · May be fixed by #20

Comments

@almndbtr
Copy link
Contributor

almndbtr commented Sep 3, 2022

Summary

From @0xTranqui:

add in randomization of collection order upon page load (right now being shown in reverse chronological order -- most recently added to oldest added)

@almndbtr
Copy link
Contributor Author

almndbtr commented Sep 3, 2022

Each of the edition cards are rendered in this part of the index page:

https://github.com/0xTranqui/present-materials/blob/f546c915c4c0747e49bbdf5c6995b610e3b7666e/pages/index.tsx#L67-L69

The collection data is fetched earlier on in the component, and reversed:

https://github.com/0xTranqui/present-materials/blob/f546c915c4c0747e49bbdf5c6995b610e3b7666e/pages/index.tsx#L26-L27

Using a package like lodash.shuffle to shuffle the collection data after it's retrieved could do the trick.

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 a pull request may close this issue.

1 participant