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

Push to prod #1017

Merged
merged 3 commits into from
Apr 8, 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
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 54
versionName "0.6.2"
versionCode 55
versionName "0.6.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
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.6.2;
MARKETING_VERSION = 1.6.3;
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.6.2;
MARKETING_VERSION = 1.6.3;
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "0.6.0",
"version": "0.6.3",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
Expand Down Expand Up @@ -54,7 +54,7 @@
"@capacitor/toast": "^5.0.6",
"@kobalte/core": "^0.12.6",
"@kobalte/tailwindcss": "^0.9.0",
"@mutinywallet/mutiny-wasm": "0.6.2",
"@mutinywallet/mutiny-wasm": "0.6.3",
"@modular-forms/solid": "^0.20.0",
"@solid-primitives/upload": "^0.0.117",
"@solidjs/meta": "^0.29.3",
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

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

18 changes: 12 additions & 6 deletions src/components/layout/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type TextFieldProps = {
required?: boolean;
multiline?: boolean;
disabled?: boolean;
autoCapitalize?: string;
ref: (element: HTMLInputElement | HTMLTextAreaElement) => void;
onInput: JSX.EventHandler<
HTMLInputElement | HTMLTextAreaElement,
Expand All @@ -32,7 +33,8 @@ export function TextField(props: TextFieldProps) {
"ref",
"onInput",
"onChange",
"onBlur"
"onBlur",
"autoCapitalize"
]);
return (
<KTextField.Root
Expand All @@ -51,18 +53,22 @@ export function TextField(props: TextFieldProps) {
<Show
when={props.multiline}
fallback={
// @ts-expect-error autocapitalize isn't in the props for some reason
<KTextField.Input
{...fieldProps}
type={props.type}
class="w-full rounded-lg bg-white/10 p-2 placeholder-m-grey-400 disabled:text-m-grey-400"
/>
}
>
<KTextField.TextArea
{...fieldProps}
autoResize
class="w-full rounded-lg bg-white/10 p-2 placeholder-neutral-400"
/>
{
// @ts-expect-error autocapitalize isn't in the props for some reason
<KTextField.TextArea
{...fieldProps}
autoResize
class="w-full rounded-lg bg-white/10 p-2 placeholder-neutral-400"
/>
}
</Show>
<KTextField.ErrorMessage class="text-sm text-m-red">
{props.error}
Expand Down
5 changes: 3 additions & 2 deletions src/routes/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
BackPop,
Button,
ButtonLink,
DefaultMain,
LargeHeader,
NiceP,
TextField,
Expand Down Expand Up @@ -172,7 +173,7 @@ export function Feedback() {
const setupError = state?.setupError || undefined;

return (
<VStack>
<DefaultMain>
<BackPop default="/" />
<Switch>
<Match when={submitted()}>
Expand Down Expand Up @@ -209,6 +210,6 @@ export function Feedback() {
<Show when={!setupError}>
<NavBar activeTab="send" />
</Show>
</VStack>
</DefaultMain>
);
}
25 changes: 18 additions & 7 deletions src/routes/settings/LightningAddress.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Capacitor } from "@capacitor/core";
import {
createForm,
custom,
required,
reset,
SubmitHandler
Expand Down Expand Up @@ -40,6 +41,12 @@ type HermesForm = {
name: string;
};

const validateLowerCase = (value?: string) => {
if (!value) return false;
const valid = /^[a-z0-9-_.]+$/;
return valid.test(value);
};

// todo(paul) put this somewhere else
function HermesForm(props: { onSubmit: (name: string) => void }) {
const [state, _] = useMegaStore();
Expand All @@ -62,7 +69,7 @@ function HermesForm(props: { onSubmit: (name: string) => void }) {
setSuccess("");
setError(undefined);
try {
const name = f.name.trim();
const name = f.name.trim().toLowerCase();
const available =
await state.mutiny_wallet?.check_available_lnurl_name(name);
if (!available) {
Expand All @@ -73,15 +80,12 @@ function HermesForm(props: { onSubmit: (name: string) => void }) {

const formattedName = `${name}@${hermesDomain}`;

const existingProfile = state.mutiny_wallet?.get_nostr_profile();

const _ = await state.mutiny_wallet?.edit_nostr_profile(
undefined,
undefined,
// lnurl
formattedName,
// nip05 if they don't have one
existingProfile?.nip05 ? undefined : formattedName
undefined
);
reset(nameForm);
props.onSubmit(name);
Expand All @@ -94,19 +98,26 @@ function HermesForm(props: { onSubmit: (name: string) => void }) {
return (
<Form onSubmit={handleSubmit}>
<VStack>
<Field name="name" validate={[required("Must not be empty")]}>
<Field
name="name"
validate={[
required("Must not be empty"),
custom(validateLowerCase, "Address must be lowercase")
]}
>
{(field, props) => (
<div class="flex w-full flex-1 gap-2">
<div class="flex-1">
<TextField
{...props}
{...field}
autoCapitalize="none"
error={field.error}
label={"Nym"}
required
/>
</div>
<div class="flex-0 self-end pb-2 text-2xl text-m-grey-350">
<div class="flex-0 self-start pt-8 text-2xl text-m-grey-350">
@{hermesDomain}
</div>
</div>
Expand Down
Loading