onboard.tsx 1.1 KB

12345678910111213141516171819202122232425
  1. import { getThemeColor } from "@/features/health/hooks/health_hooks";
  2. import { rpxToPx } from "@/utils/tools";
  3. import { View, Text } from "@tarojs/components";
  4. import { useSelector } from "react-redux";
  5. import './onboard.scss'
  6. import NewButton, { NewButtonType } from "../base/new_button";
  7. export default function OnBoard(props: { title: string, desc: string, btnTitle: string, onClick: any, color?: string }) {
  8. const health = useSelector((state: any) => state.health);
  9. debugger
  10. return <View className="onboard_bg">
  11. <Text className="onboard_title">{props.title}</Text>
  12. <Text className={health.mode=='ACTIVE'?"onboard_desc g01":"onboard_desc g02"}
  13. style={{fontSize:health.mode=='ACTIVE'?rpxToPx(24):rpxToPx(26)}}>{props.desc}</Text>
  14. <NewButton
  15. type={NewButtonType.fill}
  16. color={props.color ? props.color : getThemeColor(health.mode)}
  17. onClick={props.onClick}
  18. title={props.btnTitle}
  19. width={rpxToPx(374)}
  20. height={rpxToPx(72)}
  21. />
  22. <View className="border_footer_line" />
  23. </View>
  24. }