import { Button, View, Text } from "@tarojs/components"; import './Buttons.scss' import { ButtonType, ComponentStatus } from "../../utils/types"; import { Button as RNButton } from 'react-native'; import { AtActivityIndicator } from 'taro-ui'; import "taro-ui/dist/style/components/activity-indicator.scss"; import 'taro-ui/dist/style/components/loading.scss'; /* export default function Buttons(props: { title: string, type?: ButtonType, status?: ComponentStatus,onClick?:()=>void,style?:any }) { const myStyle = props.status == ComponentStatus.disable ? { opacity: 0.4 } : {} return ( ) }*/ export default function Buttons(props: { title: string, type?: ButtonType, className?: any, onClick: () => void, disabled?: boolean, lowLight?: boolean, openType?: string, btnStyle?: any, showLoading?: boolean, lightLoading?: boolean }) { function onClick(e) { if (process.env.TARO_ENV == 'weapp') { e.stopPropagation() } if (props.disabled) return props.onClick() } var mainClass = 'elevated' var textClass = 'elevated_text' if (props.type == ButtonType.text) { mainClass = 'texted' return {props.title} } if (props.type == ButtonType.outline) { mainClass = 'outlined' textClass = 'outlined_text' return ( { props.showLoading && } {props.title} ) } // else { // mainClass = 'puretext' // textClass = 'puretext_text' // } return ( { props.showLoading && } {props.title} // // {props.title} // ) }