Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c41f4ae9f9 | ||
|
|
f73b46178f | ||
|
|
52ef3b96da |
@@ -15,8 +15,6 @@ interface FormData {
|
||||
export function ContactForm() {
|
||||
const t = useTranslations('pages.contact');
|
||||
|
||||
const MAX_MESSAGE_LENGTH = 1000;
|
||||
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [submitStatus, setSubmitStatus] = useState<'idle' | 'success' | 'error'>('idle');
|
||||
const [errorMessage, setErrorMessage] = useState<string>('');
|
||||
@@ -28,8 +26,6 @@ export function ContactForm() {
|
||||
const [errors, setErrors] = useState<Partial<FormData>>({});
|
||||
const [remainingAttempts, setRemainingAttempts] = useState<number | null>(null);
|
||||
|
||||
const messageLength = formData.message.length;
|
||||
|
||||
const validateForm = () => {
|
||||
const newErrors: Partial<FormData> = {};
|
||||
|
||||
@@ -323,7 +319,6 @@ export function ContactForm() {
|
||||
onChange={handleChange}
|
||||
placeholder={t('contactForm.message.placeholder')}
|
||||
rows={6}
|
||||
maxLength={MAX_MESSAGE_LENGTH}
|
||||
disabled={isSubmitting}
|
||||
aria-required="true"
|
||||
aria-invalid={!!errors.message}
|
||||
@@ -333,19 +328,6 @@ export function ContactForm() {
|
||||
{errors.message && (
|
||||
<p id="message-error" role="alert" className="text-sm text-red-400">{errors.message}</p>
|
||||
)}
|
||||
<div className="flex justify-end">
|
||||
<p
|
||||
className={`text-xs transition-colors ${
|
||||
messageLength > MAX_MESSAGE_LENGTH
|
||||
? 'text-red-500'
|
||||
: messageLength >= MAX_MESSAGE_LENGTH * 0.8
|
||||
? 'text-yellow-500'
|
||||
: 'text-zinc-500'
|
||||
}`}
|
||||
>
|
||||
{t('contactForm.characterCounter', { current: messageLength, max: MAX_MESSAGE_LENGTH })}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export function NavLink({ href, icon, label, onClick, className }: NavLinkProps)
|
||||
className={`
|
||||
relative flex items-center gap-2 rounded-full py-2 px-4
|
||||
transition-all duration-200 ease-in-out
|
||||
focus:outline-none focus:ring-2 focus:ring-zinc-600 focus:ring-offset-2 focus:ring-offset-zinc-950
|
||||
${isActive ? 'text-white bg-zinc-700/60' : 'text-zinc-400 hover:text-white hover:bg-zinc-800/30'}
|
||||
${className || ''}
|
||||
`}
|
||||
|
||||
@@ -394,7 +394,6 @@
|
||||
"label": "Nachricht",
|
||||
"placeholder": "Ihre Nachricht an mich..."
|
||||
},
|
||||
"characterCounter": "{current}/{max} Zeichen",
|
||||
"submit": "Nachricht senden",
|
||||
"submitting": "Nachricht wird gesendet...",
|
||||
"successMessage": "Vielen Dank für Ihre Nachricht! Ich werde mich so schnell wie möglich bei Ihnen melden.",
|
||||
|
||||
@@ -409,7 +409,6 @@
|
||||
"label": "Message",
|
||||
"placeholder": "Your message to me..."
|
||||
},
|
||||
"characterCounter": "{current}/{max} characters",
|
||||
"submit": "Send Message",
|
||||
"submitting": "Sending message...",
|
||||
"successMessage": "Thank you for your message! I will get back to you as soon as possible.",
|
||||
|
||||
@@ -416,7 +416,6 @@
|
||||
"label": "Poruka",
|
||||
"placeholder": "Vasa poruka za mene..."
|
||||
},
|
||||
"characterCounter": "{current}/{max} karaktera",
|
||||
"submit": "Posalji poruku",
|
||||
"submitting": "Slanje poruke...",
|
||||
"successMessage": "Hvala vam na poruci! Javicu vam se sto je pre moguce.",
|
||||
|
||||
Reference in New Issue
Block a user