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

Collections: CollectionCard #36

Open
1 task
Austin2Shih opened this issue Feb 22, 2024 · 0 comments
Open
1 task

Collections: CollectionCard #36

Austin2Shih opened this issue Feb 22, 2024 · 0 comments

Comments

@Austin2Shih
Copy link
Contributor

Austin2Shih commented Feb 22, 2024

  • Create the CollectionCard component
  • Create in /(pages)/content/[collection]/_components/CollectionCard/CollectionCard.tsx
  • Create the scss module in the same folder
  • example use case:
<CollectionCard data={some json object passed in}/>
  • Allocate space for the MediaPreview component which will fill in the images for you. All you have to do for the images is call the MediaPreview component with the image data at data.media_list.
  • The cards have to be the same size but that does not necessarily mean you should hardcode the sizes. I would recommend setting the width to something hardcoded as a global variable in _globals/styles/variables and letting the content define the height.
  • Truncate any text that is too long so it doesn't line wrap and make cards different heights.
  • To figure out how much height to allocate to the MediaPreview, use aspect-ratio to anchor the height to the width of the container. In your case the aspect ratio of the MediaPreview will be whatever 350/230 is.
  • For now, just add the options button on the top right of the card and have it do nothing.

Image

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

No branches or pull requests

1 participant