npub doesn't work so hide from contact form

This commit is contained in:
Paul Miller
2023-05-11 10:56:09 -05:00
parent cbd990d820
commit 7c802fde54
6 changed files with 9 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ const SubtleText: ParentComponent = (props) => {
function OnChainItem(props: { item: OnChainTx, labels: MutinyTagItem[] }) {
const [store, actions] = useMegaStore();
const isReceive = createMemo(() => props.item.received > 0);
const isReceive = () => props.item.received > props.item.sent
const [open, setOpen] = createSignal(false)

View File

@@ -16,11 +16,11 @@ export function ContactForm(props: { handleSubmit: SubmitHandler<ContactFormValu
<TextField {...props} placeholder='Satoshi' value={field.value} error={field.error} label="Name" />
)}
</Field>
<Field name="npub" validate={[]}>
{/* <Field name="npub" validate={[]}>
{(field, props) => (
<TextField {...props} placeholder='npub...' value={field.value} error={field.error} label="Nostr npub or NIP-05 (optional)" />
)}
</Field>
</Field> */}
</VStack>
</div>
<Button type="submit" intent="blue" class="w-full flex-none">

View File

@@ -18,7 +18,8 @@ export function ContactViewer(props: { contact: Contact, gradient: string, saveC
const handleSubmit: SubmitHandler<ContactFormValues> = (c: ContactFormValues) => {
// FIXME: merge with existing contact if saving (need edit contact method)
const contact = new Contact(c.name, c.npub ?? undefined, undefined, undefined)
// FIXME: npub not valid? other undefineds
const contact = new Contact(c.name, undefined, undefined, undefined)
props.saveContact(contact)
setIsEditing(false)
}

View File

@@ -47,6 +47,7 @@ export function TagEditor(props: {
async function createContact(contact: ContactFormValues) {
// FIXME: undefineds
// FIXME: npub not valid? other undefineds
const c = new Contact(contact.name, undefined, undefined, undefined);
const newContactId = await state.mutiny_wallet?.create_new_contact(c);
const contactItem = await state.mutiny_wallet?.get_contact(newContactId ?? "");

View File

@@ -30,7 +30,8 @@ function ContactRow() {
const [gradients] = createResource(contacts, gradientsPerContact);
async function createContact(contact: ContactFormValues) {
const c = new Contact(contact.name, contact.npub ?? undefined, undefined, undefined);
// FIXME: npub not valid? other undefineds
const c = new Contact(contact.name, undefined, undefined, undefined);
await state.mutiny_wallet?.create_new_contact(c)
refetch();
}

View File

@@ -341,7 +341,7 @@ export default function Redshift() {
<Match when={shiftStage() === "choose"}>
<VStack>
<NiceP>Where is this going?</NiceP>
<StyledRadioGroup red value={shiftType()} onValueChange={(newValue) => setShiftType(newValue as ShiftOption)} choices={SHIFT_OPTIONS} />
<StyledRadioGroup accent="red" value={shiftType()} onValueChange={(newValue) => setShiftType(newValue as ShiftOption)} choices={SHIFT_OPTIONS} />
</VStack>
<VStack>
<NiceP>Choose your <span class="inline-block"><img class="h-4" src={wave} alt="sine wave" /></span> UTXO to begin</NiceP>