Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(bcd): prefix titles with browser name (and version) #12303

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading