wokring final build version
This commit is contained in:
@@ -2,8 +2,10 @@ import React, { useState, useRef } from "react"
|
||||
import styles from "./contact-me.module.css"
|
||||
import { LuMousePointerClick } from "react-icons/lu";
|
||||
import { publicApi } from "@/api/publicClient";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function ContactMeForm() {
|
||||
const { t } = useTranslation("home");
|
||||
const [opened, setOpened] = useState(true)
|
||||
const [contentMoveUp, setContentMoveUp] = useState(true)
|
||||
const [openingBehind, setOpeningBehind] = useState(true)
|
||||
@@ -24,7 +26,7 @@ export default function ContactMeForm() {
|
||||
setEmail("")
|
||||
setMessage("")
|
||||
} catch {
|
||||
setError("Nepodařilo se odeslat zprávu. Zkuste to prosím znovu.")
|
||||
setError(t("contact.sendError"))
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
@@ -81,9 +83,9 @@ export default function ContactMeForm() {
|
||||
height: "100%", gap: "0.75rem", padding: "1.5rem", textAlign: "center",
|
||||
}}>
|
||||
<div style={{ fontSize: "2.5rem" }}>✓</div>
|
||||
<p style={{ color: "var(--c-other)", fontWeight: 700, margin: 0 }}>Zpráva odeslána!</p>
|
||||
<p style={{ color: "var(--c-other)", fontWeight: 700, margin: 0 }}>{t("contact.messageSent")}</p>
|
||||
<p style={{ color: "color-mix(in hsl, var(--c-text), transparent 35%)", fontSize: "0.85rem", margin: 0 }}>
|
||||
Ozvu se vám do 24 hodin.
|
||||
{t("contact.replyIn24h")}
|
||||
</p>
|
||||
<button
|
||||
onClick={() => setSuccess(false)}
|
||||
@@ -93,7 +95,7 @@ export default function ContactMeForm() {
|
||||
cursor: "pointer", fontSize: "0.82rem",
|
||||
}}
|
||||
>
|
||||
Nová zpráva
|
||||
{t("contact.newMessage")}
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
@@ -101,14 +103,14 @@ export default function ContactMeForm() {
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
placeholder="Váš email"
|
||||
placeholder={t("contact.emailPlaceholder")}
|
||||
required
|
||||
value={email}
|
||||
onChange={e => setEmail(e.target.value)}
|
||||
/>
|
||||
<textarea
|
||||
name="message"
|
||||
placeholder="Vaše zpráva"
|
||||
placeholder={t("contact.messagePlaceholder")}
|
||||
required
|
||||
value={message}
|
||||
onChange={e => setMessage(e.target.value)}
|
||||
@@ -116,7 +118,7 @@ export default function ContactMeForm() {
|
||||
{error && (
|
||||
<p style={{ color: "#ff6b6b", fontSize: "0.8rem", margin: "0", textAlign: "center" }}>{error}</p>
|
||||
)}
|
||||
<input type="submit" value={loading ? "Odesílám…" : "Odeslat"} disabled={loading} />
|
||||
<input type="submit" value={loading ? t("contact.sendingButton") : t("contact.sendButton")} disabled={loading} />
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user