Skip to content

Commit

Permalink
fix: revert truncated undiscriminated union display name (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Apr 23, 2024
1 parent 18c453d commit c70049c
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const UndiscriminatedUnionVariant: React.FC<UndiscriminatedUnionVariant.P
applyErrorStyles,
route,
defaultExpandAll = false,
idx,
// idx,
types,
}) => {
const { isRootTypeDefinition } = useTypeDefinitionContext();
Expand All @@ -112,11 +112,7 @@ export const UndiscriminatedUnionVariant: React.FC<UndiscriminatedUnionVariant.P
<div className="t-muted flex items-center gap-2">
{getIconForTypeReference(unionVariant.shape, types)}
{unionVariant.displayName == null ? null : (
<span className="t-default font-mono text-sm">
{unionVariant.displayName.split(" ").length > 6
? `Variant ${idx + 1}`
: unionVariant.displayName}
</span>
<span className="t-default font-mono text-sm">{unionVariant.displayName}</span>
)}
<span className="t-muted inline-flex items-baseline gap-2 text-xs">
{renderTypeShorthand(unionVariant.shape, { nullable: contextValue.isResponse }, types)}
Expand Down

0 comments on commit c70049c

Please sign in to comment.