Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(UserProfile): Optimising the presentation logic of `ucBranding`

haitaooad733dc50588
diff --git a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx
index 5125d7f4..efc6c7a7 100644
--- a/ui/src/pages/Users/Personal/components/UserInfo/index.tsx
+++ b/ui/src/pages/Users/Personal/components/UserInfo/index.tsx
@@ -115,6 +115,9 @@ const Index: FC<Props> = ({ data }) => {
</>
) : null}
{ucBranding.map((b, i) => {
+ if (!b.label) {
+ return null;
+ }
return (
<div
key={b.name}
@@ -128,9 +131,13 @@ const Index: FC<Props> = ({ data }) => {
}}
/>
) : null}
- <a className="link-secondary" href={b.url}>
- {b.label}
- </a>
+ {b.url ? (
+ <a className="link-secondary" href={b.url}>
+ {b.label}
+ </a>
+ ) : (
+ <span>{b.label}</span>
+ )}
</div>
);
})}