fix: restore icon variant for link since inline-flex makes its children inline but not the box itself

This commit is contained in:
Christian Andolf
2025-06-11 17:06:53 +02:00
parent 2dd07eb6b8
commit 9ee0ec2d46
10 changed files with 22 additions and 15 deletions

View File

@@ -44,7 +44,7 @@ export default async function Destination({
)} )}
</ul> </ul>
{countryUrl && ( {countryUrl && (
<Link href={countryUrl} weight="bold"> <Link href={countryUrl} variant="icon" weight="bold">
{intl.formatMessage( {intl.formatMessage(
{ {
defaultMessage: "View all hotels in {country}", defaultMessage: "View all hotels in {country}",

View File

@@ -46,6 +46,7 @@ export default async function TripAdvisorLink({
return ( return (
<Link <Link
variant="icon"
textDecoration="underline" textDecoration="underline"
color="Text/Interactive/Secondary" color="Text/Interactive/Secondary"
href={tripAdvisorHref} href={tripAdvisorHref}

View File

@@ -77,6 +77,7 @@ export default async function RestaurantBarItem({
href={url} href={url}
target="_blank" target="_blank"
textDecoration="underline" textDecoration="underline"
variant="icon"
color="Text/Interactive/Secondary" color="Text/Interactive/Secondary"
> >
{name} {name}

View File

@@ -72,6 +72,7 @@ export default async function RestaurantSidebar({
href={url} href={url}
color="Text/Interactive/Secondary" color="Text/Interactive/Secondary"
textDecoration="underline" textDecoration="underline"
variant="icon"
> >
{name} {name}
<MaterialIcon <MaterialIcon
@@ -93,7 +94,7 @@ export default async function RestaurantSidebar({
})} })}
</h3> </h3>
</Typography> </Typography>
<Typography variant="Body/Paragraph/mdRegular" className={styles.text}> <Typography variant="Body/Paragraph/mdRegular">
<div> <div>
<p>{hotelAddress.streetAddress}</p> <p>{hotelAddress.streetAddress}</p>
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
@@ -115,10 +116,7 @@ export default async function RestaurantSidebar({
<> <>
<Link href={`tel:${phoneNumber}`}>{phoneNumber}</Link> <Link href={`tel:${phoneNumber}`}>{phoneNumber}</Link>
{hotelAddress.country === Country.Finland ? ( {hotelAddress.country === Country.Finland ? (
<Typography <Typography variant="Body/Paragraph/mdRegular">
variant="Body/Paragraph/mdRegular"
className={styles.text}
>
<p> <p>
{intl.formatMessage({ {intl.formatMessage({
defaultMessage: "Price 0,16 €/min + local call charges", defaultMessage: "Price 0,16 €/min + local call charges",

View File

@@ -60,6 +60,7 @@ export default function MegaMenu({
{seeAllLink?.link ? ( {seeAllLink?.link ? (
<Link <Link
href={seeAllLink.link.url} href={seeAllLink.link.url}
variant="icon"
weight="bold" weight="bold"
onClick={handleNavigate} onClick={handleNavigate}
> >

View File

@@ -100,6 +100,7 @@ export default function ReceiptRoom({
href="" href=""
size="small" size="small"
textDecoration="underline" textDecoration="underline"
variant="icon"
> >
{intl.formatMessage({ {intl.formatMessage({
defaultMessage: "Reservation policy", defaultMessage: "Reservation policy",

View File

@@ -87,7 +87,7 @@ export const renderOptions: RenderOptions = {
return ( return (
<Link <Link
key={node.uid} key={node.uid}
className={cx(styles.link, className)} className={className}
{...props} {...props}
href={node.attrs.url} href={node.attrs.url}
target={node.attrs.target ?? "_blank"} target={node.attrs.target ?? "_blank"}
@@ -348,7 +348,7 @@ export const renderOptions: RenderOptions = {
} }
return ( return (
<span className={cx(styles.span, propsClassName)} {...props}> <span className={propsClassName} {...props}>
{next(node.children, embeds, fullRenderOptions)} {next(node.children, embeds, fullRenderOptions)}
</span> </span>
) )
@@ -416,10 +416,11 @@ export const renderOptions: RenderOptions = {
return ( return (
<Link <Link
key={node.uid} key={node.uid}
className={cx(styles.link, className)} className={className}
href={node.attrs.href} href={node.attrs.href}
textDecoration="underline" textDecoration="underline"
target="_blank" target="_blank"
variant="icon"
{...props} {...props}
> >
{next( {next(
@@ -466,7 +467,7 @@ export const renderOptions: RenderOptions = {
return ( return (
<Link <Link
key={node.uid} key={node.uid}
className={cx(styles.link, className)} className={className}
{...props} {...props}
href={entry.node.url} href={entry.node.url}
textDecoration="underline" textDecoration="underline"
@@ -818,7 +819,7 @@ export const renderOptions: RenderOptions = {
} }
return ( return (
<Typography key={id} variant="Body/Paragraph/mdRegular"> <Typography key={id} variant="Body/Paragraph/mdRegular">
<span className={cx(styles.span, propsClassName)} {...props}> <span className={propsClassName} {...props}>
{children} {children}
</span> </span>
</Typography> </Typography>

View File

@@ -78,7 +78,7 @@ export default async function MembershipCardSlot() {
</span> </span>
</div> </div>
))} ))}
<Link href="#"> <Link href="#" variant="icon">
<MaterialIcon icon="add_circle" color="CurrentColor" /> <MaterialIcon icon="add_circle" color="CurrentColor" />
<Body color="burgundy" textTransform="underlined"> <Body color="burgundy" textTransform="underlined">
{intl.formatMessage({ {intl.formatMessage({

View File

@@ -1,8 +1,5 @@
.link { .link {
text-decoration: none; text-decoration: none;
align-items: center;
display: inline-flex;
gap: var(--Space-x05);
} }
.underline { .underline {
@@ -47,6 +44,12 @@
} }
} }
.icon {
align-items: center;
display: inline-flex;
gap: var(--Space-x05);
}
.breadcrumb { .breadcrumb {
font-family: var(--typography-Footnote-Bold-fontFamily); font-family: var(--typography-Footnote-Bold-fontFamily);
font-size: var(--typography-Footnote-Bold-fontSize); font-size: var(--typography-Footnote-Bold-fontSize);

View File

@@ -28,6 +28,7 @@ export const linkVariants = cva(styles.link, {
bold: styles.bold, bold: styles.bold,
}, },
variant: { variant: {
icon: styles.icon,
breadcrumb: styles.breadcrumb, breadcrumb: styles.breadcrumb,
myPageMobileDropdown: styles.myPageMobileDropdown, myPageMobileDropdown: styles.myPageMobileDropdown,
navigation: styles.navigation, navigation: styles.navigation,