Professional-React-and-Next.js-Course icon indicating copy to clipboard operation
Professional-React-and-Next.js-Course copied to clipboard

ButtonGroup for trekbag has a bug

Open Rope-a-dope opened this issue 8 months ago • 0 comments

All buttons are not showing because the text is not passed, can be passed as children.

ButtonGroup

    <section className="button-group">
      {secondaryButtons.map((button) => (
        <Button
          key={button.text + button.onClick.toString()}
          onClick={button.onClick}
          buttonType="secondary"
        >
          {button.text}
        </Button>
      ))}
    </section>
export default function Button({ onClick, buttonType, children }) {
  return (
    <button
      onClick={onClick}
      className={`btn ${buttonType === "secondary" && "btn--secondary"}`}
    >
      {children}
    </button>
  );
}

Rope-a-dope avatar Jun 04 '24 19:06 Rope-a-dope