Skip to content

Commit f6dac56

Browse files
author
Ján Hamara
committed
feat(InfoBanner): fix up the InfoBannerCard Link export
1 parent 6c89c31 commit f6dac56

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/components/InfoBanner/InfoBanner.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const RoundedBox = styled(Box).attrs({ theme })<BoxWithVariant>`
134134
justify-content: flex-start;
135135
border-radius: ${get('radii.3')};
136136
border: 0.0625rem solid;
137-
padding: ${`${Spaces[1]} ${Spaces[2]} ${Spaces[1]} ${Spaces[1]}`};
137+
padding: ${Spaces[2]};
138138
${({ emphasized }) => (emphasized ? emphasizedBannerVariants : bannerVariants)};
139139
140140
--info-banner-text-color: ${({ emphasized, variant }) =>

src/components/InfoBanner/blocks/InfoBannerCard.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ const Title = ({ children }: { children: string }) => <StyledTitle>{children}</S
3838

3939
const Description = ({ children }: { children: string }) => <StyledDescription>{children}</StyledDescription>;
4040

41-
const Link = ({ linkUrl, linkText }: { linkUrl: string; linkText: string }) => (
42-
<StyledLink href={linkUrl}>{linkText}</StyledLink>
43-
);
44-
45-
// TODO: Document this compound component properly when Storybook migration is complete
4641
const InfoBannerCard = ({ children, variant = 'info', emphasized, ...props }: CardProps): JSX.Element => {
4742
const BannerIcon = ICON_VARIANTS[variant];
4843

@@ -60,6 +55,6 @@ const InfoBannerCard = ({ children, variant = 'info', emphasized, ...props }: Ca
6055

6156
InfoBannerCard.Title = Title;
6257
InfoBannerCard.Description = Description;
63-
InfoBannerCard.Link = Link;
58+
InfoBannerCard.Link = StyledLink;
6459

6560
export { InfoBannerCard };

src/components/InfoBanner/docs/InfoBanner.storybook.mdx

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Meta, ArgTypes, Primary, Stories, Unstyled } from '@storybook/blocks';
22
import { StyledSystemLinks } from '../../../docs/StyledSystemLinks';
33
import { InfoBannerCard } from '../blocks/InfoBannerCard';
44
import * as InfoBannerStories from './InfoBanner.stories';
5+
import { Link } from '../../Link/Link';
56

67
<Meta of={InfoBannerStories} />
78

@@ -40,9 +41,9 @@ The wrapper component (**InfoBannerCard**) accepts the same props as the **InfoB
4041
<InfoBannerCard.Description>
4142
Your uploaded documents don't match the records. Please check the following sources:
4243
</InfoBannerCard.Description>
43-
<InfoBannerCard.Link linkText="Driver documents" linkUrl="https://wave.free-now.com" />
44-
<InfoBannerCard.Link linkText="Vehicle documents" linkUrl="https://wave.free-now.com" />
45-
<InfoBannerCard.Link linkText="Driver Profile" linkUrl="https://wave.free-now.com" />
44+
<InfoBannerCard.Link href="https://wave.free-now.com/">Driver Documents</InfoBannerCard.Link>
45+
<InfoBannerCard.Link href="https://wave.free-now.com/">Vehicle Documents</InfoBannerCard.Link>
46+
<InfoBannerCard.Link href="https://wave.free-now.com/">Driver profile</InfoBannerCard.Link>
4647
</InfoBannerCard>
4748
</Unstyled>
4849

@@ -52,8 +53,8 @@ The wrapper component (**InfoBannerCard**) accepts the same props as the **InfoB
5253
<InfoBannerCard.Description>
5354
Your uploaded documents don't match the records. Please check the following sources:
5455
</InfoBannerCard.Description>
55-
<InfoBannerCard.Link linkText="Driver documents" linkUrl="https://wave.free-now.com" />
56-
<InfoBannerCard.Link linkText="Vehicle documents" linkUrl="https://wave.free-now.com" />
57-
<InfoBannerCard.Link linkText="Driver Profile" linkUrl="https://wave.free-now.com" />
56+
<InfoBannerCard.Link href="https://wave.free-now.com/">Driver Documents</InfoBannerCard.Link>
57+
<InfoBannerCard.Link href="https://wave.free-now.com/">Vehicle Documents</InfoBannerCard.Link>
58+
<InfoBannerCard.Link href="https://wave.free-now.com/">Driver profile</InfoBannerCard.Link>
5859
</InfoBannerCard>
5960
```

0 commit comments

Comments
 (0)