Skip to content

Commit 8aeafe6

Browse files
make text centered in buttons
1 parent b45381b commit 8aeafe6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dotcom-rendering/src/components/ProductCardButtons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const ProductCardButtons = ({
2020
label={label}
2121
url={productCta.url}
2222
minimisePadding={true}
23+
fullWidthText={productCtas.length > 1}
2324
priority={index === 0 ? 'primary' : 'tertiary'}
2425
fullwidth={true}
2526
/>

dotcom-rendering/src/components/ProductLinkButton.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type ProductLinkButtonProps = {
1515
url: string;
1616
size?: 'default' | 'small';
1717
fullwidth?: boolean;
18+
fullWidthText?: boolean;
1819
priority?: ButtonPriority;
1920
dataComponent?: string;
2021
minimisePadding?: boolean;
@@ -54,6 +55,7 @@ export const ProductLinkButton = ({
5455
size = 'default',
5556
fullwidth = false,
5657
minimisePadding = false,
58+
fullWidthText = false,
5759
priority = 'primary',
5860
dataComponent,
5961
}: ProductLinkButtonProps) => {
@@ -81,7 +83,10 @@ export const ProductLinkButton = ({
8183
cssOverrides={cssOverrides}
8284
>
8385
<span
86+
style={fullWidthText ? { width: '100%' } : {}}
8487
css={css`
88+
text-wrap: balance;
89+
text-align: center;
8590
white-space: normal;
8691
padding: 4px 0 4px;
8792
`}

0 commit comments

Comments
 (0)