summaryrefslogtreecommitdiff
path: root/src/routes/account
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-05-18 22:04:52 -0600
committerHombreLaser <sebastian-440@live.com>2023-05-18 22:04:52 -0600
commit44a016256717b871ada858d5dc064d9d0e06425e (patch)
tree008bb13cc1b10355f335e24e46d0d74e85669364 /src/routes/account
parent2cc3bd2a5ab71ced121ea6e8fef3be5db2b98e4f (diff)
Añade creación de direcciones
Diffstat (limited to 'src/routes/account')
-rw-r--r--src/routes/account/addresses/create.tsx18
-rw-r--r--src/routes/account/addresses/edit.tsx7
2 files changed, 22 insertions, 3 deletions
diff --git a/src/routes/account/addresses/create.tsx b/src/routes/account/addresses/create.tsx
new file mode 100644
index 0000000..5e33a2a
--- /dev/null
+++ b/src/routes/account/addresses/create.tsx
@@ -0,0 +1,18 @@
+import { useActionData } from "react-router-dom";
+import AddressForm from "../../../components/forms/address_form";
+import MainContentLayout from "../../../components/main_content_layout";
+
+export function Create() {
+ const errors = useActionData();
+
+ return (
+ <MainContentLayout>
+ <div className="w-4/5 my-6">
+ <h1 className="my-6 text-3xl">
+ Nueva dirección
+ </h1>
+ <AddressForm errors={errors}/>
+ </div>
+ </MainContentLayout>
+ );
+} \ No newline at end of file
diff --git a/src/routes/account/addresses/edit.tsx b/src/routes/account/addresses/edit.tsx
index 31bfaed..65c7b9a 100644
--- a/src/routes/account/addresses/edit.tsx
+++ b/src/routes/account/addresses/edit.tsx
@@ -1,17 +1,18 @@
import AddressForm from "../../../components/forms/address_form";
-import { useLoaderData } from "react-router-dom";
+import { useLoaderData, useActionData } from "react-router-dom";
import MainContentLayout from "../../../components/main_content_layout";
export function Edit() {
const address = useLoaderData().data.data.attributes;
+ const errors = useActionData();
return(
<MainContentLayout>
<div className="w-4/5 my-6">
<h1 className="my-6 text-3xl">
- Editar cuenta
+ Editar dirección
</h1>
- <AddressForm address={address}/>
+ <AddressForm address={address} errors={errors}/>
</div>
</MainContentLayout>
);