diff --git a/.beads/last-touched b/.beads/last-touched index 5024756..7e151e6 100644 --- a/.beads/last-touched +++ b/.beads/last-touched @@ -1 +1 @@ -fotospiel-app-cbnv +fotospiel-app-5aa diff --git a/resources/js/pages/auth/register.tsx b/resources/js/pages/auth/register.tsx deleted file mode 100644 index 22d32d6..0000000 --- a/resources/js/pages/auth/register.tsx +++ /dev/null @@ -1,373 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { useForm } from '@inertiajs/react'; -import { useTranslation } from 'react-i18next'; -import { LoaderCircle, User, Mail, Phone, Lock, MapPin } from 'lucide-react'; -import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/components/ui/dialog'; - -interface RegisterProps { - package?: { - id: number; - name: string; - description: string; - price: number; - } | null; - privacyHtml?: string; -} - -import MarketingLayout from '@/layouts/mainWebsite'; - -export default function Register({ package: initialPackage, privacyHtml }: RegisterProps) { - const [privacyOpen, setPrivacyOpen] = useState(false); - const [hasTriedSubmit, setHasTriedSubmit] = useState(false); - const { t } = useTranslation(['auth', 'common']); - - const { data, setData, post, processing, errors, clearErrors } = useForm({ - username: '', - email: '', - password: '', - password_confirmation: '', - first_name: '', - last_name: '', - address: '', - phone: '', - privacy_consent: false, - package_id: initialPackage?.id || null, - }); - - const submit = (e: React.FormEvent) => { - e.preventDefault(); - setHasTriedSubmit(true); - post('/register', { - preserveScroll: true, - }); - }; - - useEffect(() => { - if (!hasTriedSubmit) { - return; - } - - const errorKeys = Object.keys(errors); - if (errorKeys.length === 0) { - return; - } - - const firstError = errorKeys[0]; - const field = document.querySelector(`[name="${firstError}"]`); - - if (field) { - field.scrollIntoView({ behavior: 'smooth', block: 'center' }); - field.focus(); - } - }, [errors, hasTriedSubmit]); - - return ( - -
-
-
-
-

- {t('register.welcome')} -

-

- {t('register.description')} -

- {initialPackage && ( -
-

{initialPackage.name}

-

{initialPackage.description}

-

- {initialPackage.price === 0 ? t('register.package_price_free') : t('register.package_price', { price: initialPackage.price })} -

-
- )} -
-
-
-
- -
- - { - setData('first_name', e.target.value); - if (e.target.value.trim() && errors.first_name) { - clearErrors('first_name'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.first_name ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.first_name_placeholder')} - /> -
- {errors.first_name &&

{errors.first_name}

} -
- -
- -
- - { - setData('last_name', e.target.value); - if (e.target.value.trim() && errors.last_name) { - clearErrors('last_name'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.last_name ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.last_name_placeholder')} - /> -
- {errors.last_name &&

{errors.last_name}

} -
- -
- -
- - { - setData('email', e.target.value); - if (e.target.value.trim() && errors.email) { - clearErrors('email'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.email ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.email_placeholder')} - /> -
- {errors.email &&

{errors.email}

} -
- -
- -
- - { - setData('address', e.target.value); - if (e.target.value.trim() && errors.address) { - clearErrors('address'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.address ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.address_placeholder')} - /> -
- {errors.address &&

{errors.address}

} -
- -
- -
- - { - setData('phone', e.target.value); - if (e.target.value.trim() && errors.phone) { - clearErrors('phone'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.phone ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.phone_placeholder')} - /> -
- {errors.phone &&

{errors.phone}

} -
- -
- -
- - { - setData('username', e.target.value); - if (e.target.value.trim() && errors.username) { - clearErrors('username'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.username ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.username_placeholder')} - /> -
- {errors.username &&

{errors.username}

} -
- -
- -
- - { - setData('password', e.target.value); - if (e.target.value.trim() && errors.password) { - clearErrors('password'); - } - if (data.password_confirmation && e.target.value === data.password_confirmation) { - clearErrors('password_confirmation'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.password ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.password_placeholder')} - /> -
- {errors.password &&

{errors.password}

} -
- -
- -
- - { - setData('password_confirmation', e.target.value); - if (e.target.value.trim() && errors.password_confirmation) { - clearErrors('password_confirmation'); - } - if (data.password && e.target.value === data.password) { - clearErrors('password_confirmation'); - } - }} - className={`block w-full pl-10 pr-3 py-3 border rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#FFB6C1] focus:border-[#FFB6C1] sm:text-sm ${errors.password_confirmation ? 'border-red-500' : 'border-gray-300'}`} - placeholder={t('register.password_confirmation_placeholder')} - /> -
- {errors.password_confirmation &&

{errors.password_confirmation}

} -
- -
- { - setData('privacy_consent', e.target.checked); - if (e.target.checked && errors.privacy_consent) { - clearErrors('privacy_consent'); - } - }} - className="h-4 w-4 text-[#FFB6C1] focus:ring-[#FFB6C1] border-gray-300 rounded" - /> - - {errors.privacy_consent &&

{errors.privacy_consent}

} -
-
- - {Object.keys(errors).length > 0 && ( -
-

{t('register.errors_title')}

-
    - {Object.entries(errors).map(([key, value]) => ( -
  • - {t(`register.errors.${key}`)}: {value} -
  • - ))} -
-
- )} - - - -
-

- {t('register.has_account')}{' '} - - {t('register.login')} - -

-
-
-
-
- - - - Datenschutzerklärung - Lesen Sie unsere Datenschutzerklärung. -
- {privacyHtml ? ( -
- ) : ( -

Datenschutzerklärung wird geladen...

- )} -
- -
-
-
- ); -} diff --git a/resources/views/marketing/register.blade.php b/resources/views/marketing/register.blade.php deleted file mode 100644 index 029a509..0000000 --- a/resources/views/marketing/register.blade.php +++ /dev/null @@ -1,168 +0,0 @@ -@extends('layouts.marketing') - -@section('title', __('auth.register')) - -@section('content') -
-
-
-

- {{ __('auth.register') }} -

- @if($package ?? false) -
-

{{ $package->name }}

-

{{ $package->description }}

-

- {{ $package->price == 0 ? __('marketing.register.free') : $package->price . ' ' . __('currency.euro') }} -

-
- @endif -
-
- @csrf - @if($package ?? false) - - @endif - - -
- - - @error('username') -

{{ $message }}

- @enderror -
- - -
- - - @error('email') -

{{ $message }}

- @enderror -
- - -
- - - @error('password') -

{{ $message }}

- @enderror -
- - -
- - -
- - -
- - - @error('first_name') -

{{ $message }}

- @enderror -
- - -
- - - @error('last_name') -

{{ $message }}

- @enderror -
- - -
- - - @error('address') -

{{ $message }}

- @enderror -
- - -
- - - @error('phone') -

{{ $message }}

- @enderror -
- - -
-
- -
-
- - @error('privacy_consent') -

{{ $message }}

- @enderror -
-
- -
- -
- -
-

- {{ __('auth.have_account') }} - - {{ __('auth.login') }} - -

-
-
-
-
-@endsection \ No newline at end of file