Skip to content

Accordion/AccordionPanel Review Notes #960

@Darper

Description

@Darper

Accordion.js

  • Line 57: Add comment to inform that we are checking for a string in case the user uses an HTML element instead of a React Node, in which case boolean attributes aren't allowed
  • Lines 115-116: Remove the titlePosition prop and allow user to set positioning/style by passing through a Node instead of a String to the title prop.
  • Line 118: Remove header-inactive class and make that the default styling. Only overwrite when active.
  • Lines 130-131: Do we need these?
  • Line 134: Remove unnecessary wrapper div. Replace with React.Fragment if wrapper is needed.
  • Line 168: Wrap message in <Text> component.
  • Line 197: Allow expandAll prop to be either boolean or string. If string, use that value instead of messages.expandAll on line 168.

AccordionPanel.js

  • Line 17: Delete panelStyles variable and just set styleName=cx("accordionPanel") on div.
  • Line 49: Set prop type for title to PropTypes.node to allow user to pass in any element. Check styling to make sure end user has full control over the header section when adding a title element.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions