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

13 lines
363 B
TypeScript
Raw Normal View History

2022-02-20 11:51:55 +00:00
export const buildUrl = (url) => {
2022-03-12 03:27:56 +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) => {
2022-03-28 15:00:23 +00:00
return window.location.origin + '/share/wiki/' + wikiId;
2022-03-11 05:57:55 +00:00
};
export const getDocumentShareURL = (documentId) => {
2022-03-28 15:00:23 +00:00
return window.location.origin + '/share/document/' + documentId;
2022-03-11 05:57:55 +00:00
};