mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
Add custom Nostr hooks, improve goosehints
This commit is contained in:
9 files changed
+193
-16
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { useNostr } from '@nostrify/react';
|
||||
import { NLogin, useNostrLogin } from '@nostrify/react/login';
|
||||
|
||||
export function useLoginActions() {
|
||||
const { nostr } = useNostr();
|
||||
const { addLogin } = useNostrLogin();
|
||||
|
||||
return {
|
||||
nsec(nsec: string): void {
|
||||
const login = NLogin.fromNsec(nsec);
|
||||
addLogin(login);
|
||||
},
|
||||
async bunker(uri: string): Promise<void> {
|
||||
const login = await NLogin.fromBunker(uri, nostr);
|
||||
addLogin(login);
|
||||
},
|
||||
async extension(): Promise<void> {
|
||||
const login = await NLogin.fromExtension();
|
||||
addLogin(login);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user