Format with prettier. Use screen mode for invitation import - dialog mode is broken.

This commit is contained in:
2026-03-23 10:15:48 +00:00
parent 7fd89c5663
commit b475b23beb
47 changed files with 1718 additions and 1098 deletions

View File

@@ -3,12 +3,12 @@
* Defines colors, styles, and visual constants used throughout the application.
*/
import type { TextProps } from 'ink';
import type { TextProps } from "ink";
/**
* Color type - supports Ink color names.
*/
export type Color = TextProps['color'];
export type Color = TextProps["color"];
/**
* Color palette for the application.
@@ -16,33 +16,33 @@ export type Color = TextProps['color'];
*/
export const colors = {
// Primary colors
primary: 'cyan' as Color,
secondary: 'blue' as Color,
accent: 'magenta' as Color,
primary: "cyan" as Color,
secondary: "blue" as Color,
accent: "magenta" as Color,
// Status colors
success: 'green' as Color,
warning: 'yellow' as Color,
error: 'red' as Color,
info: 'cyan' as Color,
success: "green" as Color,
warning: "yellow" as Color,
error: "red" as Color,
info: "cyan" as Color,
// Text colors
text: 'white' as Color,
textMuted: 'gray' as Color,
textHighlight: 'whiteBright' as Color,
text: "white" as Color,
textMuted: "gray" as Color,
textHighlight: "whiteBright" as Color,
// Background colors
bg: 'black' as Color,
bgSelected: 'blue' as Color,
bgHover: 'gray' as Color,
bg: "black" as Color,
bgSelected: "blue" as Color,
bgHover: "gray" as Color,
// Border colors
border: 'cyan' as Color,
borderFocused: 'yellowBright' as Color,
borderMuted: 'gray' as Color,
border: "cyan" as Color,
borderFocused: "yellowBright" as Color,
borderMuted: "gray" as Color,
// Focus highlight color (very visible)
focus: 'yellowBright' as Color,
focus: "yellowBright" as Color,
} as const;
/**
@@ -76,7 +76,7 @@ export const logo = `
/**
* Small logo for status bar.
*/
export const logoSmall = 'XO Wallet';
export const logoSmall = "XO Wallet";
/**
* Helper to format satoshis for display.
@@ -84,7 +84,7 @@ export const logoSmall = 'XO Wallet';
* @returns Formatted string with BCH amount
*/
export function formatSatoshis(satoshis: bigint | number): string {
const value = typeof satoshis === 'bigint' ? satoshis : BigInt(satoshis);
const value = typeof satoshis === "bigint" ? satoshis : BigInt(satoshis);
const bch = Number(value) / 100_000_000;
return `${bch.toFixed(8)} BCH (${value.toLocaleString()} sats)`;
}
@@ -97,7 +97,7 @@ export function formatSatoshis(satoshis: bigint | number): string {
*/
export function truncate(str: string, maxLength: number): string {
if (str.length <= maxLength) return str;
return str.slice(0, maxLength - 3) + '...';
return str.slice(0, maxLength - 3) + "...";
}
/**