Skip to content

Commit

Permalink
enhance(bcd): prefix titles with browser name (and version) (#12303)
Browse files Browse the repository at this point in the history
* feat(compatibility-table): add browser name to compatibility table tooltip

* chore(bcd): prefix title with browser name

* enhance(bcd): prefix release date title

---------

Co-authored-by: Claas Augner <[email protected]>
  • Loading branch information
jazzygasper and caugner authored Feb 17, 2025
1 parent 002839d commit b92f409
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ function getSupportClassName(
return className;
}

function getSupportBrowserReleaseDate(
support: SupportStatementExtended | undefined
): string | undefined {
if (!support) {
return undefined;
}
return getCurrentSupport(support)!.release_date;
}

function StatusIcons({ status }: { status: BCD.StatusBlock }) {
const icons = [
status.experimental && {
Expand Down Expand Up @@ -139,7 +130,7 @@ const CellText = React.memo(
const added = currentSupport?.version_added ?? null;
const lastVersion = currentSupport?.version_last ?? null;

const browserReleaseDate = getSupportBrowserReleaseDate(support);
const browserReleaseDate = currentSupport?.release_date;
const supportClassName = getSupportClassName(support, browser);

let status:
Expand Down Expand Up @@ -198,16 +189,18 @@ const CellText = React.memo(
break;

case "preview":
title = "Preview browser support";
title = "Preview support";
label = status.label || browser.preview_name;
break;

case "unknown":
title = "Compatibility unknown; please update this.";
title = "Support unknown";
label = "?";
break;
}

title = `${browser.name}${title}`;

return (
<div
className={
Expand All @@ -233,7 +226,7 @@ const CellText = React.memo(
className="bc-version-label"
title={
browserReleaseDate && !timeline
? `Released ${browserReleaseDate}`
? `${browser.name} ${added}Released ${browserReleaseDate}`
: undefined
}
>
Expand Down

0 comments on commit b92f409

Please sign in to comment.