set hello and abuse emails based on current domain
This commit is contained in:
parent
10ad9aafb0
commit
135c7ff1ca
|
@ -1,7 +1,7 @@
|
||||||
- header: Skynet Labs
|
- header: Skynet Labs
|
||||||
links:
|
links:
|
||||||
- title: About us
|
- title: About us
|
||||||
to: https://skynetlabs.com/about
|
href: https://skynetlabs.com/about
|
||||||
- title: Brand Guidelines
|
- title: Brand Guidelines
|
||||||
href: https://support.skynetlabs.com/key-concepts/skynet-brand-guidelines
|
href: https://support.skynetlabs.com/key-concepts/skynet-brand-guidelines
|
||||||
- title: Careers
|
- title: Careers
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
- title: Developer Guide
|
- title: Developer Guide
|
||||||
href: https://docs.skynetlabs.com
|
href: https://docs.skynetlabs.com
|
||||||
- title: API & SDK Documentation
|
- title: API & SDK Documentation
|
||||||
href: https://siasky.net/docs/
|
href: https://sdk.skynetlabs.com
|
||||||
- title: Portal Setup
|
- title: Portal Setup
|
||||||
href: https://support.skynetlabs.com/the-technology/running-a-web-portal
|
href: https://support.skynetlabs.com/the-technology/running-a-web-portal
|
||||||
- title: Github
|
- title: Github
|
||||||
|
|
|
@ -2,6 +2,10 @@ import * as React from "react";
|
||||||
import { LogoWhiteText } from "../Icons";
|
import { LogoWhiteText } from "../Icons";
|
||||||
import Link from "../Link";
|
import Link from "../Link";
|
||||||
|
|
||||||
|
const hostname = typeof window !== "undefined" ? window.location.hostname : "";
|
||||||
|
const domain = hostname.substring(hostname.lastIndexOf(".", hostname.lastIndexOf(".") - 1) + 1);
|
||||||
|
const emails = domain ? [`hello@${domain}`, `abuse@${domain}`] : [];
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
return (
|
return (
|
||||||
<div className="bg-palette-600 px-8 py-12">
|
<div className="bg-palette-600 px-8 py-12">
|
||||||
|
@ -14,12 +18,19 @@ const Footer = () => {
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Link
|
{emails.length > 0 && (
|
||||||
href="mailto:hello@siasky.net"
|
<div className="flex flex-col text-right space-y-2">
|
||||||
className="font-content text-palette-300 text-base underline-primary hover:text-primary transition-colors duration-200"
|
{emails.map((email) => (
|
||||||
>
|
<Link
|
||||||
hello@siasky.net
|
key={email}
|
||||||
</Link>
|
href={`mailto:${email}`}
|
||||||
|
className="font-content text-palette-300 text-base underline-primary hover:text-primary transition-colors duration-200"
|
||||||
|
>
|
||||||
|
{email}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,7 +13,6 @@ const FooterNavigation = () => {
|
||||||
links {
|
links {
|
||||||
href
|
href
|
||||||
title
|
title
|
||||||
to
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,20 @@
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
import skynetClient from "./skynetClient";
|
||||||
|
|
||||||
const prefix = process.env.GATSBY_API_URL ?? "";
|
const fetcher = async (url) => {
|
||||||
const fetcher = (url) => fetch(`${prefix}${url}`).then((response) => response.json());
|
try {
|
||||||
|
const portalUrl = await skynetClient.portalUrl();
|
||||||
|
const portalUrlObject = new URL(portalUrl);
|
||||||
|
|
||||||
|
portalUrlObject.pathname = url;
|
||||||
|
|
||||||
|
const absoluteUrl = portalUrlObject.toString();
|
||||||
|
|
||||||
|
return fetch(absoluteUrl).then((response) => response.json());
|
||||||
|
} catch (error) {
|
||||||
|
return fetch(url).then((response) => response.json());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export default function useAccounts() {
|
export default function useAccounts() {
|
||||||
return useSWR("/__internal/do/not/use/accounts", fetcher);
|
return useSWR("/__internal/do/not/use/accounts", fetcher);
|
||||||
|
|
Reference in New Issue