Skip to content

Commit c1d2b86

Browse files
authored
[fix] button spinner fix (#3150)
* [fix] button spinner fix Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com> * revert Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com> * fix add tileset button spinner Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com> --------- Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
1 parent a05b3cf commit c1d2b86

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

src/components/src/common/loading-spinner.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ const animationName = keyframes`
1717

1818
const Loader = styled.span`
1919
border-left-color: ${props => props.color || props.theme.primaryBtnBgd};
20-
animation: _preloader_spin_ 500ms linear infinite;
2120
border-radius: 50%;
2221
border-top-color: transparent;
2322
border-bottom-color: transparent;
2423
border-right-color: transparent;
2524
cursor: wait;
2625
border-style: solid;
2726
display: block;
28-
animation-name: ${animationName};
27+
animation: ${animationName} 500ms linear infinite;
2928
}`;
3029

3130
export type LoadingWrapperProps = BaseComponentProps & {

src/components/src/modals/tilesets-modals/load-data-footer.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import React from 'react';
55
import {injectIntl, WrappedComponentProps} from 'react-intl';
6-
import styled from 'styled-components';
6+
import styled, {withTheme} from 'styled-components';
77

88
import {Button} from '../../common';
99
import LoadingSpinner from '../../common/loading-spinner';
@@ -51,15 +51,20 @@ type LoadDataFooterProps = {
5151
errorText?: string | null;
5252
};
5353

54-
const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
54+
type ThemeProps = {
55+
theme: any;
56+
};
57+
58+
const LoadDataFooter = ({
5559
disabled,
5660
intl,
5761
isLoading,
5862
onConfirm,
5963
confirmText,
6064
prependText = '',
61-
errorText = ''
62-
}: LoadDataFooterProps & WrappedComponentProps) => {
65+
errorText = '',
66+
theme
67+
}: LoadDataFooterProps & WrappedComponentProps & ThemeProps) => {
6368
return (
6469
<LoadDataFooterContainer>
6570
<div>
@@ -71,7 +76,9 @@ const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
7176
width="130px"
7277
cta
7378
>
74-
{isLoading && <LoadingSpinner size={12} />}
79+
{isLoading && (
80+
<LoadingSpinner color={theme.borderColorLT} borderColor="transparent" size={24} />
81+
)}
7582
{isLoading
7683
? null
7784
: intl.formatMessage({
@@ -84,4 +91,6 @@ const LoadDataFooter: React.FC<LoadDataFooterProps & WrappedComponentProps> = ({
8491
);
8592
};
8693

87-
export default injectIntl(LoadDataFooter) as React.FC<LoadDataFooterProps>;
94+
export default withTheme(injectIntl(LoadDataFooter)) as React.FC<
95+
Omit<LoadDataFooterProps, 'theme'>
96+
>;

0 commit comments

Comments
 (0)