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
|
||||
links:
|
||||
- title: About us
|
||||
to: https://skynetlabs.com/about
|
||||
href: https://skynetlabs.com/about
|
||||
- title: Brand Guidelines
|
||||
href: https://support.skynetlabs.com/key-concepts/skynet-brand-guidelines
|
||||
- title: Careers
|
||||
|
@ -15,7 +15,7 @@
|
|||
- title: Developer Guide
|
||||
href: https://docs.skynetlabs.com
|
||||
- title: API & SDK Documentation
|
||||
href: https://siasky.net/docs/
|
||||
href: https://sdk.skynetlabs.com
|
||||
- title: Portal Setup
|
||||
href: https://support.skynetlabs.com/the-technology/running-a-web-portal
|
||||
- title: Github
|
||||
|
|
|
@ -2,6 +2,10 @@ import * as React from "react";
|
|||
import { LogoWhiteText } from "../Icons";
|
||||
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 = () => {
|
||||
return (
|
||||
<div className="bg-palette-600 px-8 py-12">
|
||||
|
@ -14,12 +18,19 @@ const Footer = () => {
|
|||
</span>
|
||||
</div>
|
||||
|
||||
{emails.length > 0 && (
|
||||
<div className="flex flex-col text-right space-y-2">
|
||||
{emails.map((email) => (
|
||||
<Link
|
||||
href="mailto:hello@siasky.net"
|
||||
key={email}
|
||||
href={`mailto:${email}`}
|
||||
className="font-content text-palette-300 text-base underline-primary hover:text-primary transition-colors duration-200"
|
||||
>
|
||||
hello@siasky.net
|
||||
{email}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,6 @@ const FooterNavigation = () => {
|
|||
links {
|
||||
href
|
||||
title
|
||||
to
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
import useSWR from "swr";
|
||||
import skynetClient from "./skynetClient";
|
||||
|
||||
const prefix = process.env.GATSBY_API_URL ?? "";
|
||||
const fetcher = (url) => fetch(`${prefix}${url}`).then((response) => response.json());
|
||||
const fetcher = async (url) => {
|
||||
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() {
|
||||
return useSWR("/__internal/do/not/use/accounts", fetcher);
|
||||
|
|
Reference in New Issue