push messages to telegram from contactUs form

This commit is contained in:
2025-05-22 16:40:13 +03:00
parent 29d3af2ea1
commit 2b902ef0c9
6 changed files with 32 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ const ContactUs = () => {
message: '',
},
validationRules,
async (values) => {
async values => {
try {
await sendMessage(values)
@@ -42,20 +42,21 @@ const ContactUs = () => {
})
resetField('message')
} catch {
} catch (error) {
console.error('ContactUs - Error details:', error)
showToast({ type: 'error', message: 'Ой, что то пошло не так..' })
}
}
)
return (
<div className="rounded-2xl shadow overflow-hidden">
<div className="p-6 bg-white sm:p-8">
<div className="overflow-hidden rounded-2xl shadow">
<div className="bg-white p-6 sm:p-8">
<div className="space-y-4">
<h2 className="text-2xl">Хотели бы связаться с нами?</h2>
<form className="space-y-4" onSubmit={handleSubmit}>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 h-full">
<div className="space-y-4 h-full flex flex-col">
<div className="grid h-full grid-cols-1 gap-6 md:grid-cols-2">
<div className="flex h-full flex-col space-y-4">
<TextInput
label="Ваше имя"
value={values.name}
@@ -81,7 +82,7 @@ const ContactUs = () => {
</div>
<Button
text="Отправить"
className="text-sm font-semibold py-4 px-6 bg-black text-white flex items-center justify-center w-full rounded-2xl whitespace-nowrap"
className="flex w-full items-center justify-center rounded-2xl bg-black px-6 py-4 text-sm font-semibold whitespace-nowrap text-white"
type="submit"
/>
</form>