Files
dukang/apps/mini-user/src/components/WechatLoginButton.tsx
T
jacy 935ab0d1d4
CI / verify (pull_request) Has been cancelled
微信小程序审核不通过修改
2026-07-21 09:32:06 +08:00

29 lines
792 B
TypeScript

import { View, Text } from '@tarojs/components';
type WechatLoginButtonProps = {
loading?: boolean;
disabled?: boolean;
/** 默认「授权登录」,避免使用「微信」字样与官方风格图标 */
label?: string;
onClick: () => void;
};
/** 授权登录按钮(无微信品牌元素,满足小程序审核) */
export default function WechatLoginButton({
loading = false,
disabled = false,
label = '授权登录',
onClick,
}: WechatLoginButtonProps) {
const inactive = loading || disabled;
return (
<View
className={`login-wechat-btn${inactive ? ' login-wechat-btn--disabled' : ''}`}
onClick={inactive ? undefined : onClick}
>
<Text className="login-wechat-btn__text">{loading ? '授权中...' : label}</Text>
</View>
);
}