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

feat: add galleries near you rail #10571

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

MounirDhahri
Copy link
Member

@MounirDhahri MounirDhahri commented Aug 7, 2024

This PR resolves ONYX-1244

Description

This PR adds a galleries near you rail to the home view.

Screen.Recording.2024-08-30.at.11.12.11.mov

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • add galleries near you rail - mounir

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@MounirDhahri MounirDhahri self-assigned this Aug 7, 2024
@MounirDhahri MounirDhahri force-pushed the feat/add-galleries-home-view-section branch from 8bed90d to 553da60 Compare August 30, 2024 09:10
@MounirDhahri MounirDhahri marked this pull request as ready for review August 30, 2024 10:22
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Aug 30, 2024

This PR contains the following changes:

  • Cross-platform user-facing changes (add galleries near you rail - mounir)

Generated by 🚫 dangerJS against 700aaee

@MounirDhahri MounirDhahri force-pushed the feat/add-galleries-home-view-section branch from fde9355 to 7b0ab52 Compare August 30, 2024 10:32
olerichter00
olerichter00 previously approved these changes Aug 30, 2024
Copy link
Contributor

@olerichter00 olerichter00 left a comment

Choose a reason for hiding this comment

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

✨ looks great! I would just remove the default view all href because I'd suggest to only define the copy and data in MP and not in the client.

@@ -117,6 +117,10 @@ const sectionsFragment = graphql`
internalID
...SalesRailHomeViewSection_section
}
... on GalleriesHomeViewSection {
internalID
Copy link
Contributor

Choose a reason for hiding this comment

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

Fan we move internalID outside the ... on to avoid duplication?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does the union upper level have an internalID available?

Copy link
Member Author

Choose a reason for hiding this comment

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

It wasn't possible 😢 I tried that, it's only defined in individual sections

variant={hasImage ? "outlineLight" : "fillDark"}
size="small"
onPress={() => {
const href = section.component?.behaviors?.viewAll?.href ?? "/galleries-for-you"
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about removing the default? Like this we would be able to add a section without view all link.

Copy link
Contributor

Choose a reason for hiding this comment

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

We could move the default to MP to make sure the href is always set if we need to.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, that makes sense. I can do that

araujobarret
araujobarret previously approved these changes Aug 30, 2024
describe("GalleriesHomeViewSection", () => {
const { renderWithRelay } = setupTestWrapper<GalleriesHomeViewSectionTestsQuery>({
Component: (props) => {
if (!props.homeView.section) {
Copy link
Contributor

Choose a reason for hiding this comment

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

consider adding the annotation to the graphql @required(action: NONE) so you don't need this extra check here 🌮

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks - I didn't consider that here

@MounirDhahri
Copy link
Member Author

@olerichter00 I am not sure what you mean by moving the data to MP - I assumed it's already there now

@MounirDhahri MounirDhahri force-pushed the feat/add-galleries-home-view-section branch from e03c92e to 53f96be Compare August 30, 2024 12:54
@olerichter00
Copy link
Contributor

@olerichter00 I am not sure what you mean by moving the data to MP - I assumed it's already there now

Sorry, this is a bit ambiguous. I was referring to this comment:#10571 (comment)

Comment on lines 70 to 83
<Flex mt={0.5} maxWidth={150}>
<Button
variant={hasImage ? "outlineLight" : "fillDark"}
size="small"
onPress={() => {
const href = section.component?.behaviors?.viewAll?.href
if (href) {
navigate(href)
}
}}
>
Explore
</Button>
</Flex>
Copy link
Contributor

@olerichter00 olerichter00 Aug 30, 2024

Choose a reason for hiding this comment

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

We should hide the button if we don't have a view all link 👻

Suggested change
<Flex mt={0.5} maxWidth={150}>
<Button
variant={hasImage ? "outlineLight" : "fillDark"}
size="small"
onPress={() => {
const href = section.component?.behaviors?.viewAll?.href
if (href) {
navigate(href)
}
}}
>
Explore
</Button>
</Flex>
{!!viewAllHref && <Flex mt={0.5} maxWidth={150}>
<Button
variant={hasImage ? "outlineLight" : "fillDark"}
size="small"
onPress={() => {
navigate(viewAllHref)
}}
>
Explore
</Button>
</Flex>

Copy link
Member Author

Choose a reason for hiding this comment

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

aha I got what you mean now

</Text>
</Flex>

<Flex mt={0.5} maxWidth={150}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove the max width? It's mostly problematic when setting absolute values, especially when screen sizes can vary.

Increased font sizes could potentially cause issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am copying the same exact styling from the existing element here without adjusting the styles.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh actually no- I added that later to make sure the text remains visible

Copy link
Contributor

Choose a reason for hiding this comment

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

True, it was already there. I'll leave it to you if you want to update it.

Copy link
Member Author

Choose a reason for hiding this comment

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

150 pixels was enough even in screens with huge fonts and up to 2 words

}
}}
>
Explore
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about moving the button copy to Metaphysics as well (e.g. section.component?.behaviors?.viewAll?.text)? Like this, we could modify it easily and even have different copies for different components.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, we already query for it here 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha I missed this - I already defined it in MP

olerichter00
olerichter00 previously approved these changes Aug 30, 2024
Copy link
Contributor

@olerichter00 olerichter00 left a comment

Choose a reason for hiding this comment

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

A few more comments 🐌

nickskalkin
nickskalkin previously approved these changes Aug 30, 2024
Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

Awesome! Found a typo 👇

const hasImage = !!section.component.backgroundImageURL
const textColor = hasImage ? "white100" : "black100"

const componenntHref = section.component?.href
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

@MounirDhahri MounirDhahri added the Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green label Aug 30, 2024
@MounirDhahri MounirDhahri force-pushed the feat/add-galleries-home-view-section branch from 170f000 to 700aaee Compare September 3, 2024 13:26
@artsy-peril artsy-peril bot merged commit 89f39e9 into main Sep 3, 2024
7 checks passed
@artsy-peril artsy-peril bot deleted the feat/add-galleries-home-view-section branch September 3, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Art Advisor Jira Synced Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants