From e16ab11e0f9363c41c6f59e9acb728cdcc142e12 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Mon, 19 Aug 2024 04:02:57 +0300 Subject: [PATCH 1/2] feat: implement filtering by browser in new ui --- .../components/BrowsersSelect/BrowserIcon.tsx | 37 ++++ .../BrowsersSelect/index.module.css | 21 ++ .../components/BrowsersSelect/index.tsx | 182 ++++++++++++++++++ .../suites/components/SuitesPage/index.tsx | 4 +- lib/static/new-ui/types/store.ts | 10 +- lib/tests-tree-builder/static.ts | 7 +- lib/types.ts | 5 + 7 files changed, 255 insertions(+), 11 deletions(-) create mode 100644 lib/static/new-ui/features/suites/components/BrowsersSelect/BrowserIcon.tsx create mode 100644 lib/static/new-ui/features/suites/components/BrowsersSelect/index.module.css create mode 100644 lib/static/new-ui/features/suites/components/BrowsersSelect/index.tsx diff --git a/lib/static/new-ui/features/suites/components/BrowsersSelect/BrowserIcon.tsx b/lib/static/new-ui/features/suites/components/BrowsersSelect/BrowserIcon.tsx new file mode 100644 index 000000000..568f60aab --- /dev/null +++ b/lib/static/new-ui/features/suites/components/BrowsersSelect/BrowserIcon.tsx @@ -0,0 +1,37 @@ +import {isString} from 'lodash'; +import React, {ReactNode} from 'react'; + +const valueToIcon = { + google: 'chrome', + chrome: 'chrome', + firefox: 'firefox', + safari: 'safari', + edge: 'edge', + yandex: 'yandex', + yabro: 'yandex', + ie: 'internet-explorer', + explorer: 'internet-explorer', + opera: 'opera', + phone: 'mobile', + mobile: 'mobile', + tablet: 'tablet', + ipad: 'tablet' +} as const; + +export function BrowserIcon({name: browser}: {name: string}): ReactNode { + const getIcon = (iconName: string): ReactNode =>