codex has reworked checkout, but frontend doesnt work

This commit is contained in:
Codex Agent
2025-10-05 20:39:30 +02:00
parent fdaa2bec62
commit d70faf7a9d
35 changed files with 2105 additions and 430 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { Head, Link, useForm, usePage } from '@inertiajs/react';
import React from 'react';
import { Head, Link, useForm } from '@inertiajs/react';
import { useTranslation } from 'react-i18next';
import { useLocalizedRoutes } from '@/hooks/useLocalizedRoutes';
import MarketingLayout from '@/layouts/marketing/MarketingLayout';
interface Package {
@@ -16,6 +17,7 @@ interface Props {
const Home: React.FC<Props> = ({ packages }) => {
const { t } = useTranslation('marketing');
const { localizedPath } = useLocalizedRoutes();
const { data, setData, post, processing, errors, reset } = useForm({
name: '',
email: '',
@@ -24,7 +26,7 @@ const Home: React.FC<Props> = ({ packages }) => {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
post('/kontakt', {
post(localizedPath('/kontakt'), {
onSuccess: () => reset(),
});
};
@@ -46,7 +48,7 @@ const Home: React.FC<Props> = ({ packages }) => {
<h1 className="text-4xl md:text-6xl font-bold mb-4 font-display">{t('home.hero_title')}</h1>
<p className="text-xl md:text-2xl mb-8 font-sans-marketing">{t('home.hero_description')}</p>
<Link
href="/packages"
href={localizedPath('/packages')}
className="bg-white dark:bg-gray-800 text-[#FFB6C1] px-8 py-4 rounded-full font-bold hover:bg-gray-100 dark:hover:bg-gray-700 transition duration-300 inline-block"
>
{t('home.cta_explore')}
@@ -123,14 +125,14 @@ const Home: React.FC<Props> = ({ packages }) => {
<h3 className="text-2xl font-bold mb-2">{pkg.name}</h3>
<p className="text-gray-600 dark:text-gray-300 mb-4">{pkg.description}</p>
<p className="text-3xl font-bold text-[#FFB6C1]">{pkg.price} {t('common.currency.euro')}</p>
<Link href={`/register?package_id=${pkg.id}`} className="mt-4 inline-block bg-[#FFB6C1] text-white px-6 py-2 rounded-full hover:bg-pink-600">
<Link href={`${localizedPath('/register')}?package_id=${pkg.id}`} className="mt-4 inline-block bg-[#FFB6C1] text-white px-6 py-2 rounded-full hover:bg-pink-600">
{t('home.view_details')}
</Link>
</div>
))}
</div>
<div className="text-center">
<Link href="/packages" className="bg-[#FFB6C1] text-white px-8 py-4 rounded-full font-bold hover:bg-pink-600 transition">
<Link href={localizedPath('/packages')} className="bg-[#FFB6C1] text-white px-8 py-4 rounded-full font-bold hover:bg-pink-600 transition">
{t('home.all_packages')}
</Link>
</div>