feat: jump to login page in invite view

useful to switch to guest login way
pull/90/head
moonrailgun 2 years ago
parent bad6aa05fa
commit 9868d24ad5

@ -22,7 +22,6 @@
"k1a377364": "Message List Virtualization", "k1a377364": "Message List Virtualization",
"k1a78e6f0": "Expiration", "k1a78e6f0": "Expiration",
"k1ac0bd00": "30 days", "k1ac0bd00": "30 days",
"k1b38bb5c": "Register Now",
"k1b3d8c72": "Group Not Found", "k1b3d8c72": "Group Not Found",
"k1bc58056": "Private Message Service", "k1bc58056": "Private Message Service",
"k1bd56481": "Close independent window", "k1bd56481": "Close independent window",
@ -57,6 +56,7 @@
"k323b5cc7": "Recall", "k323b5cc7": "Recall",
"k3279c602": "Add now", "k3279c602": "Add now",
"k32905632": "Unlimited invitation link", "k32905632": "Unlimited invitation link",
"k32ccc323": "Invitation code has expired",
"k335c71bf": "OTP code cannot be empty", "k335c71bf": "OTP code cannot be empty",
"k34b5e3ab": "Send Message", "k34b5e3ab": "Send Message",
"k34e357ee": "Group Summary", "k34e357ee": "Group Summary",
@ -198,6 +198,7 @@
"k9b0bdb34": "Allow members to view group details", "k9b0bdb34": "Allow members to view group details",
"k9b91079c": "All readed", "k9b91079c": "All readed",
"k9bb01902": "Show Detail", "k9bb01902": "Show Detail",
"k9d343e46": "Haven't logged in yet, login now",
"k9d5a843a": "Mail Service", "k9d5a843a": "Mail Service",
"k9d80acdf": "Verify email", "k9d80acdf": "Verify email",
"k9d901c20": "Meeting room", "k9d901c20": "Meeting room",

@ -22,7 +22,6 @@
"k1a377364": "聊天列表虚拟化", "k1a377364": "聊天列表虚拟化",
"k1a78e6f0": "过期时间", "k1a78e6f0": "过期时间",
"k1ac0bd00": "30天", "k1ac0bd00": "30天",
"k1b38bb5c": "立即注册",
"k1b3d8c72": "群组未找到", "k1b3d8c72": "群组未找到",
"k1bc58056": "私信服务", "k1bc58056": "私信服务",
"k1bd56481": "关闭独立窗口", "k1bd56481": "关闭独立窗口",
@ -57,6 +56,7 @@
"k323b5cc7": "撤回", "k323b5cc7": "撤回",
"k3279c602": "立即添加", "k3279c602": "立即添加",
"k32905632": "不限时邀请链接", "k32905632": "不限时邀请链接",
"k32ccc323": "邀请码已过期",
"k335c71bf": "校验码不能为空", "k335c71bf": "校验码不能为空",
"k34b5e3ab": "发送消息", "k34b5e3ab": "发送消息",
"k34e357ee": "群组概述", "k34e357ee": "群组概述",
@ -198,6 +198,7 @@
"k9b0bdb34": "允许成员查看群组详情", "k9b0bdb34": "允许成员查看群组详情",
"k9b91079c": "所有已读", "k9b91079c": "所有已读",
"k9bb01902": "显示详情", "k9bb01902": "显示详情",
"k9d343e46": "尚未登录, 立即登录",
"k9d5a843a": "邮件服务", "k9d5a843a": "邮件服务",
"k9d80acdf": "认证邮箱", "k9d80acdf": "认证邮箱",
"k9d901c20": "会议室", "k9d901c20": "会议室",

@ -32,10 +32,8 @@ export const JoinBtn: React.FC<Props> = React.memo((props) => {
}); });
const [isJoined, setIsJoined] = useState(false); const [isJoined, setIsJoined] = useState(false);
const handleRegister = useCallback(() => { const handleLogin = useCallback(() => {
navigate( navigate(`/entry/login?redirect=${encodeURIComponent(location.pathname)}`);
`/entry/register?redirect=${encodeURIComponent(location.pathname)}`
);
}, []); }, []);
const { value: invite } = useAsync(() => { const { value: invite } = useAsync(() => {
@ -103,7 +101,7 @@ export const JoinBtn: React.FC<Props> = React.memo((props) => {
if (props.expired && new Date(props.expired).valueOf() < Date.now()) { if (props.expired && new Date(props.expired).valueOf() < Date.now()) {
return ( return (
<Button block={true} type="primary" size="large" disabled={true}> <Button block={true} type="primary" size="large" disabled={true}>
{t('已过期')} {t('邀请码已过期')}
</Button> </Button>
); );
} }
@ -119,8 +117,8 @@ export const JoinBtn: React.FC<Props> = React.memo((props) => {
{t('加入群组')} {t('加入群组')}
</Button> </Button>
) : ( ) : (
<Button block={true} type="primary" size="large" onClick={handleRegister}> <Button block={true} type="primary" size="large" onClick={handleLogin}>
{t('立即注册')} {t('尚未登录, 立即登录')}
</Button> </Button>
); );
}); });

Loading…
Cancel
Save