You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
639 B
22 lines
639 B
export function discoverCardAvatarUrl(
|
|
avatar: string | null | undefined,
|
|
avatarVisibility: string,
|
|
): string | null {
|
|
if (avatarVisibility !== "public") {
|
|
return null;
|
|
}
|
|
const t = typeof avatar === "string" ? avatar.trim() : "";
|
|
return t.length > 0 ? t : null;
|
|
}
|
|
|
|
export function discoverCardLocationLine(
|
|
discoverVisible: boolean,
|
|
discoverShowLocation: boolean,
|
|
discoverLocation: string | null | undefined,
|
|
): string | null {
|
|
if (!discoverVisible || !discoverShowLocation) {
|
|
return null;
|
|
}
|
|
const t = typeof discoverLocation === "string" ? discoverLocation.trim() : "";
|
|
return t.length > 0 ? t : null;
|
|
}
|
|
|