This commit is contained in:
smolgrrr 2023-11-27 14:43:32 +11:00
parent 5404ad0bf9
commit 316c31206e
3 changed files with 95 additions and 97 deletions

View File

@ -1,8 +1,8 @@
import {
ArrowUpTrayIcon,
ServerIcon,
CpuChipIcon,
ArrowPathIcon,
FaceSmileIcon
PlusCircleIcon
} from "@heroicons/react/24/outline";
import { XCircleIcon } from "@heroicons/react/24/solid";
import { useState, useEffect, useRef } from "react";
@ -135,13 +135,13 @@ const NewNoteCard = ({
>
<input type="hidden" name="MAX_FILE_SIZE" defaultValue={2.5 * 1024 * 1024} />
<div className="px-4 flex flex-col rounded-lg">
{"C:\\WIRE>"}
<textarea
name="com"
wrap="soft"
className="shadow-lg w-full px-4 py-3 h-28 border-none bg-black text-white"
className="shadow-lg w-full px-4 py-3 border-blue-500 bg-black text-white"
value={comment}
onChange={(e) => setComment(e.target.value)}
rows={comment.split('\n').length || 1}
/>
<div className="relative">
{file !== "" && (
@ -172,10 +172,10 @@ const NewNoteCard = ({
ref={emojiRef}
/>
)}
<FaceSmileIcon className="h-4 w-4 text-neutral-400 cursor-pointer" onClick={pickEmoji} />
<PlusCircleIcon className="h-4 w-4 text-neutral-400 cursor-pointer" onClick={pickEmoji} />
</div>
<div className="flex items-center">
<ArrowUpTrayIcon
<ServerIcon
className="h-4 w-4 text-neutral-400 cursor-pointer"
onClick={() => document.getElementById("file_input")?.click()}
/>

View File

@ -10,7 +10,7 @@ export default function Header() {
<div className="flex items-center gap-2">
<img src="/icon.png" className="h-12" alt="logo" />
<span className="font-semibold text-white">
{'>'}.. Wired
{"~\\WIRED>"}
</span>
</div>
</a>

View File

@ -1,4 +1,4 @@
import {sub, subOnce, unsubAll} from './relays';
import { sub, subOnce, unsubAll } from './relays';
import { Event } from 'nostr-tools';
type SubCallback = (
@ -21,7 +21,7 @@ export const subGlobalFeed = (onEvent: SubCallback) => {
onEvent(evt, relay);
},
filter: {
...(prefix && {ids: ['0'.repeat(prefix)]}),
...(prefix && { ids: ['0'.repeat(prefix)] }),
kinds: [1],
since: Math.floor((Date.now() * 0.001) - (24 * 60 * 60)),
limit: 500,
@ -84,12 +84,12 @@ export const subGlobalFeed = (onEvent: SubCallback) => {
});
},
filter: {
...(prefix && {ids: ['0'.repeat(prefix)]}),
...(prefix && { ids: ['0'.repeat(prefix)] }),
kinds: [1],
since: now,
},
});
};
};
/** subscribe to global feed */
export const simpleSub24hFeed = (onEvent: SubCallback) => {
@ -158,16 +158,14 @@ export const subNote = (
}, 2000);
replies.add(eventId);
setTimeout(() => {
// subscribe to future replies
sub({
cb: onReply,
filter: {
'#e': [eventId],
kinds: [1],
},
unsub: true, // TODO: probably keep this subscription also after onReply/unsubAll
});
}, 200);
};
/** quick subscribe to a note id (nip-19) */