Merge branch 'nip44-required' into 'main'

nip44 browser extension is required for Ditto

See merge request soapbox-pub/soapbox!3195
This commit is contained in:
Alex Gleason 2024-10-27 18:00:13 +00:00
commit 38bc1641c5
2 changed files with 30 additions and 11 deletions

View File

@ -15,20 +15,38 @@ const NostrExtensionIndicator: React.FC = () => {
dispatch(closeModal());
};
function renderBody(): React.ReactNode {
if (window.nostr && window.nostr.nip44) {
return (
<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>,
}}
/>
);
} 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'>
{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.' />
)}
{renderBody()}
</Text>
</Stack>
);

View File

@ -1167,6 +1167,7 @@
"new_group_panel.title": "Create Group",
"nostr_extension.found": "<link>Sign in</link> with browser extension.",
"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.alt": "Log in with key",
"nostr_login.siwe.sign_up": "Sign Up",