Loading.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import React from "react";
  2. import { StyleSheet } from "react-native";
  3. import { Modal, Text, Layout, Spinner, Icon } from "@ui-kitten/components";
  4. import { useModel, setModel } from "flooks";
  5. const styles = StyleSheet.create({
  6. backdrop: {
  7. // backgroundColor: "rgba(0, 0, 0, 0.5)",
  8. },
  9. loadingBox: {
  10. width: 120,
  11. height: 120,
  12. borderRadius: 10,
  13. backgroundColor: "rgba(0,0,0,0.8)",
  14. alignItems: "center",
  15. justifyContent: "center",
  16. },
  17. text: {
  18. color: "#fff",
  19. marginTop: 10,
  20. },
  21. icon: {
  22. width: 60,
  23. height: 60,
  24. },
  25. warning: {
  26. paddingHorizontal: 15,
  27. paddingVertical: 5,
  28. backgroundColor: "rgba(0,0,0,0.8)",
  29. borderRadius: 3,
  30. marginHorizontal: 20,
  31. },
  32. });
  33. export default function Loading() {
  34. const { getWordsStr } = useModel("wordsModel");
  35. const { show, title, status } = useModel("loadingModel");
  36. return (
  37. <Text>加载中...</Text>
  38. // <Modal visible={show} backdropStyle={styles.backdrop}>
  39. // {status === "loading" && (
  40. // <Layout style={styles.loadingBox}>
  41. // <Spinner size='giant' status='control' />
  42. // <Text style={styles.text}>{getWordsStr("loading")}</Text>
  43. // </Layout>
  44. // )}
  45. // {status === "success" && (
  46. // <Layout style={styles.loadingBox}>
  47. // <Icon style={styles.icon} name='checkmark' fill='#fff' />
  48. // <Text style={styles.text}>{title}</Text>
  49. // </Layout>
  50. // )}
  51. // {status === "warn" && (
  52. // <Layout style={styles.warning}>
  53. // <Text style={{ color: "#fff", textAlign: "center" }}>
  54. // {title}
  55. // </Text>
  56. // </Layout>
  57. // )}
  58. // </Modal>
  59. );
  60. }