tiefen_space_app/components/Empty/index.jsx

56 lines
1.9 KiB
React
Raw Normal View History

2023-12-29 00:27:44 +08:00
import { View, Text, Image } from "react-native";
import React from "react";
import { useTailwind } from "tailwind-rn";
export default function Empty({ type }) {
const tailwind = useTailwind();
const source = (type) => {
switch (type) {
case "post":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "friendship":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "location":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "message":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "search":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "internet":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
case "nodata":
2024-04-18 22:58:59 +08:00
return require("../../assets/icon/others/nodata.png");
2024-03-21 18:25:31 +08:00
case "nospace":
return require("../../assets/icon/others/nodata.png");
2023-12-29 00:27:44 +08:00
}
};
const text = (type) => {
switch (type) {
case "post":
return "还没有动态哦快去与Ta邂逅吧";
2023-12-29 00:27:44 +08:00
case "friendship":
return "Ta都等急了行动起来";
case "location":
return "打开位置权限邂逅同城的Ta吧";
2023-12-29 00:27:44 +08:00
case "message":
return "犹豫就会败北!爱要勇敢说出来!";
case "search":
return "没找到Ta呢……换个试试";
case "internet":
return "网络好像出错了,试着下拉刷新一下吧!";
case "nodata":
return "这里空空如也哦~";
2024-03-21 18:25:31 +08:00
case "nospace":
return "暂时没有加入的空间哦";
2023-12-29 00:27:44 +08:00
}
};
return (
<View style={tailwind("flex flex-1 justify-center items-center mt-32")}>
<Image style={tailwind("w-28 h-28")} source={source(type)} />
2024-03-21 18:25:31 +08:00
<Text style={tailwind("text-sm text-[#FFFFFF40] mt-3")}>
{text(type)}
</Text>
2023-12-29 00:27:44 +08:00
</View>
);
}