diff --git a/src/components/Activity.tsx b/src/components/Activity.tsx index b1195adf..23d99931 100644 --- a/src/components/Activity.tsx +++ b/src/components/Activity.tsx @@ -1,14 +1,15 @@ import { TagItem } from "@mutinywallet/mutiny-wasm"; -import { cache, createAsync, revalidate } from "@solidjs/router"; -import { Plus, Search, Shuffle } from "lucide-solid"; +import { cache, createAsync, revalidate, useNavigate } from "@solidjs/router"; +import { Plus, Save, Search, Shuffle } from "lucide-solid"; import { createEffect, createSignal, For, Match, Show, Switch } from "solid-js"; import { ActivityDetailsModal, - Card, + ButtonCard, HackActivityType, NiceP } from "~/components"; +import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; import { timeAgo } from "~/utils"; @@ -145,10 +146,12 @@ export function UnifiedActivityItem(props: { export function CombinedActivity() { const [state, _actions] = useMegaStore(); + const i18n = useI18n(); const [detailsOpen, setDetailsOpen] = createSignal(false); const [detailsKind, setDetailsKind] = createSignal(); const [detailsId, setDetailsId] = createSignal(""); + const navigate = useNavigate(); function openDetailsModal(id: string, kind: HackActivityType) { console.log("Opening details modal: ", id, kind); @@ -195,36 +198,40 @@ export function CombinedActivity() { - - Welcome to the Mutiny. - - - {/* TODO: copywriting lol */} - - - - {" "} - to receive your first sats. - - {/* - {i18n.t( - "activity.receive_some_sats_to_get_started" - )} - */} - - - - - - {" "} - to find your friends on nostr. - - - - Don't forget to back up your seed words! - + navigate("/receive")}> +
+ + {i18n.t("home.receive")} +
+
+ navigate("/search")}> +
+ + {i18n.t("home.find")} +
+
+ + navigate("/settings/backup")} + > +
+ + {i18n.t("home.backup")} +
+
+
= 0}> + + navigate("/settings/backup")} + > +
+ + {i18n.t("home.backup")} +
+
+
{(activityItem) => ( diff --git a/src/components/ActualSearch.tsx b/src/components/ActualSearch.tsx index 53ae901b..b8c5404d 100644 --- a/src/components/ActualSearch.tsx +++ b/src/components/ActualSearch.tsx @@ -266,11 +266,6 @@ export function ActualSearch(props: { initialValue?: string }) {
- {/* - }> - - - */} ); @@ -61,8 +69,8 @@ export function Fab(props: { onSearch: () => void; onScan: () => void }) {
  • { - setOpen(false); props.onSearch(); + setOpen(false); }} > @@ -105,6 +113,7 @@ export function MiniFab(props: { onSend: () => void; onRequest: () => void; onScan: () => void; + sendDisabled?: boolean | undefined; }) { const [open, setOpen] = createSignal(false); return ( @@ -114,9 +123,10 @@ export function MiniFab(props: {
    • { - setOpen(false); props.onSend(); + setOpen(false); }} > @@ -126,8 +136,8 @@ export function MiniFab(props: {
    • { - setOpen(false); props.onRequest(); + setOpen(false); }} > @@ -138,8 +148,8 @@ export function MiniFab(props: {
    • { - setOpen(false); props.onScan(); + setOpen(false); }} > diff --git a/src/components/GenericItem.tsx b/src/components/GenericItem.tsx index d6f1cfec..80b59304 100644 --- a/src/components/GenericItem.tsx +++ b/src/components/GenericItem.tsx @@ -96,7 +96,7 @@ export function GenericItem(props: { {/* OPTIONAL MESSAGE */} -
      +
      {props.message}
      diff --git a/src/components/HomeSubnav.tsx b/src/components/HomeSubnav.tsx index 7a4e9341..b3cc57c2 100644 --- a/src/components/HomeSubnav.tsx +++ b/src/components/HomeSubnav.tsx @@ -63,7 +63,7 @@ export function HomeSubnav() { }} onClick={() => setActiveView("everybody")} > - Everybody + Friends
      - - - No pending requests. Maybe you want to add a{" "} - Wallet Connection? - - + navigate("/settings/connections")}> +
      + + {i18n.t("home.connection")} +
      +
      ); diff --git a/src/components/index.ts b/src/components/index.ts index 9fff0968..d7dce2f6 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -27,7 +27,6 @@ export * from "./Logo"; export * from "./Logs"; export * from "./MoreInfoModal"; export * from "./NavBar"; -export * from "./OnboardWarning"; export * from "./PendingNwc"; export * from "./Reader"; export * from "./Reload"; diff --git a/src/components/layout/Misc.tsx b/src/components/layout/Misc.tsx index 1c87a049..360ea30a 100644 --- a/src/components/layout/Misc.tsx +++ b/src/components/layout/Misc.tsx @@ -49,6 +49,20 @@ export const Card: ParentComponent<{ ); }; +export const ButtonCard: ParentComponent<{ + onClick: () => void; +}> = (props) => { + return ( + + ); +}; + export const InnerCard: ParentComponent<{ title?: string }> = (props) => { return (
      diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 2d96b311..96ff649c 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -27,6 +27,17 @@ export default { "Mutiny is running in safe mode. Lightning is disabled.", self_hosted: "Self-hosted" }, + home: { + receive: "Receive your first sats", + find: "Find your friends on nostr", + backup: "Secure your funds!", + connection: "Create a wallet connection" + }, + profile: { + nostr_identity: "Nostr Identity", + add_lightning_address: "Add Lightning Address", + edit_profile: "Edit Profile" + }, contacts: { new: "new", add_contact: "Add Contact", diff --git a/src/routes/Chat.tsx b/src/routes/Chat.tsx index 57e183e2..777b9f7b 100644 --- a/src/routes/Chat.tsx +++ b/src/routes/Chat.tsx @@ -73,6 +73,7 @@ function SingleMessage(props: { } if (result.value?.invoice) { + console.log("about to get invoice"); try { const alreadyPaid = await state.mutiny_wallet?.get_invoice( result.value.invoice @@ -267,13 +268,19 @@ export function Chat() { const [sending, setSending] = createSignal(false); const contact = createAsync(async () => { - return state.mutiny_wallet?.get_tag_item(params.id); + try { + return state.mutiny_wallet?.get_tag_item(params.id); + } catch (e) { + console.error("couldn't find contact"); + console.error(e); + return undefined; + } }); const [convo, { refetch }] = createResource( contact, - async (contact: TagItem, info) => { - // if (!contact() || !contact()?.npub) return undefined; + async (contact?: TagItem) => { + if (!contact || !contact?.npub) return undefined; if (!contact.npub) return [] as CombinedMessagesAndActivity[]; try { const activity = await state.mutiny_wallet?.get_label_activity( @@ -281,8 +288,6 @@ export function Chat() { ); console.log("activity", activity); - const refetchingTimestamp = info.refetching as bigint; - console.log("refetching since", refetchingTimestamp); const convo = await state.mutiny_wallet?.get_dm_conversation( contact.npub, 20n, @@ -309,13 +314,13 @@ export function Chat() { const a_time = isDirectMessage(a.content) ? a.content.date : isActivityItem(a.content) - ? a.content.last_updated - : 0; + ? a.content.last_updated + : 0; const b_time = isDirectMessage(b.content) ? b.content.date : isActivityItem(b.content) - ? b.content.last_updated - : 0; + ? b.content.last_updated + : 0; return b_time - a_time; // Descending order }); @@ -453,14 +458,21 @@ export function Chat() {
      -
      +
      - {/* TODO handle onscan */} {}} + onScan={() => navigate("/scanner")} onSend={() => { sendToContact(contact()); }} + sendDisabled={ + !contact() || + !(contact()?.ln_address || contact()?.lnurl) + } onRequest={() => requestFromContact(contact())} /> */} - diff --git a/src/routes/Profile.tsx b/src/routes/Profile.tsx index b5868b22..61ddff4f 100644 --- a/src/routes/Profile.tsx +++ b/src/routes/Profile.tsx @@ -1,5 +1,5 @@ import { A } from "@solidjs/router"; -import { createMemo, Show } from "solid-js"; +import { createMemo, Match, Show, Switch } from "solid-js"; import { QRCodeSVG } from "solid-qr-code"; import { @@ -14,10 +14,12 @@ import { NavBar, SafeArea } from "~/components"; +import { useI18n } from "~/i18n/context"; import { useMegaStore } from "~/state/megaStore"; export function Profile() { const [state, _actions] = useMegaStore(); + const i18n = useI18n(); const npub = () => state.mutiny_wallet?.get_npub(); @@ -27,8 +29,7 @@ export function Profile() { return { name: profile?.display_name || profile?.name || "Anon", picture: profile?.picture || undefined, - // TODO: this but for real - lud16: profile?.lud16 || "elegant-giraffe@mutiny.plus" + lud16: profile?.lud16 || undefined }; }); @@ -56,36 +57,41 @@ export function Profile() { -

      - {profile().lud16} -

      + + +

      + {profile().lud16} +

      +
      + +
      +
      + + + {i18n.t( + "profile.add_lightning_address" + )} + + +
      -
      - -
      - Edit Profile - - - - - - Create Profile + {i18n.t("profile.edit_profile")}
      {/* Accounts */} - + diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index a6205282..0c48e067 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -810,7 +810,8 @@ export function Send() {