mirror of https://github.com/msgbyte/tailchat
feat: 应用群组邀请与弹出成功模态框
parent
6409aa012b
commit
843c695ae0
@ -0,0 +1,28 @@
|
|||||||
|
import { ModalWrapper, useModalContext } from '@/components/Modal';
|
||||||
|
import { Button } from 'antd';
|
||||||
|
import React, { useCallback } from 'react';
|
||||||
|
import { useHistory } from 'react-router';
|
||||||
|
import { t } from 'tailchat-shared';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
groupId: string;
|
||||||
|
}
|
||||||
|
export const SuccessModal: React.FC<Props> = React.memo((props) => {
|
||||||
|
const { closeModal } = useModalContext();
|
||||||
|
const history = useHistory();
|
||||||
|
const handleNav = useCallback(() => {
|
||||||
|
closeModal();
|
||||||
|
history.push(`/main/group/${props.groupId}`);
|
||||||
|
}, [closeModal, props.groupId]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalWrapper title="加入群组成功!">
|
||||||
|
<div>
|
||||||
|
<Button block={true} type="primary" size="large" onClick={handleNav}>
|
||||||
|
{t('跳转到群组')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</ModalWrapper>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
SuccessModal.displayName = 'SuccessModal';
|
||||||
Loading…
Reference in New Issue