refactor: remove unused hook

This commit is contained in:
Alejandro Gomez 2023-07-06 16:40:35 +02:00
parent a57cc7f85b
commit 7dce7f5a73
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
3 changed files with 4 additions and 25 deletions

View File

@ -42,7 +42,9 @@ export function Goal({
className="progress-indicator"
style={{ transform: `translateX(-${100 - progress}%)` }}
>
<span className="amount so-far">{formatSats(soFar)}</span>
{!isFinished && (
<span className="amount so-far">{formatSats(soFar)}</span>
)}
</Progress.Indicator>
<span className="amount target">Goal: {formatSats(goalAmount)}</span>
</Progress.Root>

View File

@ -1,16 +1,9 @@
.add-stream {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
}
.new-goal .h3 {
font-size: 24px;
margin: 0;
}
.zap-goals {
.new-goal .zap-goals {
display: flex;
align-items: center;
gap: 8px;

View File

@ -25,19 +25,3 @@ export function useGoal(link: NostrLink, leaveOpen = true) {
return data?.at(0);
}
export function useGoalZaps(goal: NostrEvent) {
const a = findTag(goal, "a") ?? "";
const sub = useMemo(() => {
const b = new RequestBuilder(`goal-zaps:${goal.id.slice(0, 12)}`);
b.withFilter()
.kinds([EventKind.ZapReceipt])
.tag("e", [goal.id])
.tag("p", [goal.pubkey]); // todo: ability to tag one or more p in goals?
return b;
}, [goal]);
const { data } = useRequestBuilder<FlatNoteStore>(System, FlatNoteStore, sub);
return data ?? [];
}