mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
telegram: added telegram attach functionality
This commit is contained in:
parent
3e9f5dedec
commit
e994176bff
10 changed files with 131 additions and 9 deletions
31
src/containers/dialogs/TelegramAttachDialog/index.tsx
Normal file
31
src/containers/dialogs/TelegramAttachDialog/index.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
||||
import { DialogComponentProps } from '~/types/modal';
|
||||
|
||||
import { TelegramLoginForm } from '../../../components/auth/oauth/TelegramLoginForm/index';
|
||||
import { BetterScrollDialog } from '../../../components/dialogs/BetterScrollDialog';
|
||||
|
||||
interface TelegramAttachDialogProps extends DialogComponentProps {}
|
||||
|
||||
const botName = process.env.NEXT_PUBLIC_BOT_USERNAME;
|
||||
|
||||
const TelegramAttachDialog: FC<TelegramAttachDialogProps> = ({
|
||||
onRequestClose,
|
||||
}) => {
|
||||
const { attach } = useTelegramAccount();
|
||||
|
||||
if (!botName) {
|
||||
// TODO: show something
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<BetterScrollDialog width={300} onClose={onRequestClose}>
|
||||
<div>
|
||||
<TelegramLoginForm botName={botName} onSuccess={attach} />
|
||||
</div>
|
||||
</BetterScrollDialog>
|
||||
);
|
||||
};
|
||||
export { TelegramAttachDialog };
|
Loading…
Add table
Add a link
Reference in a new issue