summaryrefslogtreecommitdiff
path: root/src/routes/account
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-05-15 20:35:39 -0600
committerHombreLaser <sebastian-440@live.com>2023-05-15 20:35:39 -0600
commitd138c15dcd4272cd2358d28867ef35d1550b39cd (patch)
tree5807176d23b26bb2851a7c7a341ddc3f48eb4623 /src/routes/account
parentcbebedd51e1b4a2f709341b792dd073bac83f15d (diff)
Mejora renderizado de formularios
Diffstat (limited to 'src/routes/account')
-rw-r--r--src/routes/account/addresses/edit.tsx18
-rw-r--r--src/routes/account/edit.tsx24
2 files changed, 21 insertions, 21 deletions
diff --git a/src/routes/account/addresses/edit.tsx b/src/routes/account/addresses/edit.tsx
new file mode 100644
index 0000000..31bfaed
--- /dev/null
+++ b/src/routes/account/addresses/edit.tsx
@@ -0,0 +1,18 @@
+import AddressForm from "../../../components/forms/address_form";
+import { useLoaderData } from "react-router-dom";
+import MainContentLayout from "../../../components/main_content_layout";
+
+export function Edit() {
+ const address = useLoaderData().data.data.attributes;
+
+ return(
+ <MainContentLayout>
+ <div className="w-4/5 my-6">
+ <h1 className="my-6 text-3xl">
+ Editar cuenta
+ </h1>
+ <AddressForm address={address}/>
+ </div>
+ </MainContentLayout>
+ );
+} \ No newline at end of file
diff --git a/src/routes/account/edit.tsx b/src/routes/account/edit.tsx
index c2dfcb5..a78d8a7 100644
--- a/src/routes/account/edit.tsx
+++ b/src/routes/account/edit.tsx
@@ -1,11 +1,11 @@
import MainContentLayout from "../../components/main_content_layout";
+import AccountForm from "../../components/forms/account_form";
import Token from "../../lib/token";
-import { Form, useLoaderData } from "react-router-dom";
+import { useLoaderData } from "react-router-dom";
import "../../components/stylesheets/shared.css";
export function EditAccount() {
const account = useLoaderData()[0].data.data.attributes;
- const token = new Token();
return(
<>
@@ -14,25 +14,7 @@ export function EditAccount() {
<h1 className="my-6 text-3xl">
Editar cuenta
</h1>
- <Form method="post" id="account-form">
- <div className="mb-6">
- <label className="block mb-2 text-lg text-gray-900 dark:text-white">Correo electrónico</label>
- <input type="email" id="email" name="email" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder={account.email}/>
- </div>
- <div className="mb-6">
- <label className="block mb-2 text-lg text-gray-900 dark:text-white">Nombre</label>
- <input type="text" id="first_name" name="first_name" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder={account.first_name}/>
- </div>
- <div className="mb-6">
- <label className="block mb-2 text-lg text-gray-900 dark:text-white">Apellido</label>
- <input type="text" id="last_name" name="last_name" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder={account.last_name}/>
- </div>
- <div className="mb-6">
- <label className="block mb-2 text-lg text-gray-900 dark:text-white">Contraseña</label>
- <input type="password" id="password" name="password" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"/>
- </div>
- <button type="submit" className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Enviar</button>
- </Form>
+ <AccountForm account={account}/>
</div>
</MainContentLayout>
</>