Merged in chore/add-rel-no-follow-to-language-switcher-links (pull request #1865)
chore(SW-2369): dont index language switcher links * chore(SW-2177): dont index language switcher links Approved-by: Linus Flood
This commit is contained in:
@@ -6,6 +6,7 @@ import { useIntl } from "react-intl"
|
|||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import { type Lang, languages } from "@/constants/languages"
|
import { type Lang, languages } from "@/constants/languages"
|
||||||
|
import { env } from "@/env/client"
|
||||||
|
|
||||||
import Link from "@/components/TempDesignSystem/Link"
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
@@ -27,6 +28,9 @@ export default function LanguageSwitcherContent({
|
|||||||
const urlKeys = Object.keys(urls) as Lang[]
|
const urlKeys = Object.keys(urls) as Lang[]
|
||||||
|
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
const relValue = env.NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE
|
||||||
|
? "nofollow"
|
||||||
|
: undefined
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.languageWrapper}>
|
<div className={styles.languageWrapper}>
|
||||||
@@ -45,6 +49,7 @@ export default function LanguageSwitcherContent({
|
|||||||
<Link
|
<Link
|
||||||
className={`${styles.link} ${isActive ? styles.active : ""}`}
|
className={`${styles.link} ${isActive ? styles.active : ""}`}
|
||||||
href={replaceUrlPart(pathname, url)}
|
href={replaceUrlPart(pathname, url)}
|
||||||
|
rel={relValue}
|
||||||
onClick={onLanguageSwitch}
|
onClick={onLanguageSwitch}
|
||||||
keepSearchParams
|
keepSearchParams
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user