Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit c642097

Browse files
committed
style(web): run eslint
1 parent 161c3a7 commit c642097

File tree

14 files changed

+366
-408
lines changed

14 files changed

+366
-408
lines changed

web/src/app/[...slug]/page.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import React from 'react';
2-
import { getPageContent } from '@/helpers/getPageContent';
3-
import Card from '@/components/common/Card/Card';
1+
import React from "react";
2+
import { getPageContent } from "@/helpers/getPageContent";
3+
import Card from "@/components/common/Card/Card";
44

55
export default async function page({ params }: { params: { slug: string[] } }) {
6-
const { page } = await getPageContent(params.slug);
7-
return (
8-
<div>
9-
{/* <h1>{page.pageTitle}</h1> */}
10-
<Card data={page}></Card>
11-
</div>
12-
);
6+
const { page } = await getPageContent(params.slug);
7+
return (
8+
<div>
9+
{/* <h1>{page.pageTitle}</h1> */}
10+
<Card data={page}></Card>
11+
</div>
12+
);
1313
}

web/src/app/impressum/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default function page() {
2-
return <div>page</div>;
2+
return <div>page</div>;
33
}

web/src/app/layout.tsx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
import { Inter } from 'next/font/google';
2-
import type { Metadata } from 'next';
3-
import '../styles/globals.scss';
4-
import qs from 'qs';
5-
import Layout from '@/components/Layout/Layout';
1+
import { Inter } from "next/font/google";
2+
import type { Metadata } from "next";
3+
import "../styles/globals.scss";
4+
import qs from "qs";
5+
import Layout from "@/components/Layout/Layout";
66

77
const params = {
8-
nested: true,
9-
populate: {
10-
items: {
11-
populate: {
12-
page_relation: true,
13-
},
14-
},
15-
},
8+
nested: true,
9+
populate: {
10+
items: {
11+
populate: {
12+
page_relation: true,
13+
},
14+
},
15+
},
1616
};
1717

18-
const inter = Inter({ subsets: ['latin'] });
18+
const inter = Inter({ subsets: ["latin"] });
1919

2020
export const metadata: Metadata = {
21-
title: 'Vim Landing Page',
22-
description: 'Generated by create next app',
21+
title: "Vim Landing Page",
22+
description: "Generated by create next app",
2323
};
2424

2525
async function getPageProps() {
26-
const query = qs.stringify(params, { addQueryPrefix: true });
27-
const respose = await fetch(`${process.env.CMS_API}/menus/1${query}`, {
28-
// headers: {
29-
// authorization: `Bearer ${process.env.CMS_TOKEN}`,
30-
// },
31-
});
32-
return (await respose.json()).data.attributes.items.data;
26+
const query = qs.stringify(params, { addQueryPrefix: true });
27+
const respose = await fetch(`${process.env.CMS_API}/menus/1${query}`, {
28+
// headers: {
29+
// authorization: `Bearer ${process.env.CMS_TOKEN}`,
30+
// },
31+
});
32+
return (await respose.json()).data.attributes.items.data;
3333
}
3434

3535
export default async function RootLayout({ children }: { children: React.ReactNode }) {
36-
const pageProps = await getPageProps();
36+
const pageProps = await getPageProps();
3737

38-
return (
39-
<html lang="en">
40-
<body className={inter.className}>
41-
<Layout pages={pageProps}>{children}</Layout>
42-
</body>
43-
</html>
44-
);
38+
return (
39+
<html lang="en">
40+
<body className={inter.className}>
41+
<Layout pages={pageProps}>{children}</Layout>
42+
</body>
43+
</html>
44+
);
4545
}

web/src/app/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// .then((res) => console.log(res));
99

1010
export default function Home() {
11-
return (
12-
<main className="flex min-h-screen flex-col items-center justify-between p-24">
13-
<h1>Vim Landing Page</h1>
14-
<button className="btn inverted">Download</button>
15-
</main>
16-
);
11+
return (
12+
<main className="flex min-h-screen flex-col items-center justify-between p-24">
13+
<h1>Vim Landing Page</h1>
14+
<button className="btn inverted">Download</button>
15+
</main>
16+
);
1717
}

web/src/app/registration/page.tsx

Lines changed: 69 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,79 @@
1-
'use client';
2-
import { ChangeEvent, useState } from 'react';
3-
import { getMailValidation } from '@/helpers/validators';
4-
import Input from '@/components/Inputs/TextInput';
1+
"use client";
2+
import { ChangeEvent, useState } from "react";
3+
import { getMailValidation } from "@/helpers/validators";
4+
import Input from "@/components/Inputs/TextInput";
55

66
type RegistrationFormData = {
7-
username: string;
8-
firstname: string;
9-
lastname: string;
10-
email: string;
11-
password: string;
12-
passwordConfirm: string;
7+
username: string;
8+
firstname: string;
9+
lastname: string;
10+
email: string;
11+
password: string;
12+
passwordConfirm: string;
1313
};
1414

1515
export default function Registration() {
16-
const [formData, setFormData] = useState<RegistrationFormData>({
17-
username: '',
18-
firstname: '',
19-
lastname: '',
20-
email: '',
21-
password: '',
22-
passwordConfirm: '',
23-
});
16+
const [formData, setFormData] = useState<RegistrationFormData>({
17+
username: "",
18+
firstname: "",
19+
lastname: "",
20+
email: "",
21+
password: "",
22+
passwordConfirm: "",
23+
});
2424

25-
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
26-
const { name, value } = e.target;
27-
setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
28-
};
25+
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
26+
const { name, value } = e.target;
27+
setFormData(prevFormData => ({ ...prevFormData, [name]: value }));
28+
};
2929

30-
const handlePwValidation = (): string | undefined => {
31-
if (formData.passwordConfirm !== formData.password) return 'Passwords should match';
32-
return undefined;
33-
};
30+
const handlePwValidation = (): string | undefined => {
31+
if (formData.passwordConfirm !== formData.password) return "Passwords should match";
32+
return undefined;
33+
};
3434

35-
return (
36-
<div>
37-
<h1 className="h3">My Account</h1>
38-
<div className="grid grid-cols-1 xl:grid-cols-2 xl:gap-8">
39-
<form className="flex flex-col items-stretch gap-4">
40-
<Input
41-
type="text"
42-
label="Username"
43-
name="username"
44-
id="username"
45-
value={formData.username}
46-
onChange={handleInputChange}
47-
required
48-
/>
49-
<div className="grid grid-cols-1 xl:grid-cols-2 xl:gap-3">
50-
<Input
51-
type="text"
52-
label="First Name"
53-
name="firstname"
54-
id="firstname"
55-
value={formData.firstname}
56-
onChange={handleInputChange}
57-
required
58-
/>
59-
<Input
60-
type="text"
61-
label="Last Name"
62-
name="lastname"
63-
id="lastname"
64-
value={formData.lastname}
65-
onChange={handleInputChange}
66-
required
67-
/>
68-
</div>
69-
<Input
70-
type="text"
71-
label="Email Address"
72-
name="email"
73-
id="email"
74-
value={formData.email}
75-
onChange={handleInputChange}
76-
required
77-
validate={(value) => getMailValidation(value)}
78-
/>
79-
<Input
80-
type="password"
81-
label="Password"
82-
name="password"
83-
id="password"
84-
value={formData.password}
85-
onChange={handleInputChange}
86-
required
87-
/>
88-
<Input
89-
type="password"
90-
label="Confirm Password"
91-
name="passwordConfirm"
92-
id="passwordConfirm"
93-
value={formData.passwordConfirm}
94-
onChange={handleInputChange}
95-
required
96-
validate={handlePwValidation}
97-
/>
98-
<input className="btn ml-auto hover:cursor-pointer" type="submit" value="Register" />
99-
</form>
100-
<div>
101-
<h2 className="text-secondary">Please note</h2>
35+
return (
36+
<div>
37+
<h1 className="h3">My Account</h1>
38+
<div className="grid grid-cols-1 xl:grid-cols-2 xl:gap-8">
39+
<form className="flex flex-col items-stretch gap-4">
40+
<Input type="text" label="Username" name="username" id="username" value={formData.username} onChange={handleInputChange} required />
41+
<div className="grid grid-cols-1 xl:grid-cols-2 xl:gap-3">
42+
<Input type="text" label="First Name" name="firstname" id="firstname" value={formData.firstname} onChange={handleInputChange} required />
43+
<Input type="text" label="Last Name" name="lastname" id="lastname" value={formData.lastname} onChange={handleInputChange} required />
44+
</div>
45+
<Input
46+
type="text"
47+
label="Email Address"
48+
name="email"
49+
id="email"
50+
value={formData.email}
51+
onChange={handleInputChange}
52+
required
53+
validate={value => getMailValidation(value)}
54+
/>
55+
<Input type="password" label="Password" name="password" id="password" value={formData.password} onChange={handleInputChange} required />
56+
<Input
57+
type="password"
58+
label="Confirm Password"
59+
name="passwordConfirm"
60+
id="passwordConfirm"
61+
value={formData.passwordConfirm}
62+
onChange={handleInputChange}
63+
required
64+
validate={handlePwValidation}
65+
/>
66+
<input className="btn ml-auto hover:cursor-pointer" type="submit" value="Register" />
67+
</form>
68+
<div>
69+
<h2 className="text-secondary">Please note</h2>
10270

103-
<p>
104-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel est adipisci quas, aperiam
105-
voluptas, omnis tempora blanditiis quae fuga eum ullam commodi a perspiciatis provident pariatur
106-
sunt excepturi doloremque! Commodi!
107-
</p>
108-
</div>
109-
</div>
110-
</div>
111-
);
71+
<p>
72+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel est adipisci quas, aperiam voluptas, omnis tempora blanditiis quae fuga eum ullam
73+
commodi a perspiciatis provident pariatur sunt excepturi doloremque! Commodi!
74+
</p>
75+
</div>
76+
</div>
77+
</div>
78+
);
11279
}

0 commit comments

Comments
 (0)