Merged in fix/BOOK-408-alt-text-needs-to-be-updated- (pull request #3220)
* fix(BOOK-408): Updated logo aria label * fix(BOOK-408): Added title for links opening in new tab * fix(BOOK-408): Added translations handling for title Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
'use client'
|
||||
|
||||
import { cx } from 'class-variance-authority'
|
||||
import NextLink from 'next/link'
|
||||
import { TextLinkProps } from './types'
|
||||
import { variants } from './variants'
|
||||
|
||||
import styles from './textLink.module.css'
|
||||
import { useIntl } from 'react-intl'
|
||||
|
||||
export function TextLink({
|
||||
theme,
|
||||
@@ -14,6 +17,7 @@ export function TextLink({
|
||||
typography,
|
||||
...props
|
||||
}: TextLinkProps) {
|
||||
const intl = useIntl()
|
||||
const classNames = variants({
|
||||
theme,
|
||||
typography,
|
||||
@@ -29,6 +33,14 @@ export function TextLink({
|
||||
[styles.disabled]: isDisabled,
|
||||
[styles.inline]: isInline,
|
||||
})}
|
||||
title={
|
||||
props.target === '_blank'
|
||||
? intl.formatMessage({
|
||||
id: 'common.linkOpenInNewTab',
|
||||
defaultMessage: 'Opens in a new tab/window',
|
||||
})
|
||||
: ''
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user