-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟 🎨 New design and cleanup for CircleLoader #17582
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
josephkmh marked this conversation as resolved.
Show resolved
Hide resolved
|
61 changes: 15 additions & 46 deletions
61
airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 => ( | ||
<SpinnerSVG | ||
viewBox="0 0 16 16" | ||
width="18" | ||
height="18" | ||
shape-rendering="geometricPrecision" | ||
text-rendering="geometricPrecision" | ||
role="img" | ||
data-icon="circle-loader" | ||
> | ||
export const CircleLoader = ({ title }: CircleLoaderProps): JSX.Element => ( | ||
<svg className={styles.spinner} role="img" viewBox="0 0 16 16" width="18" height="18" data-icon="circle-loader"> | ||
<defs> | ||
<linearGradient | ||
id="eDwmAshgIQE3-fill" | ||
id="circleLoaderGradient" | ||
x1="4.25" | ||
y1="0.5" | ||
x2="4.25" | ||
y2="15.5" | ||
spreadMethod="pad" | ||
gradientUnits="userSpaceOnUse" | ||
gradientTransform="translate(0 0)" | ||
> | ||
<stop id="eDwmAshgIQE3-fill-0" offset="17.9167%" stopColor="#d1d1db" /> | ||
<stop id="eDwmAshgIQE3-fill-1" offset="100%" stopColor="rgba(209,209,219,0)" /> | ||
<stop offset="0%" stopColor={styles.gradientStart} /> | ||
<stop offset="100%" stopColor={styles.gradientStop} /> | ||
</linearGradient> | ||
</defs> | ||
{title && <title>{title}</title>} | ||
<g> | ||
<g> | ||
<path | ||
d="M8,0.5C3.85775,0.5,0.5,3.85775,0.5,8s3.35775,7.5,7.5,7.5v-2c-3.03768,0-5.5-2.4623-5.5-5.5s2.46232-5.5,5.5-5.5v-2Z" | ||
clipRule="evenodd" | ||
fill="url(#eDwmAshgIQE3-fill)" | ||
fillRule="evenodd" | ||
/> | ||
<path | ||
d="M8,15.5c4.1423,0,7.5-3.3577,7.5-7.5s-3.3577-7.5-7.5-7.5v2c3.0377,0,5.5,2.46232,5.5,5.5s-2.4623,5.5-5.5,5.5v2Z" | ||
clipRule="evenodd" | ||
fill="#d1d1db" | ||
fillRule="evenodd" | ||
/> | ||
</g> | ||
<path | ||
d="M8,0.5C3.85775,0.5,0.5,3.85775,0.5,8s3.35775,7.5,7.5,7.5v-2c-3.03768,0-5.5-2.4623-5.5-5.5s2.46232-5.5,5.5-5.5v-2Z" | ||
clipRule="evenodd" | ||
fill="url(#circleLoaderGradient)" | ||
fillRule="evenodd" | ||
/> | ||
<circle cx="8" cy="8" r="3" className={styles.centerDot} /> | ||
</g> | ||
</SpinnerSVG> | ||
</svg> | ||
); | ||
|
||
export default CircleLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️
linear-gradient
doesn't work forfill
on SVG elements, thus the gradient still need to be defined in SVG. To get access to the colors in JS, I exported them from here explicitally. They are already exported from thetheme.ts
file, but I consider this still to be going away once we're removing styled components, so in this case where we'll need to have this export even with SASS, I wanted to make it more explicit.