-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add progress bar component * Add progress bar for checking connections * Add progress bar for discoveries schema * Edit progress bar time * Extract time to const * Update text Co-authored-by: Tim Roes <mail@timroes.de> * Update airbyte-webapp/src/locales/en.json Co-authored-by: Jared Rhizor <jared@dataline.io> Co-authored-by: Tim Roes <mail@timroes.de> Co-authored-by: Artem Astapenko <3767150+Jamakase@users.noreply.github.com> Co-authored-by: Jared Rhizor <jared@dataline.io>
- Loading branch information
1 parent
afc9c32
commit a938c4d
Showing
6 changed files
with
87 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from "react"; | ||
import styled, { keyframes } from "styled-components"; | ||
import { FormattedMessage } from "react-intl"; | ||
|
||
type ProgressBarProps = { | ||
runTime?: number; | ||
text?: React.ReactNode; | ||
}; | ||
|
||
export const GrowAnimation = keyframes` | ||
0% { | ||
width: 0; | ||
} | ||
100% { | ||
width: 100%; | ||
} | ||
`; | ||
export const fadeInAnimation = keyframes` | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
const Bar = styled.div` | ||
width: 100%; | ||
max-width: 370px; | ||
height: 19px; | ||
border: 1px solid ${({ theme }) => theme.greyColor20}; | ||
border-radius: 4px; | ||
overflow: hidden; | ||
position: relative; | ||
display: inline-block; | ||
`; | ||
|
||
const Progress = styled.div<{ runTime: number }>` | ||
width: 100%; | ||
height: 100%; | ||
background: ${({ theme }) => theme.primaryColor25}; | ||
animation: ${GrowAnimation} ${({ runTime }) => runTime}s linear 0s; | ||
`; | ||
|
||
const Text = styled.div<{ delay: number }>` | ||
text-align: center; | ||
position: absolute; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
color: ${({ theme }) => theme.whiteColor}; | ||
font-size: 12px; | ||
font-weight: bold; | ||
animation: ${fadeInAnimation} 1s linear ${({ delay }) => delay + 0.5}s | ||
forwards; | ||
opacity: 0; | ||
`; | ||
|
||
const ProgressBar: React.FC<ProgressBarProps> = ({ runTime, text }) => { | ||
const animationRunTime = runTime || 20; | ||
return ( | ||
<Bar> | ||
<Progress runTime={animationRunTime} /> | ||
<Text delay={animationRunTime}> | ||
{text || <FormattedMessage id="form.wait" />} | ||
</Text> | ||
</Bar> | ||
); | ||
}; | ||
|
||
export default ProgressBar; |
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,4 @@ | ||
import ProgressBar from "./ProgressBar"; | ||
|
||
export default ProgressBar; | ||
export { ProgressBar }; |
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
19 changes: 5 additions & 14 deletions
19
airbyte-webapp/src/views/Connector/ServiceForm/components/TestingConnectionSpinner.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