-
Notifications
You must be signed in to change notification settings - Fork 572
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
Conversation
8bed90d
to
553da60
Compare
fde9355
to
7b0ab52
Compare
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.
✨ 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 |
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.
Fan we move internalID outside the ... on to avoid duplication?
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.
Does the union upper level have an internalID
available?
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.
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" |
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.
What do you think about removing the default? Like this we would be able to add a section without view all link.
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.
We could move the default to MP to make sure the href is always set if we need to.
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.
yes, that makes sense. I can do that
describe("GalleriesHomeViewSection", () => { | ||
const { renderWithRelay } = setupTestWrapper<GalleriesHomeViewSectionTestsQuery>({ | ||
Component: (props) => { | ||
if (!props.homeView.section) { |
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.
consider adding the annotation to the graphql @required(action: NONE)
so you don't need this extra check here 🌮
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.
thanks - I didn't consider that here
e03c92e
@olerichter00 I am not sure what you mean by moving the data to MP - I assumed it's already there now |
e03c92e
to
53f96be
Compare
Sorry, this is a bit ambiguous. I was referring to this comment:#10571 (comment) |
<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> |
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.
We should hide the button if we don't have a view all link 👻
<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> |
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.
aha I got what you mean now
</Text> | ||
</Flex> | ||
|
||
<Flex mt={0.5} maxWidth={150}> |
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.
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.
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.
I am copying the same exact styling from the existing element here without adjusting the styles.
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.
oh actually no- I added that later to make sure the text remains visible
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.
True, it was already there. I'll leave it to you if you want to update it.
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.
150 pixels was enough even in screens with huge fonts and up to 2 words
} | ||
}} | ||
> | ||
Explore |
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.
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.
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.
Ah, we already query for it here 👀
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.
Aha I missed this - I already defined it in MP
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.
A few more comments 🐌
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.
Awesome! Found a typo 👇
const hasImage = !!section.component.backgroundImageURL | ||
const textColor = hasImage ? "white100" : "black100" | ||
|
||
const componenntHref = section.component?.href |
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.
typo
170f000
to
700aaee
Compare
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
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
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.