droplinked-editor-configs 1.9.11 → 1.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ArrowrightSm } from "assets/icon/Navigation/ArrowRight/ArrowrightSm";
|
|
2
2
|
import Text from "components/ui/Text";
|
|
3
3
|
import useThemeInfo from "hooks/useThemeInfo";
|
|
4
|
+
import { isExternalUrl, normalizeUrl } from "lib/utils/urlUtils";
|
|
4
5
|
import React from "react";
|
|
5
6
|
|
|
6
7
|
interface LinkItem {
|
|
@@ -49,14 +50,14 @@ export default function FooterNavigation({ linkManagement }: FooterNavigationPro
|
|
|
49
50
|
const firstColumnLinks: LinkItem[] =
|
|
50
51
|
linkManagement?.firstColumn?.links?.map(link => ({
|
|
51
52
|
caption: link.list?.label ?? "",
|
|
52
|
-
link: link.list?.url
|
|
53
|
+
link: link.list?.url ? normalizeUrl(link.list.url) : "#"
|
|
53
54
|
})) ?? [];
|
|
54
55
|
|
|
55
56
|
const secondColumnName = linkManagement?.secondColumn?.name ?? "Second Column";
|
|
56
57
|
const secondColumnLinks: LinkItem[] =
|
|
57
58
|
linkManagement?.secondColumn?.links?.map(link => ({
|
|
58
59
|
caption: link.list?.label ?? "",
|
|
59
|
-
link: link.list?.url
|
|
60
|
+
link: link.list?.url ? normalizeUrl(link.list.url) : "#"
|
|
60
61
|
})) ?? [];
|
|
61
62
|
|
|
62
63
|
return (
|
|
@@ -85,7 +86,7 @@ const CommonLinks: React.FC<CommonLinksProps> = ({ links, linkTextClass, isDynam
|
|
|
85
86
|
{links.map(({ caption, link }, index) => (
|
|
86
87
|
<li key={index}>
|
|
87
88
|
{isDynamic ? (
|
|
88
|
-
<a href={link} target="_self" rel="noopener noreferrer" className="flex">
|
|
89
|
+
<a href={link} target={isExternalUrl(link) ? "_blank" : "_self"} rel="noopener noreferrer" className="flex">
|
|
89
90
|
<span className="group flex">
|
|
90
91
|
<Text className={`relative flex items-center text-sm ${linkTextClass}`}>
|
|
91
92
|
{caption}
|