diff --git a/web/core/Button/index.tsx b/web/core/Button/index.tsx index d85fd6f30..114fe38c6 100644 --- a/web/core/Button/index.tsx +++ b/web/core/Button/index.tsx @@ -3,7 +3,7 @@ import { ButtonHTMLAttributes, forwardRef } from 'react' import { twMerge } from 'tailwind-merge' export const commonButtonStyling = ` -w-max +w-fit text-sm px-5 py-3 diff --git a/web/core/Link/ReadMoreLink.tsx b/web/core/Link/ReadMoreLink.tsx index 04351242c..ff8f758df 100644 --- a/web/core/Link/ReadMoreLink.tsx +++ b/web/core/Link/ReadMoreLink.tsx @@ -55,7 +55,7 @@ export const ReadMoreLink = forwardRef(fun ${ type === 'downloadableFile' || type === 'downloadableImage' ? 'group-hover:translate-y-0.5' - : 'group-hover:translate-x-2' + : '-translate-y-1 group-hover:translate-x-2' } transition-all duration-300 diff --git a/web/core/Link/ResourceLink.tsx b/web/core/Link/ResourceLink.tsx index 07c9d8b06..732f345ef 100644 --- a/web/core/Link/ResourceLink.tsx +++ b/web/core/Link/ResourceLink.tsx @@ -61,7 +61,7 @@ export const ResourceLink = forwardRef(fun return ( - + {children} diff --git a/web/sections/CallToActions/index.tsx b/web/sections/CallToActions/index.tsx index fb9e1e21a..ec1138da9 100644 --- a/web/sections/CallToActions/index.tsx +++ b/web/sections/CallToActions/index.tsx @@ -15,27 +15,38 @@ type CallToActionsProps = { const CallToActions = ({ callToActions = [], overrideButtonStyle, splitList, className }: CallToActionsProps) => { if (!callToActions) return null - const getSingleButtonLink = () => { + const getSingleAction = () => { const { label, extension, type, link } = callToActions[0] const url = getUrlFromAction(callToActions[0]) if (!url) { console.warn(`CallToActions: Missing URL on 'ButtonLink' link with type: '${type}' and label: '${label}'`) + return null } - return url ? ( + const linkContent = `${label} ${extension ? `(${extension.toUpperCase()})` : ''}` + + return overrideButtonStyle ? ( + + {linkContent} + + ) : ( - {`${label} ${extension ? `(${extension.toUpperCase()})` : ''}`} + {linkContent} - ) : null + ) } - // If we have only one link and the publisher has not made an active choice of overriding the style - // in Sanity the default style is a button style - return callToActions?.length === 1 && !overrideButtonStyle ? ( - getSingleButtonLink() + + return callToActions?.length === 1 ? ( + getSingleAction() ) : ( {callToActions.map((callToAction: LinkData) => {