nostr-signin-modal -> nostr-signup-modal
This commit is contained in:
parent
62723a2c16
commit
f7b7260eea
13 changed files with 21 additions and 21 deletions
|
@ -31,7 +31,7 @@ import {
|
|||
MissingDescriptionModal,
|
||||
MuteModal,
|
||||
NostrLoginModal,
|
||||
NostrSigninModal,
|
||||
NostrSignupModal,
|
||||
ReactionsModal,
|
||||
ReblogsModal,
|
||||
ReplyMentionsModal,
|
||||
|
@ -73,7 +73,7 @@ const MODAL_COMPONENTS: Record<string, React.LazyExoticComponent<any>> = {
|
|||
'MISSING_DESCRIPTION': MissingDescriptionModal,
|
||||
'MUTE': MuteModal,
|
||||
'NOSTR_LOGIN': NostrLoginModal,
|
||||
'NOSTR_SIGNIN': NostrSigninModal,
|
||||
'NOSTR_SIGNUP': NostrSignupModal,
|
||||
'REACTIONS': ReactionsModal,
|
||||
'REBLOGS': ReblogsModal,
|
||||
'REPLY_MENTIONS': ReplyMentionsModal,
|
||||
|
|
|
@ -12,7 +12,7 @@ const NostrExtensionIndicator: React.FC = () => {
|
|||
|
||||
const onClick = () => {
|
||||
dispatch(nostrExtensionLogIn());
|
||||
dispatch(closeModal('NOSTR_SIGNIN'));
|
||||
dispatch(closeModal('NOSTR_SIGNUP'));
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -12,7 +12,7 @@ interface INostrLoginModal {
|
|||
const NostrLoginModal: React.FC<INostrLoginModal> = ({ onClose }) => {
|
||||
const [step, setStep] = useState<Step>(window.nostr ? 'extension' : 'key-add');
|
||||
|
||||
const handleClose = () => onClose('NOSTR_SIGNIN');
|
||||
const handleClose = () => onClose('NOSTR_SIGNUP');
|
||||
|
||||
switch (step) {
|
||||
case 'extension':
|
||||
|
|
|
@ -24,17 +24,17 @@ const ExtensionStep: React.FC<IExtensionStep> = ({ setStep, onClose }) => {
|
|||
const onClickAlt = () => setStep('key-add');
|
||||
|
||||
return (
|
||||
<Modal title={<FormattedMessage id='nostr_signin.siwe.title' defaultMessage='Sign in' />} onClose={onClose}>
|
||||
<Modal title={<FormattedMessage id='NOSTR_SIGNUP.siwe.title' defaultMessage='Sign in' />} onClose={onClose}>
|
||||
<Stack space={6}>
|
||||
<EmojiGraphic emoji='🔐' />
|
||||
|
||||
<Stack space={3}>
|
||||
<Button theme='accent' size='lg' onClick={onClick}>
|
||||
<FormattedMessage id='nostr_signin.siwe.action' defaultMessage='Sign in with extension' />
|
||||
<FormattedMessage id='NOSTR_SIGNUP.siwe.action' defaultMessage='Sign in with extension' />
|
||||
</Button>
|
||||
|
||||
<Button theme='transparent' onClick={onClickAlt}>
|
||||
<FormattedMessage id='nostr_signin.siwe.alt' defaultMessage='Sign in with key' />
|
||||
<FormattedMessage id='NOSTR_SIGNUP.siwe.alt' defaultMessage='Sign in with key' />
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
|
|
@ -35,7 +35,7 @@ const KeyAddStep: React.FC<IKeyAddStep> = ({ onClose }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal title={<FormattedMessage id='nostr_signin.key-add.title' defaultMessage='Import Key' />} onClose={onClose}>
|
||||
<Modal title={<FormattedMessage id='NOSTR_SIGNUP.key-add.title' defaultMessage='Import Key' />} onClose={onClose}>
|
||||
<Stack className='my-3' space={6}>
|
||||
<NostrExtensionIndicator />
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const NostrExtensionIndicator: React.FC = () => {
|
|||
|
||||
const onClick = () => {
|
||||
dispatch(nostrExtensionLogIn());
|
||||
dispatch(closeModal('NOSTR_SIGNIN'));
|
||||
dispatch(closeModal('NOSTR_SIGNUP'));
|
||||
};
|
||||
|
||||
return (
|
|
@ -6,14 +6,14 @@ import KeygenStep from './steps/keygen-step';
|
|||
|
||||
type Step = 'extension' | 'key' | 'keygen';
|
||||
|
||||
interface INostrSigninModal {
|
||||
interface INostrSignupModal {
|
||||
onClose: (type?: string) => void;
|
||||
}
|
||||
|
||||
const NostrSigninModal: React.FC<INostrSigninModal> = ({ onClose }) => {
|
||||
const NostrSigninModal: React.FC<INostrSignupModal> = ({ onClose }) => {
|
||||
const [step, setStep] = useState<Step>(window.nostr ? 'extension' : 'key');
|
||||
|
||||
const handleClose = () => onClose('NOSTR_SIGNIN');
|
||||
const handleClose = () => onClose('NOSTR_SIGNUP');
|
||||
|
||||
switch (step) {
|
||||
case 'extension':
|
|
@ -6,7 +6,7 @@ import { Button, Stack, Modal } from 'soapbox/components/ui';
|
|||
import { useAppDispatch } from 'soapbox/hooks';
|
||||
|
||||
import EmojiGraphic from '../components/emoji-graphic';
|
||||
import { Step } from '../nostr-signin-modal';
|
||||
import { Step } from '../nostr-signup-modal';
|
||||
|
||||
interface IExtensionStep {
|
||||
setStep: (step: Step) => void;
|
||||
|
@ -24,17 +24,17 @@ const ExtensionStep: React.FC<IExtensionStep> = ({ setStep, onClose }) => {
|
|||
const onClickAlt = () => setStep('key');
|
||||
|
||||
return (
|
||||
<Modal title={<FormattedMessage id='nostr_signin.siwe.title' defaultMessage='Sign in' />} onClose={onClose}>
|
||||
<Modal title={<FormattedMessage id='NOSTR_SIGNUP.siwe.title' defaultMessage='Sign in' />} onClose={onClose}>
|
||||
<Stack space={6}>
|
||||
<EmojiGraphic emoji='🔐' />
|
||||
|
||||
<Stack space={3}>
|
||||
<Button theme='accent' size='lg' onClick={onClick}>
|
||||
<FormattedMessage id='nostr_signin.siwe.action' defaultMessage='Sign in with extension' />
|
||||
<FormattedMessage id='NOSTR_SIGNUP.siwe.action' defaultMessage='Sign in with extension' />
|
||||
</Button>
|
||||
|
||||
<Button theme='transparent' onClick={onClickAlt}>
|
||||
<FormattedMessage id='nostr_signin.siwe.alt' defaultMessage='Sign in with key' />
|
||||
<FormattedMessage id='NOSTR_SIGNUP.siwe.alt' defaultMessage='Sign in with key' />
|
||||
</Button>
|
||||
</Stack>
|
||||
</Stack>
|
|
@ -7,7 +7,7 @@ import { useAppDispatch } from 'soapbox/hooks';
|
|||
|
||||
import EmojiGraphic from '../components/emoji-graphic';
|
||||
import NostrExtensionIndicator from '../components/nostr-extension-indicator';
|
||||
import { Step } from '../nostr-signin-modal';
|
||||
import { Step } from '../nostr-signup-modal';
|
||||
|
||||
interface IKeyStep {
|
||||
setStep(step: Step): void;
|
||||
|
@ -23,7 +23,7 @@ const KeyStep: React.FC<IKeyStep> = ({ setStep, onClose }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal title={<FormattedMessage id='nostr_signin.key.title' defaultMessage='You need a key to continue' />} onClose={onClose}>
|
||||
<Modal title={<FormattedMessage id='NOSTR_SIGNUP.key.title' defaultMessage='You need a key to continue' />} onClose={onClose}>
|
||||
<Stack className='my-3' space={6}>
|
||||
<NostrExtensionIndicator />
|
||||
|
|
@ -46,7 +46,7 @@ const KeygenStep: React.FC<IKeygenStep> = ({ onClose }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<Modal title={<FormattedMessage id='nostr_signin.keygen.title' defaultMessage='Your new key' />} onClose={onClose}>
|
||||
<Modal title={<FormattedMessage id='NOSTR_SIGNUP.keygen.title' defaultMessage='Your new key' />} onClose={onClose}>
|
||||
<Stack className='my-3' space={9}>
|
||||
<EmojiGraphic emoji='🔑' />
|
||||
|
|
@ -25,7 +25,7 @@ const SignUpPanel = () => {
|
|||
</Text>
|
||||
</Stack>
|
||||
|
||||
<Button theme='primary' block onClick={() => dispatch(openModal('NOSTR_SIGNIN'))}>
|
||||
<Button theme='primary' block onClick={() => dispatch(openModal('NOSTR_SIGNUP'))}>
|
||||
<FormattedMessage id='account.register' defaultMessage='Sign up' />
|
||||
</Button>
|
||||
</Stack>
|
||||
|
|
|
@ -162,5 +162,5 @@ export const EditAnnouncementModal = lazy(() => import('soapbox/features/ui/comp
|
|||
export const FollowedTags = lazy(() => import('soapbox/features/followed-tags'));
|
||||
export const AccountNotePanel = lazy(() => import('soapbox/features/ui/components/panels/account-note-panel'));
|
||||
export const ComposeEditor = lazy(() => import('soapbox/features/compose/editor'));
|
||||
export const NostrSigninModal = lazy(() => import('soapbox/features/ui/components/modals/nostr-signin-modal/nostr-signin-modal'));
|
||||
export const NostrSignupModal = lazy(() => import('soapbox/features/ui/components/modals/nostr-signup-modal/nostr-signup-modal'));
|
||||
export const NostrLoginModal = lazy(() => import('soapbox/features/ui/components/modals/nostr-login-modal/nostr-login-modal'));
|
||||
|
|
Loading…
Reference in a new issue