onboard.tsx 1.1 KB

123456789101112131415161718192021222324
  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. return <View className="onboard_bg">
  10. <Text className="onboard_title">{props.title}</Text>
  11. <Text className={health.mode=='ACTIVE'?"onboard_desc g01":"onboard_desc g02"}
  12. style={{fontSize:health.mode=='ACTIVE'?rpxToPx(24):rpxToPx(26)}}>{props.desc}</Text>
  13. <NewButton
  14. type={NewButtonType.fill}
  15. color={props.color ? props.color : getThemeColor(health.mode)}
  16. onClick={props.onClick}
  17. title={props.btnTitle}
  18. width={rpxToPx(374)}
  19. height={rpxToPx(72)}
  20. />
  21. <View className="border_footer_line" />
  22. </View>
  23. }