Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dotcom-rendering/src/components/ProductCardButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const ProductCardButtons = ({
key={label}
label={label}
url={productCta.url}
minimisePadding={true}
priority={index === 0 ? 'primary' : 'tertiary'}
fullwidth={true}
data-component={`${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const LotsOfCtas = {
},
{
url: 'https://www.theguardian.com',
price: '£99.99',
price: '£105.99',
retailer: 'John Lewis',
text: '',
},
Expand Down
21 changes: 18 additions & 3 deletions dotcom-rendering/src/components/ProductLinkButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type {
ButtonPriority,
Expand All @@ -16,6 +17,7 @@ type ProductLinkButtonProps = {
fullwidth?: boolean;
priority?: ButtonPriority;
dataComponent?: string;
minimisePadding?: boolean;
};

const fullWidthStyle = css`
Expand All @@ -26,6 +28,16 @@ const heightAutoStyle = css`
height: auto;
`;

const minimisePaddingStyle = css`
padding: 0 10px 0 12px;
& .src-button-space {
width: 8px;
}
> svg {
margin-left: -2px;
}
`;

export const theme: Partial<ThemeButton> = {
backgroundPrimary: palette('--product-button-primary-background'),
backgroundPrimaryHover: palette(
Expand All @@ -41,12 +53,15 @@ export const ProductLinkButton = ({
url,
size = 'default',
fullwidth = false,
minimisePadding = false,
priority = 'primary',
dataComponent = 'in-body-product-link-button',
}: ProductLinkButtonProps) => {
const cssOverrides = fullwidth
? [fullWidthStyle, heightAutoStyle]
: heightAutoStyle;
const cssOverrides: SerializedStyles[] = [
heightAutoStyle,
...(fullwidth ? [fullWidthStyle] : []),
...(minimisePadding ? [minimisePaddingStyle] : []),
];

return (
<LinkButton
Expand Down
Loading