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

Unify props of multiline / localized inputs #313

Closed
dferber90 opened this issue Dec 11, 2018 · 0 comments · Fixed by #389
Closed

Unify props of multiline / localized inputs #313

dferber90 opened this issue Dec 11, 2018 · 0 comments · Fixed by #389
Labels
💅 Type: Enhancement Improves existing code

Comments

@dferber90
Copy link
Contributor

Problem

At the moment we use a mix of props to basically explain the same two concerns, which adds unnecessary mental overhead when using our components.

The two properties we need to address

  • Our multiline components can either have multiline text expanded by default or not
  • Our localized components can either have all locales visible or not

At the moment we use the following props to express this:

Component  Property
MultilineTextInput isDefaultClosed
LocalizedTextInput isDefaultExpanded
LocalizedMultilineTextInput isMultilineDefaultExpanded areLanguagesDefaultOpened

Note that isDefaultClosed and isMultilineDefaultExpanded address the same concern. However they're worded differently and they even have opposite default states.

Similarily, isDefaultExpanded and areLanguagesDefaultOpened address the same concern. Their wording is completely different as well and they have opposite defaults too.

Solution

We can boil the four different prop names down to just two different prop names; one for each concept.

Component  Property
MultilineTextInput isMultilineDefaultExpanded
LocalizedTextInput areLanguagesDefaultOpened
LocalizedMultilineTextInput isMultilineDefaultExpanded areLanguagesDefaultOpened

I'm not too enthusiastic about these names and I'd welcome suggestions 👂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 Type: Enhancement Improves existing code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant