-
Notifications
You must be signed in to change notification settings - Fork 62
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
Link variant #364
base: master
Are you sure you want to change the base?
Link variant #364
Conversation
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 good so far! I left a few questions and suggestions.
@@ -45,4 +45,5 @@ export interface FilledContentRelationshipField< | |||
isBroken?: boolean | |||
data?: DataInterface | |||
text?: string | |||
variant?: string |
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.
variant
on link fields, not content relationship and link to media fields.
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 wonder if we need to add the variant
property in src/types/value/link.ts
as an intersection. Something like this pseudo-code:
type LinkField = (WebLinkField | LinkToMediaField | ContentRelationshipField) & {
variant?: string
}
That keeps variant
out of link to media and content relationship fields.
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.
first message: i think what we want is to not add this option to the link to media or content relationship concrete fields, but you can still create a generic link without the select and then in page builder select one of the types
second message: i understood from a conversation with @xrutayisire the other day that one might want to use a concrete version of the field and it should already contain all properties, as they're all exported individually
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.
Honestly, at first glance, the proposal appears promising. I like it. I believed we always wanted to have the properties defined in their respective files. 🧐
@@ -25,4 +25,5 @@ export interface FilledLinkToMediaField { | |||
height?: string | null | |||
width?: string | null | |||
text?: string | |||
variant?: string |
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.
variant
on link fields, not content relationship and link to media fields.
Resolves:
Part of https://linear.app/prismic/issue/DT-2469/aauser-when-i-create-a-link-field-and-allow-variants-i-can-see-an.
Description
Checklist
Preview
How to QA 1
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩