From f800c248a6b6a5dcd7a504b44235d1407fe0780e Mon Sep 17 00:00:00 2001 From: foxy pirate cove / Fnaf <108185011+foxypiratecove37350@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:52:59 +0100 Subject: [PATCH] fix(bcd): use Safari icon for iOS WebView (#12214) Fix iOS WebView showing the Android icon instead of the Safari icon Co-authored-by: Claas Augner --- .../browser-compatibility-table/headers.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/document/ingredients/browser-compatibility-table/headers.tsx b/client/src/document/ingredients/browser-compatibility-table/headers.tsx index 33ffb8b6302d..5783a3984370 100644 --- a/client/src/document/ingredients/browser-compatibility-table/headers.tsx +++ b/client/src/document/ingredients/browser-compatibility-table/headers.tsx @@ -59,8 +59,16 @@ function BrowserHeaders({ browsers }: { browsers: BCD.BrowserName[] }) { } export function browserToIconName(browser: string) { - const browserStart = browser.split("_")[0]; - return browserStart === "firefox" ? "simple-firefox" : browserStart; + if (browser.startsWith("firefox")) { + return "simple-firefox"; + } else if (browser === "webview_android") { + return "webview"; + } else if (browser === "webview_ios") { + return "safari"; + } else { + const browserStart = browser.split("_")[0]; + return browserStart; + } } export function Headers({