nip44 browser extension is required for Ditto
This commit is contained in:
parent
3231a72230
commit
740a3d8482
|
@ -15,10 +15,9 @@ const NostrExtensionIndicator: React.FC = () => {
|
||||||
dispatch(closeModal());
|
dispatch(closeModal());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function renderBody(): React.ReactNode {
|
||||||
|
if (window.nostr && window.nostr.nip44) {
|
||||||
return (
|
return (
|
||||||
<Stack space={2} className='flex items-center rounded-lg bg-gray-100 p-2 dark:bg-gray-800'>
|
|
||||||
<Text size='xs'>
|
|
||||||
{window.nostr ? (
|
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='nostr_extension.found'
|
id='nostr_extension.found'
|
||||||
defaultMessage='<link>Sign in</link> with browser extension.'
|
defaultMessage='<link>Sign in</link> with browser extension.'
|
||||||
|
@ -26,9 +25,28 @@ const NostrExtensionIndicator: React.FC = () => {
|
||||||
link: (node) => <button type='button' className='underline' onClick={onClick}>{node}</button>,
|
link: (node) => <button type='button' className='underline' onClick={onClick}>{node}</button>,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
);
|
||||||
<FormattedMessage id='nostr_extension.not_found' defaultMessage='Browser extension not found.' />
|
} else if (window.nostr) {
|
||||||
)}
|
return (
|
||||||
|
<FormattedMessage
|
||||||
|
id='nostr_extension.not_supported'
|
||||||
|
defaultMessage='Browser extension not supported. Please upgrade to the latest version.'
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<FormattedMessage
|
||||||
|
id='nostr_extension.not_found'
|
||||||
|
defaultMessage='Browser extension not found.'
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack space={2} className='flex items-center rounded-lg bg-gray-100 p-2 dark:bg-gray-800'>
|
||||||
|
<Text size='xs'>
|
||||||
|
{renderBody()}
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1167,6 +1167,7 @@
|
||||||
"new_group_panel.title": "Create Group",
|
"new_group_panel.title": "Create Group",
|
||||||
"nostr_extension.found": "<link>Sign in</link> with browser extension.",
|
"nostr_extension.found": "<link>Sign in</link> with browser extension.",
|
||||||
"nostr_extension.not_found": "Browser extension not found.",
|
"nostr_extension.not_found": "Browser extension not found.",
|
||||||
|
"nostr_extension.not_supported": "Browser extension not supported. Please upgrade to the latest version.",
|
||||||
"nostr_login.siwe.action": "Log in with extension",
|
"nostr_login.siwe.action": "Log in with extension",
|
||||||
"nostr_login.siwe.alt": "Log in with key",
|
"nostr_login.siwe.alt": "Log in with key",
|
||||||
"nostr_login.siwe.sign_up": "Sign Up",
|
"nostr_login.siwe.sign_up": "Sign Up",
|
||||||
|
|
Loading…
Reference in New Issue