From c5bf39cfd46949491c54e8719e47a9764c4e502c Mon Sep 17 00:00:00 2001 From: benalleng Date: Wed, 21 Jun 2023 14:03:11 -0400 Subject: [PATCH] feat: fix frontend based lint errors --- src/components/Activity.tsx | 14 +++++- src/components/DetailsModal.tsx | 8 +++- src/components/waitlist/Notes.tsx | 7 +-- src/state/megaStore.tsx | 77 +++++++++++++++---------------- 4 files changed, 60 insertions(+), 46 deletions(-) diff --git a/src/components/Activity.tsx b/src/components/Activity.tsx index f4bd103..5eda34a 100644 --- a/src/components/Activity.tsx +++ b/src/components/Activity.tsx @@ -1,7 +1,7 @@ import { NiceP } from "./layout"; import { For, Match, Show, Switch, createEffect, createSignal } from "solid-js"; import { useMegaStore } from "~/state/megaStore"; -import { ActivityItem as MutinyActivity } from "@mutinywallet/mutiny-wasm"; +import { Contact } from "@mutinywallet/mutiny-wasm"; import { ActivityItem, HackActivityType } from "./ActivityItem"; import { DetailsIdModal } from "./DetailsModal"; @@ -39,8 +39,18 @@ export type UtxoItem = { redshifted?: boolean; }; +export type ActivityItem = { + kind: HackActivityType + id: string; + amount_sats: number; + inbound: boolean; + labels: string[]; + contacts: Contact[]; + last_updated: number; +}; + function UnifiedActivityItem(props: { - item: MutinyActivity; + item: ActivityItem; onClick: (id: string, kind: HackActivityType) => void; }) { const click = () => { diff --git a/src/components/DetailsModal.tsx b/src/components/DetailsModal.tsx index 366c19d..dacf644 100644 --- a/src/components/DetailsModal.tsx +++ b/src/components/DetailsModal.tsx @@ -12,7 +12,6 @@ import { } from "solid-js"; import { Hr, ModalCloseButton, TinyButton, VStack } from "~/components/layout"; import { - ChannelClosure, MutinyChannel, MutinyInvoice } from "@mutinywallet/mutiny-wasm"; @@ -35,6 +34,13 @@ import { AmountSmall } from "./Amount"; import { ExternalLink } from "./layout/ExternalLink"; import { InfoBox } from "./InfoBox"; +type ChannelClosure = { + channel_id: string; + node_id: string; + reason: string; + timestamp: number; +}; + export const OVERLAY = "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"; export const DIALOG_POSITIONER = "fixed inset-0 z-50 flex items-center justify-center"; diff --git a/src/components/waitlist/Notes.tsx b/src/components/waitlist/Notes.tsx index b116f2f..f28cb73 100644 --- a/src/components/waitlist/Notes.tsx +++ b/src/components/waitlist/Notes.tsx @@ -1,12 +1,13 @@ import { Component, For, createEffect, createSignal } from "solid-js"; -import { Event, nip19 } from "nostr-tools"; +import { nip19 } from "nostr-tools"; import { Linkify } from "~/components/layout"; type NostrEvent = { content: string; created_at: number; id?: string; + tags: string; }; const Note: Component<{ e: NostrEvent }> = (props) => { @@ -46,7 +47,7 @@ const Note: Component<{ e: NostrEvent }> = (props) => { ); }; -function filterReplies(event: Event) { +function filterReplies(event: NostrEvent) { // If there's a "p" tag or an "e" tag we want to return false, otherwise true for (const tag of event.tags) { if (tag[0] === "p" || tag[0] === "e") { @@ -56,7 +57,7 @@ function filterReplies(event: Event) { return true; } -const Notes: Component<{ notes: Event[] }> = (props) => { +const Notes: Component<{ notes: NostrEvent[] }> = (props) => { return (