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
GROW 1362 - Add hub entry points to collect page #2698
GROW 1362 - Add hub entry points to collect page #2698
Conversation
2ce78da
to
dd740be
Compare
Signed-off-by: Steve Hicks <steven.j.hicks@gmail.com>
Signed-off-by: Steve Hicks <steven.j.hicks@gmail.com>
We are trying to insert the new `CollectionsHubsNav` component into `CollectApp`. `CollectionsHubsNav` needs its own `marketingHubCollections` prop, which we've tried adding to the locally created fragment container. Something's not right though, as the relay compiler keeps erroring with: ``` GraphQLParser: Unknown field `marketingHubCollections` on type `Viewer`. Source: document `CollectApp_viewer` file: `Apps/Collect/CollectApp.tsx`. ``` Signed-off-by: Steve Hicks <steven.j.hicks@gmail.com>
…NG data - marketingCollections instead of marketingHubCollections)
…ragments in all the right places
…s when user has access to it.
…-scale based on available width
…N_HUBS from SystemContext (used when server rendering)
…r; avoid implicit return.
dd740be
to
cf5e658
Compare
// lg/xl: 168x105 = 1.6 aspect ratio | ||
export const CollectionsHubsNav: FC<CollectionsHubsNavProps> = props => { | ||
return ( | ||
<CSSGrid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked really nicely 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🎉
I only saw one v minor naming thing, otherwise LGTM. Gotta go read up on css grids now...
Co-authored-by: Anandaroop <anandaroop.roy+github@gmail.com>
Signed-off-by: Steve Hicks <steven.j.hicks@gmail.com>
Update stories to work with RouterLink
🚀 PR was released in v17.2.2 🚀 |
In collaboration with @anandaroop. This PR addresses https://artsyproduct.atlassian.net/browse/GROW-1362. It adds a collection hubs rail to the Collect page, if the user is an admin.
From a design perspective, we want the tiles to be as large as possible to fill the width with 2 items per row at xs, 3 items per row at sm, and 6 items per row at md & above. You can see this effect below. Note that only one cell has a background image right now - it's the only one with a thumbnail defined.
The CSS to auto-scale the hub tiles & background images based on the available width is a bit tricky. We use CSS grid to lay out the rail, and for each tile, we render an image of specific size but hide it. This gives the container a certain width and height. The tile also includes a background image, which fills the entire space created by the hidden image.
Notes
marketingCollections
from metaphysics instead ofmarketingHubCollections
, because there is no data in themarketingHubCollections
. Once we get that data populated, we will need to follow up here.