mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-17 22:34:23 +01:00
lots of tagging works but not sends rn
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { SubmitHandler, createForm, required } from "@modular-forms/solid";
|
||||
import { ContactItem } from "~/state/contacts";
|
||||
import { Button, LargeHeader, VStack } from "~/components/layout";
|
||||
import { TextField } from "~/components/layout/TextField";
|
||||
import { ColorRadioGroup } from "~/components/ColorRadioGroup";
|
||||
import { ContactFormValues } from "./ContactViewer";
|
||||
|
||||
const colorOptions = [{ label: "blue", value: "blue" }, { label: "green", value: "green" }, { label: "red", value: "red" }, { label: "gray", value: "gray" }]
|
||||
|
||||
export function ContactForm(props: { handleSubmit: SubmitHandler<ContactItem>, initialValues?: ContactItem, title: string, cta: string }) {
|
||||
const [_contactForm, { Form, Field }] = createForm<ContactItem>({ initialValues: props.initialValues });
|
||||
export function ContactForm(props: { handleSubmit: SubmitHandler<ContactFormValues>, initialValues?: ContactFormValues, title: string, cta: string }) {
|
||||
const [_contactForm, { Form, Field }] = createForm<ContactFormValues>({ initialValues: props.initialValues });
|
||||
|
||||
return (
|
||||
<Form onSubmit={props.handleSubmit} class="flex flex-col flex-1 justify-around gap-4 max-w-[400px] mx-auto w-full">
|
||||
@@ -24,11 +21,6 @@ export function ContactForm(props: { handleSubmit: SubmitHandler<ContactItem>, i
|
||||
<TextField {...props} placeholder='npub...' value={field.value} error={field.error} label="Nostr npub or NIP-05 (optional)" />
|
||||
)}
|
||||
</Field>
|
||||
<Field name="color">
|
||||
{(field, props) => (
|
||||
<ColorRadioGroup options={colorOptions} {...props} value={field.value} error={field.error} label="Color" />
|
||||
)}
|
||||
</Field>
|
||||
</VStack>
|
||||
</div>
|
||||
<Button type="submit" intent="blue" class="w-full flex-none">
|
||||
|
||||
Reference in New Issue
Block a user