From a93a8f99efc7275eab8d4dd5d2ae26a5d94a95d0 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Tue, 4 Oct 2022 23:16:13 +0200 Subject: [PATCH 1/2] New design and cleanup for CircleLoader --- .../StatusIcon/CircleLoader.module.scss | 25 ++++++++ .../components/StatusIcon/CircleLoader.tsx | 61 +++++-------------- .../src/components/StatusIcon/StatusIcon.tsx | 2 +- .../FrequentlyUsedDestinations.test.tsx.snap | 14 ++--- .../StartWithDestination.test.tsx.snap | 4 +- 5 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss diff --git a/airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss b/airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss new file mode 100644 index 0000000000000..bb8f014fb00d3 --- /dev/null +++ b/airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss @@ -0,0 +1,25 @@ +@use "../../scss/colors"; + +@keyframes spinning { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +.spinner { + animation: spinning 1000ms linear infinite normal forwards; +} + +.centerDot { + fill: colors.$blue; +} + +:export { + // Export colors to be used in SVG gradients + gradientStart: colors.$blue; + gradientStop: colors.$blue-transparent; +} diff --git a/airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx b/airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx index 49de2a314da7a..f774995084d6a 100644 --- a/airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx +++ b/airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx @@ -1,65 +1,34 @@ -import styled, { keyframes } from "styled-components"; +import styles from "./CircleLoader.module.scss"; -const spinAnimation = keyframes` - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -`; - -const SpinnerSVG = styled.svg` - animation: ${spinAnimation} 1000ms linear infinite normal forwards; -`; - -interface Props { +interface CircleLoaderProps { title?: string; } -const CircleLoader = ({ title }: Props): JSX.Element => ( - +export const CircleLoader = ({ title }: CircleLoaderProps): JSX.Element => ( + - - + + {title && {title}} - - - - + + - + ); - -export default CircleLoader; diff --git a/airbyte-webapp/src/components/StatusIcon/StatusIcon.tsx b/airbyte-webapp/src/components/StatusIcon/StatusIcon.tsx index 2da76601b8bd8..80910eb63c096 100644 --- a/airbyte-webapp/src/components/StatusIcon/StatusIcon.tsx +++ b/airbyte-webapp/src/components/StatusIcon/StatusIcon.tsx @@ -6,7 +6,7 @@ import styled from "styled-components"; import { MoonIcon } from "components/icons/MoonIcon"; import PauseIcon from "../icons/PauseIcon"; -import CircleLoader from "./CircleLoader"; +import { CircleLoader } from "./CircleLoader"; export type StatusIconStatus = "sleep" | "inactive" | "success" | "warning" | "loading" | "error"; diff --git a/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap b/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap index 3270eeb4fa50d..be6a868520516 100644 --- a/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap +++ b/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap @@ -74,7 +74,7 @@ exports[` should renders with mock data without cr > @@ -93,7 +93,7 @@ exports[` should renders with mock data without cr class="container" >
Alpha
@@ -125,7 +125,7 @@ exports[` should renders with mock data without cr > @@ -188,7 +188,7 @@ exports[` should renders with mock data without cr > @@ -230,7 +230,7 @@ exports[` should renders with mock data without cr > @@ -272,7 +272,7 @@ exports[` should renders with mock data without cr > @@ -291,7 +291,7 @@ exports[` should renders with mock data without cr class="container" >
Alpha
diff --git a/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap b/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap index e4704e8a81c54..8ab58ac929b86 100644 --- a/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap +++ b/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap @@ -22,7 +22,7 @@ exports[` should renders without crash with provided pr > @@ -41,7 +41,7 @@ exports[` should renders without crash with provided pr class="container" >
Alpha
From b2e8a366ddce77e5f76a51e145871cba138463bd Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Wed, 5 Oct 2022 13:17:20 +0200 Subject: [PATCH 2/2] Adjust snapshots --- .../FrequentlyUsedDestinations.test.tsx.snap | 14 +++++++------- .../StartWithDestination.test.tsx.snap | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap b/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap index a83d88e7e2175..45ccd7d816031 100644 --- a/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap +++ b/airbyte-webapp/src/views/Connector/ServiceForm/components/FrequentlyUsedDestinations/__snapshots__/FrequentlyUsedDestinations.test.tsx.snap @@ -74,7 +74,7 @@ exports[` should renders with mock data without cr > @@ -93,7 +93,7 @@ exports[` should renders with mock data without cr class="container" >
Alpha
@@ -125,7 +125,7 @@ exports[` should renders with mock data without cr > @@ -188,7 +188,7 @@ exports[` should renders with mock data without cr > @@ -230,7 +230,7 @@ exports[` should renders with mock data without cr > @@ -272,7 +272,7 @@ exports[` should renders with mock data without cr > @@ -291,7 +291,7 @@ exports[` should renders with mock data without cr class="container" >
Alpha
diff --git a/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap b/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap index 6555679b3e5ab..c6e68f28119c6 100644 --- a/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap +++ b/airbyte-webapp/src/views/Connector/ServiceForm/components/StartWithDestination/__snapshots__/StartWithDestination.test.tsx.snap @@ -22,7 +22,7 @@ exports[` should renders without crash with provided pr >