Skip to content

Commit c965fc5

Browse files
committed
Merge branch 'bose/3467' into staging
2 parents 3d18db7 + e5a72d5 commit c965fc5

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

web/core/Link/BaseLink.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { AnchorHTMLAttributes, forwardRef } from 'react'
2-
import NextLink, { LinkProps } from 'next/link'
1+
import NextLink, { type LinkProps } from 'next/link'
2+
import { type AnchorHTMLAttributes, forwardRef } from 'react'
33
import { twMerge } from 'tailwind-merge'
4-
import { LinkType } from '../../types/index'
4+
import type { LinkType } from '../../types/index'
55

66
export type BaseLinkProps = {
77
/** What kind of content is it */
@@ -18,7 +18,7 @@ export type BaseLinkProps = {
1818
* And the strict origin policy when external for using blank
1919
*/
2020
export const BaseLink = forwardRef<HTMLAnchorElement, BaseLinkProps>(function BaseLink(
21-
{ children, type = 'internalUrl', className = '', href = '', skipInternalStyle = false },
21+
{ children, type = 'internalUrl', className = '', href = '', skipInternalStyle = false, locale },
2222
ref,
2323
) {
2424
const classNames = skipInternalStyle
@@ -65,7 +65,7 @@ export const BaseLink = forwardRef<HTMLAnchorElement, BaseLinkProps>(function Ba
6565

6666
default:
6767
return (
68-
<NextLink ref={ref} href={href} prefetch={false} className={classNames}>
68+
<NextLink ref={ref} href={href} locale={locale} prefetch={false} className={classNames}>
6969
{children}
7070
</NextLink>
7171
)

web/core/Link/ResourceLink.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { add, calendar } from '@equinor/eds-icons'
22
import { forwardRef } from 'react'
3-
import { useIntl } from 'react-intl'
43
import { ArrowRight } from '../../icons'
54
import { TransformableIcon } from '../../icons/TransformableIcon'
65
import envisTwMerge from '../../twMerge'
@@ -100,6 +99,7 @@ export const ResourceLink = forwardRef<HTMLAnchorElement, ResourceLinkProps>(fun
10099
href = '',
101100
isAttachment = false,
102101
file,
102+
locale,
103103
},
104104
ref,
105105
) {
@@ -143,9 +143,7 @@ export const ResourceLink = forwardRef<HTMLAnchorElement, ResourceLinkProps>(fun
143143
? `underline
144144
hover:text-norwegian-woods-100
145145
dark:hover:text-slate-blue-95`
146-
: `border-b
147-
border-grey-50
148-
dark:border-white-100 no-underline`
146+
: `border-b border-grey-50 dark:border-white-100 no-underline`
149147
}
150148
${variantClassName[variant]}
151149
`,
@@ -184,7 +182,7 @@ export const ResourceLink = forwardRef<HTMLAnchorElement, ResourceLinkProps>(fun
184182
}
185183

186184
return href ? (
187-
<BaseLink className={classNames} type={type} ref={ref} href={href}>
185+
<BaseLink className={classNames} type={type} ref={ref} href={href} locale={locale}>
188186
<span
189187
className={envisTwMerge(
190188
`h-full

web/lib/localization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { languages, defaultLanguage } from '../languages'
1+
import { defaultLanguage, languages } from '../languages'
22

33
export const getNameFromLocale = (locale: string | undefined): string => {
44
return languages.find((lang) => lang.locale === locale)?.name || defaultLanguage.name

web/sections/CallToActions/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const CallToActions = ({ callToActions = [], splitList, className }: CallToActio
5252
{callToActions.map((callToAction: LinkData) => {
5353
const url = getUrlFromAction(callToAction)
5454
const { id, label, type, link, file } = callToAction
55+
5556
return url ? (
5657
<li key={id}>
5758
{/* If the URL is a static AEM page it should behave as an internal link in the web */}

0 commit comments

Comments
 (0)