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(components/molecule/collapsible): Custom toggle button and butto… #2466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hpintos
Copy link
Contributor

@hpintos hpintos commented Nov 16, 2022

…n alignment

Category/Component

🔍 Show

TASK:

Types of changes

  • ✨ New feature (non-breaking change which adds functionality)

Description, Motivation and Context

We add two new features for this component:

  • Custom button to toggle collapse
  • Toggle button alignment

This solves some UX requests made

Screenshots - Animations

Screenshot 2022-11-16 at 12 39 37

@github-actions
Copy link

STATEMENTS BRANCHES FUNCTIONS LINES
≍ 0= ≍ 0.05↓ ≍ 0= ≍ 0=
% 73.05 59.23 60.94 74.82
ABS 2850 / 3901 1633 / 2757 529 / 868 2744 / 3667

icon,
showText,
hideText,
toggleButton: ToggleButton,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prefer element over elementType

/**
* Custom toggle button
*/
toggleButton: PropTypes.node,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are using it as a elementType, not a node

Comment on lines +90 to +99
<button
type="button"
className={BUTTON_CLASS}
onClick={toggleCollapse}
>
<span className={BUTTON_CONTENT_CLASS} tabIndex="-1">
{collapsed ? showText : hideText}
<span className={iconClassName}>{icon}</span>
</span>
</button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part whould be componentized on a different file. Call it CollapseToogleButton.

Copy link
Member

@andresin87 andresin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets schedule a pair programming session.

@andresin87 andresin87 force-pushed the feat/custom-toggle-btn-and-alignment branch from ea080b0 to 720268a Compare November 28, 2022 14:00
@github-actions
Copy link

STATEMENTS BRANCHES FUNCTIONS LINES
≍ 0.01↑ ≍ 0.05↓ ≍ 0= ≍ 0=
% 74.52 61.8 63.06 76.29
ABS 2913 / 3909 1707 / 2762 548 / 869 2804 / 3675

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.

5 participants