-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(ui): Extract LoadingTriangle from LoadingIndicator (#31118)
Co-authored-by: Markus Unterwaditzer <[email protected]>
- Loading branch information
1 parent
4e539af
commit e41b2d4
Showing
5 changed files
with
57 additions
and
25 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
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,44 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import sentryLoader from 'sentry-images/sentry-loader.svg'; | ||
|
||
import space from 'sentry/styles/space'; | ||
|
||
type Props = { | ||
children?: React.ReactNode; | ||
}; | ||
|
||
function LoadingTriangle({children}: Props) { | ||
return ( | ||
<LoadingTriangleWrapper data-test-id="loading-indicator"> | ||
<CircleBackground> | ||
<img src={sentryLoader} /> | ||
</CircleBackground> | ||
{children && <div>{children}</div>} | ||
</LoadingTriangleWrapper> | ||
); | ||
} | ||
|
||
const LoadingTriangleWrapper = styled('div')` | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
width: 500px; | ||
transform: translate(-50%, -50%); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: ${space(3)}; | ||
`; | ||
|
||
const CircleBackground = styled('div')` | ||
height: 150px; | ||
width: 150px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: ${p => p.theme.white}; | ||
border-radius: 50%; | ||
`; | ||
|
||
export default LoadingTriangle; |
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