Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[fix] button spinner fix (#3150)

Igor Dykhtac1d2b8616841
diff --git a/src/components/src/common/loading-spinner.tsx b/src/components/src/common/loading-spinner.tsx
index 0eae7f156..43d0575fd 100644
--- a/src/components/src/common/loading-spinner.tsx
+++ b/src/components/src/common/loading-spinner.tsx
@@ -17,7 +17,6 @@ const animationName = keyframes`
const Loader = styled.span`
border-left-color: ${props => props.color || props.theme.primaryBtnBgd};
- animation: _preloader_spin_ 500ms linear infinite;
border-radius: 50%;
border-top-color: transparent;
border-bottom-color: transparent;
@@ -25,7 +24,7 @@ const Loader = styled.span`
cursor: wait;
border-style: solid;
display: block;
- animation-name: ${animationName};
+ animation: ${animationName} 500ms linear infinite;
}`;
export type LoadingWrapperProps = BaseComponentProps & {
diff --git a/src/components/src/modals/tilesets-modals/load-data-footer.tsx b/src/components/src/modals/tilesets-modals/load-data-footer.tsx
index f58968ddd..8712eb66d 100644
--- a/src/components/src/modals/tilesets-modals/load-data-footer.tsx
+++ b/src/components/src/modals/tilesets-modals/load-data-footer.tsx
@@ -3,7 +3,7 @@
import React from 'react';
import {injectIntl, WrappedComponentProps} from 'react-intl';
-import styled from 'styled-components';
+import styled, {withTheme} from 'styled-components';
import {Button} from '../../common';
import LoadingSpinner from '../../common/loading-spinner';
@@ -51,15 +51,20 @@ type LoadDataFooterProps = {
errorText?: string | null;
};
-const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
+type ThemeProps = {
+ theme: any;
+};
+
+const LoadDataFooter = ({
disabled,
intl,
isLoading,
onConfirm,
confirmText,
prependText = '',
- errorText = ''
-}: LoadDataFooterProps & WrappedComponentProps) => {
+ errorText = '',
+ theme
+}: LoadDataFooterProps & WrappedComponentProps & ThemeProps) => {
return (
<LoadDataFooterContainer>
<div>
@@ -71,7 +76,9 @@ const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
width="130px"
cta
>
- {isLoading && <LoadingSpinner size={12} />}
+ {isLoading && (
+ <LoadingSpinner color={theme.borderColorLT} borderColor="transparent" size={24} />
+ )}
{isLoading
? null
: intl.formatMessage({
@@ -84,4 +91,6 @@ const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
);
};
-export default injectIntl(LoadDataFooter) as React.FC<LoadDataFooterProps>;
+export default withTheme(injectIntl(LoadDataFooter)) as React.FC<
+ Omit<LoadDataFooterProps, 'theme'>
+>;