Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.5 to Prod #841

Merged
merged 11 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ just test-ui

### Formatting

Hopefully your editor picks up on the `.prettirrc` file and auto formats accordingly. If you want to format everything in the project run `pnpm run format`.
Hopefully your editor picks up on the `prettier.config.mjs` file and auto formats accordingly. If you want to format everything in the project run `pnpm run format`.

### Deploying Web

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.mutinywallet.mutinywallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 45
versionName "0.5.3"
versionCode 46
versionName "0.5.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
16 changes: 8 additions & 8 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CapacitorConfig } from '@capacitor/cli';
import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: 'com.mutinywallet.mutinywallet',
backgroundColor: "171717",
appName: 'Mutiny Wallet',
webDir: 'dist/public',
server: {
androidScheme: 'https'
}
appId: "com.mutinywallet.mutinywallet",
backgroundColor: "171717",
appName: "Mutiny Wallet",
webDir: "dist/public",
server: {
androidScheme: "https"
}
};

export default config;
2 changes: 1 addition & 1 deletion e2e/encrypt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
Expand Down
5 changes: 2 additions & 3 deletions e2e/load.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
await page.goto("http://localhost:3420/");
});

test("initial load", async ({ page }) => {
Expand All @@ -20,4 +20,3 @@ test("initial load", async ({ page }) => {

console.log("Page loaded.");
});

2 changes: 1 addition & 1 deletion e2e/restore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";
import { expect, test } from "@playwright/test";

test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:3420/");
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.3;
MARKETING_VERSION = 1.5.5;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -387,7 +387,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.3;
MARKETING_VERSION = 1.5.5;
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "0.5.3",
"version": "0.5.5",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
Expand All @@ -9,7 +9,7 @@
"check-types": "tsc --noemit",
"eslint": "eslint src",
"pre-commit": "pnpm run eslint && pnpm run check-types && pnpm run format",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
"format": "prettier --write \"{.,src/**,e2e/**}/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
"check-format": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\""
},
"type": "module",
Expand Down Expand Up @@ -55,7 +55,7 @@
"@kobalte/core": "^0.9.8",
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.18.1",
"@mutinywallet/mutiny-wasm": "0.5.3",
"@mutinywallet/mutiny-wasm": "0.5.5",
"@mutinywallet/waila-wasm": "^0.2.6",
"@solid-primitives/upload": "^0.0.111",
"@solidjs/meta": "^0.29.1",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions prettier.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/** @type {import("prettier").Options} */
export default {
trailingComma: "none",
tabWidth: 4,
semi: true,
singleQuote: false,
arrowParens: "always",
printWidth: 80,
useTabs: false,
trailingComma: "none",
tabWidth: 4,
semi: true,
singleQuote: false,
arrowParens: "always",
printWidth: 80,
useTabs: false,

plugins: [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss", // MUST come last
],
plugins: [
"@ianvs/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss" // MUST come last
],

tailwindFunctions: ["classList"],
tailwindFunctions: ["classList"],

importOrder: ["<THIRD_PARTY_MODULES>", "", "^[~/]", "", "^[./]"],
importOrder: ["<THIRD_PARTY_MODULES>", "", "^[~/]", "", "^[./]"]
};
67 changes: 58 additions & 9 deletions src/components/AmountEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
Show
} from "solid-js";

import { AmountSmall, BigMoney } from "~/components";
import { useI18n } from "~/i18n/context";
import { AmountSats, BigMoney } from "~/components";
import { useMegaStore } from "~/state/megaStore";
import {
btcFloatRounding,
Expand All @@ -19,17 +18,32 @@ import {
toDisplayHandleNaN
} from "~/utils";

export type MethodChoice = {
method: "lightning" | "onchain";
maxAmountSats?: bigint;
};

// Make sure to update this when we get the fedi option in here!
function methodToIcon(method: MethodChoice["method"]) {
if (method === "lightning") {
return "lightning";
} else if (method === "onchain") {
return "chain";
}
}

export const AmountEditable: ParentComponent<{
initialAmountSats: string | bigint;
setAmountSats: (s: bigint) => void;
maxAmountSats?: bigint;
fee?: string;
frozenAmount?: boolean;
onSubmit?: () => void;
activeMethod?: MethodChoice;
methods?: MethodChoice[];
setChosenMethod?: (method: MethodChoice) => void;
}> = (props) => {
const [state, _actions] = useMegaStore();
const [mode, setMode] = createSignal<"fiat" | "sats">("sats");
const i18n = useI18n();
const [localSats, setLocalSats] = createSignal(
props.initialAmountSats.toString() || "0"
);
Expand Down Expand Up @@ -229,12 +243,47 @@ export const AmountEditable: ParentComponent<{
onFocus={() => focus()}
/>
</div>
<Show when={props.maxAmountSats}>
<p class="flex gap-2 px-4 py-2 text-sm font-light text-m-grey-400 md:text-base">
{`${i18n.t("receive.amount_editable.balance")} `}
<AmountSmall amountSats={props.maxAmountSats!} />
</p>
<Show when={props.methods?.length && props.activeMethod}>
<MethodChooser
methods={props.methods!}
activeMethod={props.activeMethod!}
setChosenMethod={props.setChosenMethod}
/>
</Show>
</div>
);
};

function MethodChooser(props: {
activeMethod: MethodChoice;
methods: MethodChoice[];
setChosenMethod?: (method: MethodChoice) => void;
}) {
function setNextMethod() {
const activeIndex = props.methods.findIndex(
(m) => m.method === props.activeMethod.method
);
const nextMethod =
props.methods[
activeIndex === props.methods.length - 1 ? 0 : activeIndex + 1
];
props.setChosenMethod && props.setChosenMethod(nextMethod);
}
return (
<button
onClick={setNextMethod}
disabled={props.methods.length === 1}
class="flex gap-2 rounded px-2 py-1 text-sm font-light text-m-grey-400 md:text-base"
classList={{
"border-b border-t border-b-white/10 border-t-white/50 bg-neutral-700":
props.methods?.length > 1
}}
>
<AmountSats
amountSats={props.activeMethod.maxAmountSats!}
denominationSize="sm"
icon={methodToIcon(props.activeMethod.method)}
/>
</button>
);
}
6 changes: 3 additions & 3 deletions src/components/LabelCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function LabelCircle(props: {
contact: boolean;
label: boolean;
channel?: HackActivityType;
onError?: () => void;
}) {
const [gradient] = createResource(async () => {
if (props.name && props.contact) {
Expand Down Expand Up @@ -44,8 +43,9 @@ export function LabelCircle(props: {
<img
src={props.image_url}
alt={"image"}
onError={() => {
props.onError && props.onError();
onError={(e) => {
// This doesn't stop the console errors from showing up
e.stopPropagation();
setErrored(true);
}}
/>
Expand Down
71 changes: 0 additions & 71 deletions src/components/MethodChooser.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ export * from "./BigMoney";
export * from "./FeeDisplay";
export * from "./ReceiveWarnings";
export * from "./SimpleInput";
export * from "./MethodChooser";
export * from "./LabelCircle";
6 changes: 4 additions & 2 deletions src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {
"Something went wrong when creating the on-chain address",
amount_editable: {
receive_too_small:
"A setup fee will be deducted from the requested amount.",
"A lightning setup fee might be deducted from the requested amount.",
setup_fee_lightning:
"A lightning setup fee will be charged if paid over lightning.",
too_big_for_beta:
Expand Down Expand Up @@ -120,6 +120,7 @@ export default {
payment_initiated: "Payment Initiated",
payment_sent: "Payment Sent",
destination: "Destination",
no_payment_info: "No payment info",
progress_bar: {
of: "of",
sats_sent: "sats sent"
Expand All @@ -136,6 +137,7 @@ export default {
error_clipboard: "Clipboard not supported",
error_keysend: "Keysend failed",
error_LNURL: "LNURL Pay failed",
error_expired: "Invoice is expired",
payment_pending: "Payment pending",
payment_pending_description:
"It's taking a while, but it's possible this payment may still go through. Please check 'Activity' for the current status.",
Expand All @@ -149,7 +151,7 @@ export default {
more: "Got more to say?",
tracking:
"Mutiny doesn't track or spy on your behavior, so your feedback is incredibly helpful.",
github: "If you'd like support please",
github: "We will not respond to this feedback. If you'd like support please",
create_issue: "create a GitHub issue.",
link: "Feedback?",
feedback_placeholder: "Bugs, feature requests, feedback, etc.",
Expand Down
Loading
Loading