wip: dark mode - light mode

This commit is contained in:
Ren Amamiya
2023-10-07 09:06:33 +07:00
parent c71bfb3f6d
commit cb91373d33
22 changed files with 147 additions and 120 deletions

View File

@@ -1,5 +1,5 @@
import { nip19 } from 'nostr-tools';
import { EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19';
import { AddressPointer, EventPointer, ProfilePointer } from 'nostr-tools/lib/nip19';
import { RichContent } from '@utils/types';
@@ -84,7 +84,7 @@ export function parser(eventContent: string) {
}
// nostr account references
if (word.startsWith('nostr:note1') || word.startsWith('noté')) {
if (word.startsWith('nostr:note1') || word.startsWith('note1')) {
const note = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');
content.notes.push(nip19.decode(note).data as string);
return word.replace(word, '');
@@ -98,6 +98,15 @@ export function parser(eventContent: string) {
return word.replace(word, '');
}
// nostr address references
if (word.startsWith('nostr:naddr1') || word.startsWith('naddr1')) {
const naddr = word.replace('nostr:', '').replace(/[^a-zA-Z0-9 ]/g, '');
const decoded = nip19.decode(naddr).data as AddressPointer;
// TODO
console.log('todo: ', decoded);
return word.replace(word, '');
}
// normal word
return word;
});