Skip to content

Commit

Permalink
chore(deps): update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo-battista committed Apr 11, 2024
1 parent 256ef32 commit 10192c1
Show file tree
Hide file tree
Showing 17 changed files with 234 additions and 122 deletions.
2 changes: 1 addition & 1 deletion examples/nextjs-base/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_ARKE_SERVER_URL=http://0.0.0.0:4000
NEXTAUTH_URL=http://localhost:3000/next/api/auth
NEXTAUTH_SECRET=your_secret
NEXT_PUBLIC_ARKE_PROJECT=timesheet
NEXT_PUBLIC_ARKE_PROJECT=nextjs-base
1 change: 1 addition & 0 deletions examples/nextjs-base/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
output: "standalone",
async rewrites() {
return [{ source: "/next/api/:path*", destination: "/api/:path*" }];
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@arkejs/client": "^2.9.1",
"@arkejs/client": "^2.9.5",
"next": "14.0.4",
"next-auth": "^4.24.5",
"react": "^18",
Expand Down
14 changes: 7 additions & 7 deletions examples/nextjs-base/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion examples/nextjs-pages-base/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_ARKE_SERVER_URL=http://0.0.0.0:4000
NEXTAUTH_URL=http://localhost:3000/api/auth
NEXTAUTH_SECRET=your_secret
NEXT_PUBLIC_ARKE_PROJECT=nextjs-base
NEXT_PUBLIC_ARKE_PROJECT=nextjs-pages-base
10 changes: 7 additions & 3 deletions examples/nextjs-pages-base/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
reactStrictMode: false,
output: "standalone",
async rewrites() {
return [{ source: "/next/api/:path*", destination: "/api/:path*" }];
},
};

module.exports = nextConfig
module.exports = nextConfig;
4 changes: 2 additions & 2 deletions examples/nextjs-pages-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@arkejs/client": "^2.2.0",
"@arkejs/ui": "^0.27.0",
"@arkejs/client": "^2.9.5",
"@arkejs/ui": "^0.29.5",
"@types/node": "20.2.5",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
Expand Down
67 changes: 55 additions & 12 deletions examples/nextjs-pages-base/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion examples/nextjs-pages-crud/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_ARKE_SERVER_URL=http://0.0.0.0:4000/lib
NEXT_PUBLIC_ARKE_SERVER_URL=http://0.0.0.0:4000
NEXTAUTH_URL=http://localhost:3000/api/auth
NEXTAUTH_SECRET=your_secret
NEXT_PUBLIC_ARKE_PROJECT=nextjs-crud
63 changes: 31 additions & 32 deletions examples/nextjs-pages-crud/components/Crud/CrudAddEdit.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode, useEffect, useState } from "react";
import useClient from "@/arke/useClient";
import { Form, FormField } from "@arkejs/form";
import { Field, Form, useForm } from "@arkejs/form";
import useCrud from "@/hooks/useCrud";
import { TResponse, TUnit } from "@arkejs/client";
import { Button, Dialog, Spinner } from "@arkejs/ui";
Expand All @@ -16,7 +16,7 @@ export interface CrudProps {

export default function CrudAddEdit(props: CrudProps) {
const client = useClient();
const [fields, setFields] = useState([]);
const [fields, setFields] = useState<Field[]>([]);
const [loading, setLoading] = useState(true);
const { arke, open, title, id, onClose } = props;
const { onSubmit } = useCrud(arke, id, props.onSubmit);
Expand All @@ -40,6 +40,7 @@ export default function CrudAddEdit(props: CrudProps) {
// Fields
promise
.then((res) => {
console.log(res.data.content);
setFields(res.data.content.parameters as any);
})
.finally(() => setLoading(false));
Expand All @@ -50,37 +51,35 @@ export default function CrudAddEdit(props: CrudProps) {
<Dialog open={!!open} title={title} onClose={onClose}>
{fields.length > 0 ? (
<Form onSubmit={onSubmit} style={{ height: "100%" }} fields={fields}>
{({ fields }) =>
loading ? (
<div
className="flex items-center justify-center"
style={{ minHeight: 300 }}
>
<Spinner />
{loading ? (
<div
className="flex items-center justify-center"
style={{ minHeight: 300 }}
>
<Spinner />
</div>
) : (
<>
<div className="grid gap-4">
{fields.map((field) => (
<Form.Field key={field.id} id={field.id} />
))}
</div>
) : (
<>
<div className="grid gap-4">
{fields.map((field) => (
<FormField key={field.id} id={field.id} />
))}
</div>
<div className="mt-4 flex justify-between gap-4">
<Button
disabled={loading}
className="btn-outlined"
color="primary"
onClick={onClose}
>
Annulla
</Button>
<Button disabled={loading} color="primary" type="submit">
Conferma
</Button>
</div>
</>
)
}
<div className="mt-4 flex justify-between gap-4">
<Button
disabled={loading}
className="btn-outlined"
color="primary"
onClick={onClose}
>
Annulla
</Button>
<Button disabled={loading} color="primary" type="submit">
Conferma
</Button>
</div>
</>
)}
</Form>
) : (
<Spinner />
Expand Down
Loading

0 comments on commit 10192c1

Please sign in to comment.