mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-23 17:14:23 +01:00
fix some lints
This commit is contained in:
@@ -236,7 +236,7 @@ export function CombinedActivity(props: { limit?: number }) {
|
||||
const txs = await state.mutiny_wallet?.list_onchain() as OnChainTx[];
|
||||
const invoices = await state.mutiny_wallet?.list_invoices() as MutinyInvoice[];
|
||||
|
||||
let activity: ActivityItem[] = [];
|
||||
const activity: ActivityItem[] = [];
|
||||
|
||||
txs.forEach((tx) => {
|
||||
activity.push({ type: "onchain", item: tx, time: tx.confirmation_time?.Confirmed?.time || Date.now() })
|
||||
|
||||
@@ -4,6 +4,10 @@ import { useMegaStore } from "~/state/megaStore";
|
||||
import { satsToUsd } from "~/utils/conversions";
|
||||
import { AmountEditable } from "./AmountEditable";
|
||||
|
||||
const noop = () => {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
const KeyValue: ParentComponent<{ key: string, gray?: boolean }> = (props) => {
|
||||
return (
|
||||
<div class="flex justify-between items-center" classList={{ "text-neutral-400": props.gray }}>
|
||||
@@ -54,7 +58,7 @@ export function AmountCard(props: { amountSats: string, fee?: string, initialOpe
|
||||
<KeyValue key="Amount">
|
||||
<Show when={props.isAmountEditable} fallback={<InlineAmount amount={props.amountSats} />
|
||||
}>
|
||||
<AmountEditable initialOpen={props.initialOpen ?? false} initialAmountSats={props.amountSats.toString()} setAmountSats={props.setAmountSats ? props.setAmountSats : () => { }} />
|
||||
<AmountEditable initialOpen={props.initialOpen ?? false} initialAmountSats={props.amountSats.toString()} setAmountSats={props.setAmountSats ? props.setAmountSats : noop} />
|
||||
</Show>
|
||||
</KeyValue>
|
||||
<KeyValue gray key="+ Fee">
|
||||
@@ -74,7 +78,7 @@ export function AmountCard(props: { amountSats: string, fee?: string, initialOpe
|
||||
<KeyValue key="Amount">
|
||||
<Show when={props.isAmountEditable} fallback={<InlineAmount amount={props.amountSats} />
|
||||
}>
|
||||
<AmountEditable initialOpen={props.initialOpen ?? false} initialAmountSats={props.amountSats.toString()} setAmountSats={props.setAmountSats ? props.setAmountSats : () => { }} />
|
||||
<AmountEditable initialOpen={props.initialOpen ?? false} initialAmountSats={props.amountSats.toString()} setAmountSats={props.setAmountSats ? props.setAmountSats : noop} />
|
||||
</Show>
|
||||
</KeyValue>
|
||||
<USDShower amountSats={props.amountSats} />
|
||||
|
||||
@@ -5,6 +5,7 @@ import close from "~/assets/icons/close.svg";
|
||||
import { SubmitHandler } from '@modular-forms/solid';
|
||||
import { ContactItem } from '~/state/contacts';
|
||||
import { ContactForm } from './ContactForm';
|
||||
import { showToast } from './Toaster';
|
||||
|
||||
export function ContactViewer(props: { contact: ContactItem, gradient: string, saveContact: (contact: ContactItem) => void }) {
|
||||
const [isOpen, setIsOpen] = createSignal(false);
|
||||
@@ -58,7 +59,7 @@ export function ContactViewer(props: { contact: ContactItem, gradient: string, s
|
||||
|
||||
<div class="flex w-full gap-2">
|
||||
<Button layout="flex" intent="green" onClick={() => setIsEditing(true)}>Edit</Button>
|
||||
<Button intent="blue" onClick={() => { }}>Pay</Button>
|
||||
<Button intent="blue" onClick={() => { showToast({ title: "Unimplemented", description: "We don't do that yet" }) }}>Pay</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Match>
|
||||
|
||||
@@ -12,7 +12,7 @@ export function ImportExport() {
|
||||
const [state, _] = useMegaStore()
|
||||
|
||||
async function handleSave() {
|
||||
let json = await state.node_manager?.export_json()
|
||||
const json = await state.node_manager?.export_json()
|
||||
downloadTextFile(json || "", "mutiny-state.json")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Show, createSignal, onMount } from "solid-js";
|
||||
import { Button, ButtonLink, SmallHeader, VStack } from "./layout";
|
||||
import { useMegaStore } from "~/state/megaStore";
|
||||
import { showToast } from "./Toaster";
|
||||
|
||||
export function OnboardWarning() {
|
||||
const [state, actions] = useMegaStore();
|
||||
@@ -25,7 +26,7 @@ export function OnboardWarning() {
|
||||
Do you want to restore an existing Mutiny Wallet?
|
||||
</p>
|
||||
<div class="w-full flex gap-2">
|
||||
<Button intent="green" onClick={() => { }}>Restore</Button>
|
||||
<Button intent="green" onClick={() => { showToast({ title: "Unimplemented", description: "We don't do that yet" }) }}>Restore</Button>
|
||||
<Button onClick={actions.dismissRestorePrompt}>Nope</Button>
|
||||
</div>
|
||||
</VStack>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Back } from "~/assets/svg/Back";
|
||||
|
||||
export function BackButton(props: { onClick: () => void, title?: string }) {
|
||||
return (<button onClick={props.onClick} class="text-m-red active:text-m-red/80 text-xl font-semibold no-underline md:hidden flex items-center"><Back />{props.title ? props.title : "Home"}</button>)
|
||||
return (<button onClick={() => props.onClick()} class="text-m-red active:text-m-red/80 text-xl font-semibold no-underline md:hidden flex items-center"><Back />{props.title ? props.title : "Home"}</button>)
|
||||
}
|
||||
@@ -123,7 +123,7 @@ export const NiceP: ParentComponent = (props) => {
|
||||
|
||||
export const TinyButton: ParentComponent<{ onClick: () => void }> = (props) => {
|
||||
return (
|
||||
<button class="py-1 px-2 rounded-lg bg-white/10" onClick={props.onClick}>
|
||||
<button class="py-1 px-2 rounded-lg bg-white/10" onClick={() => props.onClick()}>
|
||||
{props.children}
|
||||
</button>
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { For, Show, createResource } from "solid-js";
|
||||
import NavBar from "~/components/NavBar";
|
||||
import { Button, Card, DefaultMain, LargeHeader, NiceP, NodeManagerGuard, SafeArea, SmallHeader, VStack } from "~/components/layout";
|
||||
import { Button, Card, DefaultMain, LargeHeader, NiceP, NodeManagerGuard, SafeArea, VStack } from "~/components/layout";
|
||||
import { BackLink } from "~/components/layout/BackLink";
|
||||
import { CombinedActivity, Activity as MutinyActivity } from "~/components/Activity";
|
||||
import { CombinedActivity } from "~/components/Activity";
|
||||
import { A } from "solid-start";
|
||||
import settings from '~/assets/icons/settings.svg';
|
||||
import { ContactItem, addContact, editContact, listContacts } from "~/state/contacts";
|
||||
|
||||
@@ -185,7 +185,7 @@ export default function Receive() {
|
||||
</Card>
|
||||
|
||||
<div class="flex-1" />
|
||||
<Button class="w-full flex-grow-0 mb-4" style="" disabled={!amount() || !selectedValues().length} intent="green" onClick={onSubmit}>Create Invoice</Button>
|
||||
<Button class="w-full flex-grow-0 mb-4" disabled={!amount() || !selectedValues().length} intent="green" onClick={onSubmit}>Create Invoice</Button>
|
||||
</div>
|
||||
</Match>
|
||||
<Match when={unified() && receiveState() === "show"}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Reader from "~/components/Reader";
|
||||
import { createEffect, createSignal, onMount, Show } from "solid-js";
|
||||
import { createEffect, createSignal, onMount } from "solid-js";
|
||||
import { useNavigate } from "solid-start";
|
||||
import { Button } from "~/components/layout";
|
||||
import init, { PaymentParams } from "@mutinywallet/waila-wasm";
|
||||
@@ -76,12 +76,8 @@ export default function Scanner() {
|
||||
});
|
||||
}
|
||||
|
||||
let waila;
|
||||
|
||||
onMount(() => {
|
||||
init().then((w) => {
|
||||
waila = w;
|
||||
});
|
||||
onMount(async () => {
|
||||
await init()
|
||||
})
|
||||
|
||||
// When we have a nice result we can head over to the send screen
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
export function downloadTextFile(content: string, fileName: string) {
|
||||
const contentType = "application/json";
|
||||
var a = document.createElement("a");
|
||||
var file = new Blob([content], { type: contentType });
|
||||
const a = document.createElement("a");
|
||||
const file = new Blob([content], { type: contentType });
|
||||
a.href = URL.createObjectURL(file);
|
||||
a.download = fileName;
|
||||
a.click();
|
||||
|
||||
@@ -14,9 +14,7 @@ async function generateGradientFromHashedString(str: string) {
|
||||
}
|
||||
|
||||
export async function gradientsPerContact(contacts: ContactItem[]) {
|
||||
//
|
||||
// let gradients: { [key: string]: string } = {};
|
||||
let gradients = new Map();
|
||||
const gradients = new Map();
|
||||
for (const contact of contacts) {
|
||||
const gradient = await generateGradientFromHashedString(contact.name);
|
||||
gradients.set(contact.id, gradient);
|
||||
|
||||
Reference in New Issue
Block a user