diff --git a/src/util.tsx b/src/util.tsx index 979064c..5e92b79 100644 --- a/src/util.tsx +++ b/src/util.tsx @@ -65,7 +65,10 @@ export const shuffle = (list: any[]) => { return list; }; -export const getHost = () => "https://rappli.ch"; +export const getDomain = () => + import.meta.env.SSR ? process.env.DOMAIN || "localhost" : location.hostname; + +export const getHost = () => `https://${getDomain()}`; export const onClickFocus: JSX.EventHandlerUnion< HTMLAnchorElement, @@ -83,3 +86,5 @@ export const onClickFocus: JSX.EventHandlerUnion< targetEl.focus(); }; + +export const externalLink = { target: "_blank", rel: "noopener" };