-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- setLoadingIndicator action - show Loading... text when async dataset loading is in progress Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
- Loading branch information
1 parent
1a68d1b
commit 029bcc5
Showing
13 changed files
with
149 additions
and
11 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
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,49 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright contributors to the kepler.gl project | ||
|
||
import React, {PropsWithChildren} from 'react'; | ||
import styled, {withTheme} from 'styled-components'; | ||
|
||
type StyledContainerProps = { | ||
isVisible?: boolean; | ||
left: number; | ||
}; | ||
|
||
export const StyledContainer = styled.div<StyledContainerProps>` | ||
position: absolute; | ||
left: ${props => props.left}px; | ||
bottom: ${props => props.theme.sidePanel.margin.left}px; | ||
z-index: 1; | ||
color: ${props => props.theme.textColorHl}; | ||
opacity: ${props => (props.isVisible ? 1 : 0)}; | ||
transition: opacity 0.5s ease-in-out; | ||
background-color: ${props => props.theme.sidePanelBg}; | ||
border-radius: 0px; | ||
padding-left: 3px; | ||
padding-right: 3px; | ||
font-size: 12px; | ||
`; | ||
|
||
type LoadingIndicatorProps = { | ||
isVisible?: boolean; | ||
activeSidePanel?: boolean; | ||
sidePanelWidth?: number; | ||
}; | ||
|
||
const LoadingIndicator: React.FC<PropsWithChildren<LoadingIndicatorProps> & {theme: any}> = ({ | ||
isVisible, | ||
children, | ||
activeSidePanel, | ||
sidePanelWidth, | ||
theme | ||
}) => { | ||
const left = (activeSidePanel ? sidePanelWidth || 0 : 0) + theme.sidePanel.margin.left; | ||
|
||
return ( | ||
<StyledContainer isVisible={isVisible} left={left}> | ||
{children} | ||
</StyledContainer> | ||
); | ||
}; | ||
|
||
export default withTheme(LoadingIndicator) as React.FC<PropsWithChildren<LoadingIndicatorProps>>; |
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
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
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