From 27b831b30147cf7b0c83435764f298e1a7b44741 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 4 Mar 2022 08:59:09 -0800 Subject: [PATCH] chore: convert inline spinner to svg (#3432) * chore: convert inline spinner to svg * feat: inline spinner outline --- src/lib/assets/svg/inline_spinner.svg | 34 ++++++++++++ src/lib/assets/svg/spinner.svg | 3 +- src/lib/components/Swap/Toolbar/Caption.tsx | 3 +- src/lib/icons/InlineSpinner.tsx | 57 --------------------- src/lib/icons/index.tsx | 9 ++++ 5 files changed, 45 insertions(+), 61 deletions(-) create mode 100644 src/lib/assets/svg/inline_spinner.svg delete mode 100644 src/lib/icons/InlineSpinner.tsx diff --git a/src/lib/assets/svg/inline_spinner.svg b/src/lib/assets/svg/inline_spinner.svg new file mode 100644 index 0000000000..ff05a51838 --- /dev/null +++ b/src/lib/assets/svg/inline_spinner.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/lib/assets/svg/spinner.svg b/src/lib/assets/svg/spinner.svg index e29a12455c..7bcc7cf548 100644 --- a/src/lib/assets/svg/spinner.svg +++ b/src/lib/assets/svg/spinner.svg @@ -1,12 +1,11 @@ - + theme.outline}; - border-radius: 50%; - height: 8px; - margin-left: 3px; - min-height: 8px; - min-width: 8px; - position: relative; - transition: 250ms ease background-color; - width: 8px; -` - -const OuterRing = styled.div` - animation: ${rotate} 1s cubic-bezier(0.83, 0, 0.17, 1) infinite; - background: transparent; - border-bottom: 1px solid transparent; - border-left: 2px solid ${({ theme }) => theme.primary}; - border-radius: 50%; - border-right: 1px solid transparent; - border-top: 1px solid transparent; - height: 14px; - left: -3px; - position: relative; - top: -3px; - transform: translateZ(0); - transition: 250ms ease border-color; - width: 14px; -` - -export default function InlineSpinner() { - return ( - - - - - - ) -} diff --git a/src/lib/icons/index.tsx b/src/lib/icons/index.tsx index f5bf39ffda..aa5a32d6c4 100644 --- a/src/lib/icons/index.tsx +++ b/src/lib/icons/index.tsx @@ -1,6 +1,7 @@ import { ReactComponent as RouterIcon } from 'lib/assets/svg/auto_router.svg' import { ReactComponent as CheckIcon } from 'lib/assets/svg/check.svg' import { ReactComponent as ExpandoIcon } from 'lib/assets/svg/expando.svg' +import { ReactComponent as InlineSpinnerIcon } from 'lib/assets/svg/inline_spinner.svg' import { ReactComponent as LogoIcon } from 'lib/assets/svg/logo.svg' import { ReactComponent as SpinnerIcon } from 'lib/assets/svg/spinner.svg' import { ReactComponent as WalletIcon } from 'lib/assets/svg/wallet.svg' @@ -133,3 +134,11 @@ export const Spinner = styled(icon(SpinnerIcon))<{ color?: Color }>` stroke-linecap: round; stroke-width: 2; ` + +export const InlineSpinner = styled(icon(InlineSpinnerIcon))<{ color?: Color }>` + animation: ${rotate} 1s cubic-bezier(0.83, 0, 0.17, 1) infinite; + color: ${({ color = 'active', theme }) => theme[color]}; + fill: ${({ theme }) => theme.outline}; + stroke: ${({ theme }) => theme.outline}; + stroke-linecap: round; +`