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

Separate Decorator into multiple components #4476

Closed
Tracked by #4611
elycheea opened this issue Mar 6, 2024 · 0 comments · Fixed by #4542
Closed
Tracked by #4611

Separate Decorator into multiple components #4476

elycheea opened this issue Mar 6, 2024 · 0 comments · Fixed by #4542
Assignees
Labels
area: migration ➡️ Migration of Security package to IBM Products

Comments

@elycheea
Copy link
Contributor

elycheea commented Mar 6, 2024

Issue

Technically, the Decorator is a small component (one icon, one label, and one value), but can behave differently depending on the variation chosen (non-interactive, link, single and dual buttons).

As a single component, this requires a lot of if/else statements in code, one very long SCSS file, and some props that are not applicable depending on which variant is chosen. To make sense of this, a lot of supplementary documentation must be written to explain how it all works. This is complicated to implement and doesn't scale well.

Solution

It's been decided to break down the Decorator into smaller, more focused components. This means code, props, and documentation can be written exclusively for each component and its function.

Components

  • DecoratorBase (internal, serves as a common code base for all the other Decorators)
  • Decorator (non-interactive)
  • DecoratorLink (as a single link)
  • DecoratorSingleButton (as a single button)
  • DecoratorDualButton (where the label and value each behave as button)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: migration ➡️ Migration of Security package to IBM Products
Projects
Archived in project
2 participants