You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/web/src/routes/Invite/index.tsx

44 lines
1.1 KiB
TypeScript

import { Button, Divider } from 'antd';
import React, { useCallback } from 'react';
import { useHistory, useParams } from 'react-router';
/**
*
*/
export const InviteRoute: React.FC = React.memo(() => {
const history = useHistory();
const { inviteCode } = useParams<{ inviteCode: string }>();
const isLogin = true;
const handleRegister = useCallback(() => {
history.push(
`/entry/register?redirect=${encodeURIComponent(location.pathname)}`
);
}, []);
const handleJoinGroup = useCallback(() => {
// TODO
console.log('TODO');
}, []);
return (
<div className="h-full w-full">
<div className="w-96 h-72">
<div>{inviteCode}</div>
<div>xxx </div>
<div>[]</div>
<div>: </div>
<Divider />
{isLogin ? (
<Button onClick={handleJoinGroup}></Button>
) : (
<Button onClick={handleRegister}></Button>
)}
</div>
</div>
);
});
InviteRoute.displayName = 'InviteRoute';