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

GROW 1362 - Add hub entry points to collect page #2698

Merged

Conversation

pepopowitz
Copy link
Contributor

@pepopowitz pepopowitz commented Aug 15, 2019

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.

auto-scaled-hubs

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

  • The hub is currently displaying regular marketingCollections from metaphysics instead of marketingHubCollections, because there is no data in the marketingHubCollections. Once we get that data populated, we will need to follow up here.
  • I've verified the auto-scaling solution in Chrome, Firefox, and Safari. I have yet to verify in Edge, but will once we (eventually) get a deploy preview.

@artsy-peril artsy-peril bot added Jira Synced Version: Patch Indicates that this PR should have a patch deploy, usually for bug fixes labels Aug 15, 2019
@pepopowitz pepopowitz force-pushed the GROW-1362-collect-page-hub-entry-points branch 2 times, most recently from 2ce78da to dd740be Compare August 19, 2019 16:09
@pepopowitz pepopowitz changed the title WIP - GROW 1362 - Add hub entry points to collect page GROW 1362 - Add hub entry points to collect page Aug 19, 2019
anandaroop and others added 15 commits August 19, 2019 12:15
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)
@pepopowitz pepopowitz force-pushed the GROW-1362-collect-page-hub-entry-points branch from dd740be to cf5e658 Compare August 19, 2019 17:16
// lg/xl: 168x105 = 1.6 aspect ratio
export const CollectionsHubsNav: FC<CollectionsHubsNavProps> = props => {
return (
<CSSGrid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked really nicely 👍

Copy link
Member

@anandaroop anandaroop left a 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...

src/Components/v2/AutoScalingImageLink.tsx Outdated Show resolved Hide resolved
Co-authored-by: Anandaroop <anandaroop.roy+github@gmail.com>
@pepopowitz pepopowitz changed the title GROW 1362 - Add hub entry points to collect page [DO NOT MERGE] GROW 1362 - Add hub entry points to collect page Aug 19, 2019
anandaroop and others added 2 commits August 20, 2019 08:10
Signed-off-by: Steve Hicks <steven.j.hicks@gmail.com>
@pepopowitz pepopowitz changed the title [DO NOT MERGE] GROW 1362 - Add hub entry points to collect page GROW 1362 - Add hub entry points to collect page Aug 20, 2019
@pepopowitz pepopowitz merged commit 4c63aa3 into artsy:master Aug 20, 2019
@pepopowitz pepopowitz deleted the GROW-1362-collect-page-hub-entry-points branch August 20, 2019 15:36
@artsyit
Copy link
Contributor

artsyit commented Aug 20, 2019

🚀 PR was released in v17.2.2 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Synced released Version: Patch Indicates that this PR should have a patch deploy, usually for bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants