mattermost-mobile/app/components/loading/index.tsx
Mattermost Build 78c01a74f7
Add performance metrics to the app (#7953) (#8008)
* Add performance metrics to the app

* add batcher and improve handling

* Add tests

* Fix test

* Address feedback

* Address feedback

* Address feedback

* update podfile

(cherry picked from commit 5f01f9e9af)

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2024-06-12 09:51:38 +02:00

48 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {ActivityIndicator, type StyleProp, View, type ViewStyle, Text, type TextStyle} from 'react-native';
import {useTheme} from '@context/theme';
type LoadingProps = {
containerStyle?: StyleProp<ViewStyle>;
size?: number | 'small' | 'large';
color?: string;
themeColor?: keyof Theme;
footerText?: string;
footerTextStyles?: TextStyle;
testID?: string;
}
const Loading = ({
containerStyle,
size,
color,
themeColor,
footerText,
footerTextStyles,
testID,
}: LoadingProps) => {
const theme = useTheme();
const indicatorColor = themeColor ? theme[themeColor] : color;
return (
<View
style={containerStyle}
testID={testID}
>
<ActivityIndicator
color={indicatorColor}
size={size}
/>
{
footerText &&
<Text style={footerTextStyles}>{footerText}</Text>
}
</View>
);
};
export default Loading;