artsy / emission

⚠️ Deprecated repo, moved to artsy/eigen ➡️ React Native Components
http://artsy.github.io/blog/2018/04/17/making-a-components-pod/
MIT License
618 stars 78 forks source link

Pass screen width in a variable to relay resize artworks query #2033

Closed ashleyjelks closed 4 years ago

ashleyjelks commented 4 years ago

Follow up to #2032.

Instead of resizing the artworks images based on a static width of 500 px, this PR adds a variable to the Featured Artists Collections relay query to resize images based on the screen width.

ashleyjelks commented 4 years ago

Very cool! This is just what I had in mind.

One thing that would make this really great is a unit test. Here is an example of how you can mock things in the react-native module (like Dimensions in this case) and here is an example of how to test that a query variable is passed through. I wouldn't say that the unit test is necessary before merging, since the code isn't too complex, but the latter is an example of using Relay's new Test Utils, which we're trying to standardize on, so it could be useful as practice.

I think this is a great idea! I'll make a ticket to track the work.

artsyit commented 4 years ago

:rocket: PR was released in v1.21.7 :rocket: