Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
'use client'
|
||||
import NextLink from 'next/link'
|
||||
import { usePathname, useSearchParams } from 'next/navigation'
|
||||
import { useMemo } from 'react'
|
||||
"use client"
|
||||
import NextLink from "next/link"
|
||||
import { usePathname, useSearchParams } from "next/navigation"
|
||||
import { useMemo } from "react"
|
||||
|
||||
import { linkVariants } from './variants'
|
||||
import { linkVariants } from "./variants"
|
||||
|
||||
import type { LinkProps } from './link'
|
||||
import { useIntl } from 'react-intl'
|
||||
import type { LinkProps } from "./link"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
export { LinkProps }
|
||||
|
||||
@@ -58,8 +58,8 @@ export default function Link({
|
||||
const newPath = href
|
||||
|
||||
if (keepSearchParams && searchParams.size) {
|
||||
if (newPath.includes('?')) {
|
||||
const newPathParts = newPath.split('?')
|
||||
if (newPath.includes("?")) {
|
||||
const newPathParts = newPath.split("?")
|
||||
const newSearchParams = new URLSearchParams(newPathParts[1])
|
||||
searchParams.forEach((v, k) => {
|
||||
if (!newSearchParams.has(k)) {
|
||||
@@ -81,12 +81,12 @@ export default function Link({
|
||||
href: fullUrl,
|
||||
className: classNames,
|
||||
title:
|
||||
props.target === '_blank'
|
||||
props.target === "_blank"
|
||||
? intl.formatMessage({
|
||||
id: 'common.linkOpenInNewTab',
|
||||
defaultMessage: 'Opens in a new tab/window',
|
||||
id: "common.linkOpenInNewTab",
|
||||
defaultMessage: "Opens in a new tab/window",
|
||||
})
|
||||
: '',
|
||||
: "",
|
||||
}
|
||||
|
||||
return isExternal ? (
|
||||
@@ -112,7 +112,7 @@ export default function Link({
|
||||
|
||||
const useCheckIfExternalLink = (url: string) => {
|
||||
return useMemo(() => {
|
||||
if (typeof window !== 'undefined' && url?.length) {
|
||||
if (typeof window !== "undefined" && url?.length) {
|
||||
try {
|
||||
const hostName = window.location.hostname
|
||||
const newURL = new URL(url)
|
||||
|
||||
Reference in New Issue
Block a user