@goldlabelapps/theme 3.5.6 → 3.6.0
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.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SocialLinkItem } from "./NXSocialColumn";
|
|
2
|
+
import type { ContactLinkItem } from "./NXContactColumn";
|
|
3
|
+
export declare function resolveAppSocialLinks(nxConfig: Record<string, any>): SocialLinkItem[];
|
|
4
|
+
export declare function resolveAppContactLinks(nxConfig: Record<string, any>): ContactLinkItem[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DEFAULT_SOCIAL_LINKS } from "./NXSocialColumn";
|
|
2
|
+
import { DEFAULT_CONTACT_LINKS } from "./NXContactColumn";
|
|
3
|
+
export function resolveAppSocialLinks(nxConfig) {
|
|
4
|
+
if (nxConfig?.footer?.socialLinks && nxConfig.footer.socialLinks.length > 0) {
|
|
5
|
+
return nxConfig.footer.socialLinks;
|
|
6
|
+
}
|
|
7
|
+
if (nxConfig?.socialLinks && nxConfig.socialLinks.length > 0) {
|
|
8
|
+
return nxConfig.socialLinks;
|
|
9
|
+
}
|
|
10
|
+
const items = [];
|
|
11
|
+
const social = nxConfig?.social || {};
|
|
12
|
+
if (social.github) {
|
|
13
|
+
items.push({ label: "GitHub", href: social.github, external: true });
|
|
14
|
+
}
|
|
15
|
+
if (social.twitter || social.twitterHandle) {
|
|
16
|
+
const handle = social.twitter || (social.twitterHandle ? `https://x.com/${social.twitterHandle.replace(/^@/, "")}` : undefined);
|
|
17
|
+
if (handle)
|
|
18
|
+
items.push({ label: "Twitter / X", href: handle, external: true });
|
|
19
|
+
}
|
|
20
|
+
if (social.linkedin) {
|
|
21
|
+
items.push({ label: "LinkedIn", href: social.linkedin, external: true });
|
|
22
|
+
}
|
|
23
|
+
if (social.youtube) {
|
|
24
|
+
items.push({ label: "YouTube", href: social.youtube, external: true });
|
|
25
|
+
}
|
|
26
|
+
if (social.instagram) {
|
|
27
|
+
items.push({ label: "Instagram", href: social.instagram, external: true });
|
|
28
|
+
}
|
|
29
|
+
return items.length > 0 ? items : DEFAULT_SOCIAL_LINKS;
|
|
30
|
+
}
|
|
31
|
+
export function resolveAppContactLinks(nxConfig) {
|
|
32
|
+
if (nxConfig?.footer?.contactLinks && nxConfig.footer.contactLinks.length > 0) {
|
|
33
|
+
return nxConfig.footer.contactLinks;
|
|
34
|
+
}
|
|
35
|
+
if (nxConfig?.contactLinks && nxConfig.contactLinks.length > 0) {
|
|
36
|
+
return nxConfig.contactLinks;
|
|
37
|
+
}
|
|
38
|
+
const items = [];
|
|
39
|
+
if (nxConfig?.founder?.email) {
|
|
40
|
+
items.push({ label: nxConfig.founder.email, href: `mailto:${nxConfig.founder.email}`, external: true });
|
|
41
|
+
}
|
|
42
|
+
else if (nxConfig?.email) {
|
|
43
|
+
items.push({ label: nxConfig.email, href: `mailto:${nxConfig.email}`, external: true });
|
|
44
|
+
}
|
|
45
|
+
else if (nxConfig?.contact?.email) {
|
|
46
|
+
items.push({ label: nxConfig.contact.email, href: `mailto:${nxConfig.contact.email}`, external: true });
|
|
47
|
+
}
|
|
48
|
+
if (nxConfig?.phone || nxConfig?.contact?.phone) {
|
|
49
|
+
const phone = nxConfig?.phone || nxConfig?.contact?.phone;
|
|
50
|
+
items.push({ label: phone, href: `tel:${phone.replace(/\s+/g, "")}`, external: true });
|
|
51
|
+
}
|
|
52
|
+
if (nxConfig?.url) {
|
|
53
|
+
const cleanUrl = nxConfig.url.replace(/^https?:\/\//, "");
|
|
54
|
+
items.push({ label: cleanUrl, href: nxConfig.url, external: true });
|
|
55
|
+
}
|
|
56
|
+
return items.length > 0 ? items : DEFAULT_CONTACT_LINKS;
|
|
57
|
+
}
|