core-ui
core-ui copied to clipboard
Pass the rest of the props in Banner component
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.