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 props labels and withAdditionalProps to DefaultLinkToolRender #321

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gloaysa
Copy link

@gloaysa gloaysa commented Sep 28, 2024

Description

I'm adding two new props to DefaultLinkToolRender:

  • labels: An object of type LinkToolTranslationProps that allows overwriting the default, hardcoded values of text displayed in the UI.
  • withAdditionalProps, defaults to true. Allows hiding the additional options button.

Fixes # (issue)
relates to: #273

Type of change

Please tick the relevant option.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

Copy link

vercel bot commented Sep 28, 2024

@gloaysa is attempting to deploy a commit to the dargo's projects Team on Vercel.

A member of the Team first needs to authorize it.

@gloaysa
Copy link
Author

gloaysa commented Sep 28, 2024

This is a first approach to the idea I discussed on the channel. Besides the labels part, I added a new prop to hide the additionalProps feature. That probably should go into another PR, let me know if it's ok.

I also added partial documentation into the README of the package. I don't know if that's expected since I noticed most of them have them empty (I personally is the first place I went looking for info on how to use them).

I'm using a new property name: 'labels' instead of 'display' (which is what I've seen most often through the project). The reason behind it is:

  • The way I understand it, the properties withLink and withTitle should go into the display props, since it affects what is being displayed.
  • Having a dedicated prop for labels, even tho it will need to change the api for the rest of components that puts the labels inside display, allows for a better separation of concerns.

Down the road, in my humble opinion and knowing I just arrived to this project, so take me with a grain of salt, we could deprecate the withLink and withTitle props, add them inside a display property and let them live together for a while (to not make a breaking-change without allowing other users to update).

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant