Display URL host on compliance page organization sidebar ENG-53

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-28 09:40:03 +04:00
parent d893e34e8e
commit baad2f8a34
4 changed files with 7 additions and 11 deletions

View File

@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
## Unreleased
### Changed
- Remove query params from compliange page sidebar website displayed URLs
## [0.116.11] - 2026-01-27
### Added

View File

@@ -1,4 +1,4 @@
import { domain, formatError } from "@probo/helpers";
import { formatError } from "@probo/helpers";
import { useTranslate } from "@probo/i18n";
import {
Button,
@@ -109,7 +109,7 @@ export function OrganizationSidebar({
rel="noopener noreferrer"
>
<span className="text-txt-info hover:underline ">
{domain(trustCenter.organization.websiteUrl)}
{new URL(trustCenter.organization.websiteUrl).host}
</span>
</a>
</BusinessInfo>

View File

@@ -1,5 +1,5 @@
export { objectKeys, objectEntries, cleanFormData } from "./object";
export { sprintf, faviconUrl, slugify, domain } from "./string";
export { sprintf, faviconUrl, slugify } from "./string";
export {
getCustomDomainStatusBadgeLabel,
getCustomDomainStatusBadgeVariant,

View File

@@ -30,11 +30,3 @@ export function slugify(str: string): string {
.replace(/[^a-z0-9 ]/g, "") // remove all chars not letters, numbers and spaces (to be replaced)
.replace(/\s+/g, "-");
}
export function domain(url: string): string {
const parts = url.split("//");
if (parts.length > 1) {
url = parts[1];
}
return url.split("/")[0];
}