Fix custom domain trust center design

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-10-10 14:50:15 +02:00
parent 4b660119e3
commit a7d129a41c
14 changed files with 165 additions and 78 deletions

View File

@@ -53,3 +53,4 @@ export {
export { promisifyMutation } from "./relay";
export { fileType, fileSize } from "./file";
export { formatDatetime, formatDate } from "./date";
export { getLogoUrl, getTrustCenterUrl } from "./trustCenter";

View File

@@ -0,0 +1,22 @@
export function getLogoUrl(logoPath: string): string {
const path = window.location.pathname;
const trustMatch = path.match(/^\/trust\/([^/]+)/);
if (!trustMatch) {
return `/logos/${logoPath}`;
}
const slug = trustMatch[1];
return `/trust/${slug}/logos/${logoPath}`;
}
export function getTrustCenterUrl(path: string): string {
const currentPath = window.location.pathname;
const trustMatch = currentPath.match(/^\/trust\/([^/]+)/);
if (!trustMatch) {
return `/${path}`;
}
return `../${path}`;
}