core-ui icon indicating copy to clipboard operation
core-ui copied to clipboard

Pass the rest of the props in Banner component

Open MonPote opened this issue 5 years ago • 0 comments

Component: Banner

Why this is needed: It is need because we might need to add some props directly to the Banner component (Cypress or styles for example)

What should be done: Just add a {...rest} should be enough.

Implementation proposal (strongly recommended):

function Banner({ icon, title, children, variant, ...rest }: Props) {
  return (
-    <BannerContainer className="sc-banner" variant={variant}>
+    <BannerContainer className="sc-banner" variant={variant} {...rest}>
      {icon}
      <TextContainer>
        {title && <Title>{title}</Title>}
        <Text>{children}</Text>
      </TextContainer>
    </BannerContainer>
  );
}

Test plan: Update the snapshot.

MonPote avatar Aug 06 '20 15:08 MonPote