From c7b6e249ac8d76d17471265cf0404fdac0d43e4c Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 26 Jan 2023 16:48:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9F=F0=9F=94=A7=20Refactor=20Connector?= =?UTF-8?q?sView=20(#21531)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * WIP * WIP * wip * more fixes * fix test * remove some more styled components and improve memoization * review comment --- .../Indicator/Indicator.module.scss | 12 + .../src/components/Indicator/Indicator.tsx | 21 +- .../ReleaseStageBadge/ReleaseStageBadge.tsx | 2 +- airbyte-webapp/src/locales/en.json | 1 - .../pages/ConnectorsPage/DestinationsPage.tsx | 15 +- .../pages/ConnectorsPage/SourcesPage.tsx | 15 +- .../components/ConnectorCell.module.scss | 3 + .../components/ConnectorCell.tsx | 44 +-- .../components/ConnectorsView.module.scss | 13 + .../components/ConnectorsView.tsx | 112 +++--- .../components/ConnectorsViewContext.tsx | 18 + .../CreateConnectorModal.module.scss | 11 +- .../components/CreateConnectorModal.tsx | 365 +++++++----------- .../components/PageComponents.tsx | 11 - .../components/UpgradeAllButton.tsx | 4 +- .../components/VersionCell.module.scss | 35 ++ .../ConnectorsPage/components/VersionCell.tsx | 120 ++---- ...FrequentlyUsedConnectorsCard.test.tsx.snap | 9 + 18 files changed, 394 insertions(+), 417 deletions(-) create mode 100644 airbyte-webapp/src/components/Indicator/Indicator.module.scss create mode 100644 airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorCell.module.scss create mode 100644 airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorsView.module.scss create mode 100644 airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/ConnectorsViewContext.tsx delete mode 100644 airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/PageComponents.tsx create mode 100644 airbyte-webapp/src/pages/SettingsPage/pages/ConnectorsPage/components/VersionCell.module.scss diff --git a/airbyte-webapp/src/components/Indicator/Indicator.module.scss b/airbyte-webapp/src/components/Indicator/Indicator.module.scss new file mode 100644 index 0000000000000..5ecd4ae36e4db --- /dev/null +++ b/airbyte-webapp/src/components/Indicator/Indicator.module.scss @@ -0,0 +1,12 @@ +@use "scss/colors"; + +.indicator { + height: 10px; + width: 10px; + border-radius: 50%; + background: colors.$red; +} + +.hidden { + background-color: transparent; +} diff --git a/airbyte-webapp/src/components/Indicator/Indicator.tsx b/airbyte-webapp/src/components/Indicator/Indicator.tsx index 7332a0017d736..6b684037f417f 100644 --- a/airbyte-webapp/src/components/Indicator/Indicator.tsx +++ b/airbyte-webapp/src/components/Indicator/Indicator.tsx @@ -1,8 +1,15 @@ -import styled from "styled-components"; +import classNames from "classnames"; -export const Indicator = styled.div` - height: 10px; - width: 10px; - border-radius: 50%; - background: ${({ theme }) => theme.dangerColor}; -`; +import styles from "./Indicator.module.scss"; + +export interface IndicatorProps { + /** + * Set to true to render an invisible indicator so reserve the space in the UI + */ + hidden?: boolean; + className?: string; +} + +export const Indicator: React.FC = ({ hidden, className }) => ( +