no_data.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import { View, Text } from "@tarojs/components";
  2. import './no_data.scss'
  3. import { useTranslation } from "react-i18next";
  4. import NewButton, { NewButtonType } from "../base/new_button";
  5. import { rpxToPx } from "@/utils/tools";
  6. import { MainColorType } from "@/context/themes/color";
  7. import { IconError } from "@/components/basic/Icons";
  8. export default function NoData(props: { refresh: Function }) {
  9. const { t } = useTranslation()
  10. return <View className="no_data_bg" style={{marginTop:rpxToPx(256)}}>
  11. <View style={{
  12. backgroundColor:MainColorType.g04,
  13. width:rpxToPx(108),
  14. height:rpxToPx(108),
  15. borderRadius:rpxToPx(54),
  16. display:'flex',
  17. alignItems:'center',
  18. justifyContent:'center'
  19. }}>
  20. <IconError width={rpxToPx(88)} color="#fff"/>
  21. </View>
  22. <Text className="h50 g01 bold" style={{marginBottom:rpxToPx(92),marginTop:rpxToPx(24)}}>{t('feature.common.no_data.title')}</Text>
  23. {/* <View className="h30 g01" style={{marginBottom:rpxToPx(92),marginTop:rpxToPx(12)}}>check your network connection and try again</View> */}
  24. <NewButton
  25. onClick={props.refresh}
  26. type={NewButtonType.alpha}
  27. color={MainColorType.blue}
  28. width={rpxToPx(240)}
  29. height={rpxToPx(96)}
  30. title={t('feature.common.no_data.retry_btn')}
  31. />
  32. </View>
  33. }