xref: /MusicFree/src/components/base/loading.tsx (revision 19dc08ecf646164591cb30515347b693c01518c7)
1*19dc08ecS猫头猫import React from 'react';
2*19dc08ecS猫头猫import {StyleSheet, View} from 'react-native';
3*19dc08ecS猫头猫import rpx from '@/utils/rpx';
4*19dc08ecS猫头猫import { ActivityIndicator, useTheme } from 'react-native-paper';
5*19dc08ecS猫头猫import { fontWeightConst } from '@/constants/uiConst';
6*19dc08ecS猫头猫import ThemeText from './themeText';
7*19dc08ecS猫头猫
8*19dc08ecS猫头猫
9*19dc08ecS猫头猫interface ILoadingProps {}
10*19dc08ecS猫头猫export default function Loading(props: ILoadingProps) {
11*19dc08ecS猫头猫  const {colors} = useTheme();
12*19dc08ecS猫头猫
13*19dc08ecS猫头猫  return (
14*19dc08ecS猫头猫    <View style={style.wrapper}>
15*19dc08ecS猫头猫      <ActivityIndicator animating color={colors.text}></ActivityIndicator>
16*19dc08ecS猫头猫      <ThemeText fontSize='title' style={style.text}>加载中...</ThemeText>
17*19dc08ecS猫头猫    </View>
18*19dc08ecS猫头猫  );
19*19dc08ecS猫头猫}
20*19dc08ecS猫头猫
21*19dc08ecS猫头猫const style = StyleSheet.create({
22*19dc08ecS猫头猫  wrapper: {
23*19dc08ecS猫头猫    width: '100%',
24*19dc08ecS猫头猫    flex: 1,
25*19dc08ecS猫头猫    justifyContent: 'center',
26*19dc08ecS猫头猫    alignItems: 'center',
27*19dc08ecS猫头猫  },
28*19dc08ecS猫头猫  img: {
29*19dc08ecS猫头猫    width: rpx(200),
30*19dc08ecS猫头猫    height: rpx(200),
31*19dc08ecS猫头猫  },
32*19dc08ecS猫头猫  text: {
33*19dc08ecS猫头猫    fontWeight: fontWeightConst.bold,
34*19dc08ecS猫头猫    marginTop: rpx(48),
35*19dc08ecS猫头猫  },
36*19dc08ecS猫头猫});
37