-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadingView.tsx
More file actions
69 lines (64 loc) · 1.58 KB
/
Copy pathLoadingView.tsx
File metadata and controls
69 lines (64 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React from 'react';
import { Flex } from '../Flex';
import { Loading } from '../Loading';
import { TPropsLoadingView } from '../types';
const LoadingView_: React.FunctionComponent<TPropsLoadingView> = ({
style = null,
colorsContainer = null,
isHidden = null,
padding = null,
margin = null,
href = null,
onPress = null,
testId = null,
isDisabled = null,
shape = null,
border = null,
shadow = null,
isLoading = null,
children = null,
label = null,
...propsLoading
}: TPropsLoadingView) => {
const {
flex,
direction,
justify,
align,
} = propsLoading;
return (
<Flex
style={style}
colors={colorsContainer || 'secondary'}
isHidden={isHidden}
padding={padding}
margin={margin}
flex={flex}
href={href}
onPress={onPress}
testId={testId}
isDisabled={isDisabled}
shape={shape}
border={border}
shadow={shadow}
>
<Flex
flex={flex}
colors="none"
isHidden={isLoading}
direction={direction}
justify={justify}
align={align}
>
{children}
</Flex>
{isLoading && (
<Loading
{...propsLoading}
label={label || 'Loading...'}
/>
)}
</Flex>
);
};
export const LoadingView = React.memo(LoadingView_);