Skip to content

Commit

Permalink
fix(bcd): hide IE-specific compat icons in the legend (#7099)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhjacobs authored Sep 9, 2022
1 parent 10bd301 commit 274324d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const ISSUE_METADATA_TEMPLATE = `
</details>
`;

export const HIDDEN_BROWSERS = ["ie"];

/**
* Return a list of platforms and browsers that are relevant for this category &
* data.
Expand Down Expand Up @@ -72,7 +74,7 @@ function gatherPlatformsAndBrowsers(
}

// Hide Internet Explorer compatibility data
browsers = browsers.filter((browser) => browser !== "ie");
browsers = browsers.filter((browser) => !HIDDEN_BROWSERS.includes(browser));

return [platforms, [...browsers]];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useContext } from "react";
import type BCD from "@mdn/browser-compat-data/types";
import { BrowserInfoContext } from "./browser-info";
import { HIDDEN_BROWSERS } from "./index";
import {
asList,
getFirst,
Expand Down Expand Up @@ -53,6 +54,9 @@ function getActiveLegendItems(
for (const [browser, browserSupport] of Object.entries(
feature.compat.support
)) {
if (HIDDEN_BROWSERS.includes(browser)) {
continue;
}
if (!browserSupport) {
legendItems.add("no");
continue;
Expand Down

0 comments on commit 274324d

Please sign in to comment.