Have only one NostrExtensionIndicator component
This commit is contained in:
parent
b94ea6cd42
commit
7adb676653
2 changed files with 1 additions and 38 deletions
|
@ -1,37 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
|
|
||||||
import { closeModal } from 'soapbox/actions/modals';
|
|
||||||
import { nostrExtensionLogIn } from 'soapbox/actions/nostr';
|
|
||||||
import Stack from 'soapbox/components/ui/stack/stack';
|
|
||||||
import Text from 'soapbox/components/ui/text/text';
|
|
||||||
import { useAppDispatch } from 'soapbox/hooks';
|
|
||||||
|
|
||||||
const NostrExtensionIndicator: React.FC = () => {
|
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
|
|
||||||
const onClick = () => {
|
|
||||||
dispatch(nostrExtensionLogIn());
|
|
||||||
dispatch(closeModal('NOSTR_SIGNUP'));
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Stack space={2} className='rounded-lg bg-gray-100 p-2 dark:bg-gray-800'>
|
|
||||||
<Text size='xs'>
|
|
||||||
{window.nostr ? (
|
|
||||||
<FormattedMessage
|
|
||||||
id='nostr_extension.found'
|
|
||||||
defaultMessage='<link>Sign in</link> with browser extension.'
|
|
||||||
values={{
|
|
||||||
link: (node) => <button type='button' className='underline' onClick={onClick}>{node}</button>,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<FormattedMessage id='nostr_extension.not_found' defaultMessage='Browser extension not found.' />
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NostrExtensionIndicator;
|
|
|
@ -6,7 +6,7 @@ import EmojiGraphic from 'soapbox/components/emoji-graphic';
|
||||||
import { Button, Stack, Modal } from 'soapbox/components/ui';
|
import { Button, Stack, Modal } from 'soapbox/components/ui';
|
||||||
import { useAppDispatch } from 'soapbox/hooks';
|
import { useAppDispatch } from 'soapbox/hooks';
|
||||||
|
|
||||||
import NostrExtensionIndicator from '../components/nostr-extension-indicator';
|
import NostrExtensionIndicator from '../../nostr-login-modal/components/nostr-extension-indicator';
|
||||||
import { Step } from '../nostr-signup-modal';
|
import { Step } from '../nostr-signup-modal';
|
||||||
|
|
||||||
interface IKeyStep {
|
interface IKeyStep {
|
||||||
|
|
Loading…
Reference in a new issue