think/packages/client/src/helpers/url.tsx

13 lines
359 B
TypeScript
Raw Normal View History

2022-02-20 11:51:55 +00:00
export const buildUrl = (url) => {
2022-03-11 05:57:55 +00:00
if (typeof window === "undefined") return url;
2022-02-20 11:51:55 +00:00
return `${window.location.origin}${url}`;
};
2022-03-11 05:57:55 +00:00
export const getWikiShareURL = (wikiId) => {
return window.location.host + "/share/wiki/" + wikiId;
};
export const getDocumentShareURL = (documentId) => {
return window.location.host + "/share/document/" + documentId;
};