8000 chore: update body text for tooltip · coder/coder@7e1ec68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e1ec68

Browse files
committed
chore: update body text for tooltip
1 parent 8cbe639 commit 7e1ec68

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

site/src/components/FeatureBadge/FeatureBadge.tsx

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,35 +77,35 @@ const styles = {
7777
},
7878
} as const satisfies Record<string, Interpolation<Theme>>;
7979

80-
function grammaticalArticle(nextWord: string): string {
81-
const vowels = ["a", "e", "i", "o", "u"];
82-
const firstLetter = nextWord.slice(0, 1).toLowerCase();
83-
return vowels.includes(firstLetter) ? "an" : "a";
84-
}
85-
86-
function capitalizeFirstLetter(text: string): string {
87-
return text.slice(0, 1).toUpperCase() + text.slice(1);
88-
}
89-
9080
type FeatureBadgeProps = Readonly<
9181
Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
9282
type: keyof typeof featureBadgeTypes;
9383
size?: "sm" | "lg";
9484
} & (
9585
| {
9686
/**
97-
* Defines whether the FeatureBadge should act as a
98-
* controlled or uncontrolled component with its hover and
99-
* general interaction styling.
87+
* Defines whether the FeatureBadge should respond directly
88+
* to user input (displaying tooltips, controlling its own
89+
* hover styling, etc.)
90+
*/
91+
variant: "static";
92+
93+
/**
94+
* When used with the static variant, this lets you define
95+
* whether the component should display hover/highlighted
96+
* styling. Useful for coordinating hover behavior with an
97+
* outside component.
10098
*/
99+
highlighted?: boolean;
100+
}
101+
| {
101102
variant: "interactive";
102103

103104
// Had to specify the highlighted key for this union option
104105
// even though it won't be used, because otherwise the type
105106
// ergonomics for users would be too clunky.
106107
highlighted?: undefined;
107108
}
108-
| { variant: "static"; highlighted?: boolean }
109109
)
110110
>;
111111

@@ -180,13 +180,8 @@ export const FeatureBadge: FC<FeatureBadgeProps> = ({
180180
onPointerEnter={() => setIsTooltipHovering(true)}
181181
onPointerLeave={() => setIsTooltipHovering(false)}
182182
>
183-
<h5 css={styles.tooltipTitle}>
184-
{capitalizeFirstLetter(featureType)} Feature
185-
</h5>
186-
187183
<p css={styles.tooltipDescription}>
188-
This is {grammaticalArticle(featureType)} {featureType} feature. It
189-
has not yet reached generally availability (GA).
184+
This feature has not yet reached general availability (GA).
190185
</p>
191186

192187
<Link

0 commit comments

Comments
 (0)
0