This commit is contained in:
belikovme 2024-11-25 13:05:22 +07:00
parent e650e52386
commit 9d3f51aa05
3 changed files with 51 additions and 10 deletions

View File

@ -134,15 +134,55 @@ export default function ContactBlock() {
const { language } = useLanguage();
const t = translations.contacts[language];
function sendMessage(text)
{
const url = `https://api.telegram.org/bot8190149729:AAH1n6QXzaU__EwRhrPbEn9fqrFbPRRLFaI/sendMessage` // The url to request
const obj = {
chat_id: 1017685666, // Telegram chat id
text: text // The text to send
};
const xht = new XMLHttpRequest();
xht.open("POST", url, true);
xht.setRequestHeader("Content-type", "application/json; charset=UTF-8");
xht.send(JSON.stringify(obj));
}
const [formData, setFormData] = useState({
name: '',
email: '',
message: ''
});
// const handleSubmit = (e) => {
// e.preventDefault();
// console.log('Form submitted:', formData);
// };
const handleSubmit = (e) => {
e.preventDefault();
console.log('Form submitted:', formData);
// Формируем текст сообщения для Telegram
const messageText = `
Новое сообщение с сайта:
👤 Имя: ${formData.name}
📧 Email: ${formData.email}
💬 Сообщение: ${formData.message}
`.trim();
// Отправляем сообщение в Telegram
sendMessage(messageText);
// Очищаем форму после отправки
setFormData({
name: '',
email: '',
message: ''
});
// Показываем уведомление об успешной отправке
// alert(language === 'ru' ? 'Сообщение успешно отправлено!' : 'Message sent successfully!');
};
const handleChange = (e) => {
@ -241,8 +281,7 @@ export default function ContactBlock() {
required
/>
</div>
<button
<button
type="submit"
className="w-full bg-[#000000] text-white font-medium py-2 px-4 rounded-md hover:bg-[#90c95c] transition-colors duration-200"
>

View File

@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Minus, Plus } from 'lucide-react';
import translations from '../translations.json';
import { useLanguage } from '../contexts/LanguageContext';
import {Button} from 'antd';
const DynamicPricing = () => {
const { language } = useLanguage();
@ -78,8 +79,7 @@ const DynamicPricing = () => {
<div className="flex items-center bg-gray-100 rounded-full p-2">
<div className="flex items-center">
<span className="mr-2">{t.accounts}</span>
<button
href="http://app.qwickpost.com/"
<button
onClick={decreaseAccounts}
className="p-1 rounded-full hover:bg-white transition-colors"
disabled={accountCount <= 5}
@ -118,11 +118,12 @@ const DynamicPricing = () => {
/{t.mounth}
</span>
</div>
<button
<Button
href="http://app.qwickpost.com/"
className="w-full py-3 px-4 rounded-lg bg-green-500 text-white font-medium mb-8"
>
{plan === 'premium' ? t.startButton : t.tryButton}
</button>
</Button>
<ul className="space-y-3">
{t.features[plan].features.map((feature, index) => (
<li key={index} className="flex items-center gap-2">

View File

@ -159,15 +159,16 @@ const PricingPlans = () => {
))}
</ul>
</div>
<button
className={`w-full py-2 px-4 rounded-md text-lg font-semibold transition-colors ${
<a
href='http://app.qwickpost.com/'
className={`w-full py-2 px-4 rounded-md text-lg text-center font-semibold transition-colors ${
plan.popular
? 'bg-green-500 text-white hover:bg-green-600'
: 'bg-white text-green-500 border border-green-500 hover:bg-green-50'
}`}
>
{plan.buttonText}
</button>
</a>
</div>
))}
</div>