image added and trnslation texts done and contact connnected to telegrtam chatBot all tasks done
This commit is contained in:
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { MessageSquare } from "lucide-react";
|
||||
import { useLanguage } from "@/contexts/language-context";
|
||||
import axios from "axios";
|
||||
|
||||
export default function Contact() {
|
||||
const [formData, setFormData] = useState({
|
||||
@@ -25,9 +26,39 @@ export default function Contact() {
|
||||
});
|
||||
};
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
// Handle form submission
|
||||
try {
|
||||
const token = "7940057045:AAHRFPvgUCo_7pqpXD6uq4li7-_DYx2J96g"; // Use environment variable
|
||||
const chatId = 6134458285;
|
||||
|
||||
if (!token || !chatId) {
|
||||
throw new Error("Telegram token yoki chat ID topilmadi!");
|
||||
}
|
||||
|
||||
const message = `
|
||||
📥 Yangi xabar keldi!
|
||||
👤 Ism: ${formData.name}
|
||||
📧 Email: ${formData.email}
|
||||
💬 Xabar: ${formData.message}
|
||||
`;
|
||||
|
||||
await axios.post(`https://api.telegram.org/bot${token}/sendMessage`, {
|
||||
chat_id: chatId,
|
||||
text: message,
|
||||
});
|
||||
|
||||
alert("✅ Tez orada bog'lanamiz!");
|
||||
setFormData({
|
||||
name: "",
|
||||
email: "",
|
||||
message: "",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Yuborishda xatolik:", error);
|
||||
alert("❌ Yuborishda xatolik yuz berdi!");
|
||||
}
|
||||
console.log(formData);
|
||||
};
|
||||
|
||||
@@ -54,7 +85,7 @@ export default function Contact() {
|
||||
name="name"
|
||||
value={formData.name}
|
||||
onChange={handleChange}
|
||||
placeholder={t.contact.fields.name}
|
||||
placeholder={t.contact.fields.name_placeholder}
|
||||
className="bg-background border-border"
|
||||
required
|
||||
/>
|
||||
@@ -69,7 +100,7 @@ export default function Contact() {
|
||||
name="email"
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
placeholder={t.contact.fields.email}
|
||||
placeholder={t.contact.fields.email_placeholder}
|
||||
className="bg-background border-border"
|
||||
required
|
||||
/>
|
||||
@@ -108,12 +139,14 @@ export default function Contact() {
|
||||
<p className="text-muted-foreground mb-4">
|
||||
{t.contact.whatsapp.desc}
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full border-primary text-primary hover:bg-primary/90 bg-transparent"
|
||||
>
|
||||
{t.contact.open}
|
||||
</Button>
|
||||
<a href="https://t.me/Felix_IT_solutions">
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full border-primary text-primary hover:bg-primary/90 bg-transparent"
|
||||
>
|
||||
{t.contact.open}
|
||||
</Button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="bg-background rounded-xl p-6 border border-border">
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
import { useLanguage } from "@/contexts/language-context"
|
||||
import { Github, Linkedin, Twitter } from "lucide-react"
|
||||
import { useLanguage } from "@/contexts/language-context";
|
||||
import { Github, Linkedin, Twitter } from "lucide-react";
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Footer() {
|
||||
const {t} = useLanguage();
|
||||
const { t } = useLanguage();
|
||||
return (
|
||||
<footer className="bg-foreground text-white py-12 md:py-16">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
|
||||
<div>
|
||||
<div className="flex items-center gap-2 mb-4">
|
||||
<div className="w-8 h-8 bg-primary rounded-lg flex items-center justify-center">
|
||||
<span className="text-white font-bold text-sm">D</span>
|
||||
</div>
|
||||
<span className="font-bold text-lg">{t.footer.brand}</span>
|
||||
<div className="flex items-center gap-2 mb-4 bg-white justify-center rounded-xl py-3">
|
||||
<Image
|
||||
src="/logo.png"
|
||||
alt="logo image"
|
||||
width={150}
|
||||
height={100}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-white/70 text-sm">{t.footer.description}</p>
|
||||
</div>
|
||||
@@ -78,15 +81,23 @@ export default function Footer() {
|
||||
<div className="border-t border-white/10 pt-8 flex flex-col md:flex-row justify-between items-center text-sm text-white/70">
|
||||
<p>{t.footer.rights}</p>
|
||||
<div className="flex gap-6 mt-4 md:mt-0">
|
||||
<a href="#" className="hover:text-white transition">
|
||||
<a
|
||||
target="_blanck"
|
||||
href="https://www.youtube.com/watch?v=aoUiTrKAU-0&list=RDMM1GFCMVQ4Gkg&index=27"
|
||||
className="hover:text-white transition"
|
||||
>
|
||||
{t.footer.policies[0]}
|
||||
</a>
|
||||
<a href="#" className="hover:text-white transition">
|
||||
<a
|
||||
target="_blanck"
|
||||
href="https://www.youtube.com/watch?v=aoUiTrKAU-0&list=RDMM1GFCMVQ4Gkg&index=27"
|
||||
className="hover:text-white transition"
|
||||
>
|
||||
{t.footer.policies[1]}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { useLanguage } from "@/contexts/language-context";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
|
||||
export default function Header() {
|
||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||
@@ -28,7 +29,7 @@ export default function Header() {
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-2 flex items-center justify-between text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<Phone size={16} />
|
||||
<span>+998 (71) 200-01-02</span>
|
||||
<span>+998 (50) 505-55-45</span>
|
||||
</div>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
@@ -57,10 +58,7 @@ export default function Header() {
|
||||
|
||||
<nav className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="w-8 h-8 bg-primary rounded-lg flex items-center justify-center">
|
||||
<span className="text-white font-bold text-sm">D</span>
|
||||
</div>
|
||||
<span className="font-bold text-lg text-foreground">Dwatt</span>
|
||||
<Image src="/logo.png" alt="logo image" width={120} height={50}/>
|
||||
</div>
|
||||
|
||||
<div className="hidden md:flex items-center gap-8">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { useLanguage } from "@/contexts/language-context"
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
|
||||
export default function Hero() {
|
||||
@@ -32,36 +33,9 @@ export default function Hero() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="relative h-64 md:h-96 bg-gradient-to-br from-primary/10 via-primary/5 to-background rounded-2xl border border-border flex items-center justify-center">
|
||||
<div className="relative h-64 md:h-96 bg-linear-to-br from-primary/10 via-primary/5 to-background rounded-2xl border border-border flex items-center justify-center">
|
||||
<div className="absolute inset-0 overflow-hidden rounded-2xl">
|
||||
<svg className="w-full h-full" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="400" height="400" fill="none" />
|
||||
<circle
|
||||
cx="200"
|
||||
cy="200"
|
||||
r="120"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
fill="none"
|
||||
className="text-primary/30"
|
||||
/>
|
||||
<circle
|
||||
cx="200"
|
||||
cy="200"
|
||||
r="80"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
fill="none"
|
||||
className="text-primary/50"
|
||||
/>
|
||||
<g className="text-primary/40">
|
||||
<path d="M 200 80 L 200 120" strokeWidth="3" stroke="currentColor" />
|
||||
<path d="M 280 200 L 240 200" strokeWidth="3" stroke="currentColor" />
|
||||
<path d="M 200 320 L 200 280" strokeWidth="3" stroke="currentColor" />
|
||||
<path d="M 120 200 L 160 200" strokeWidth="3" stroke="currentColor" />
|
||||
</g>
|
||||
<circle cx="200" cy="200" r="12" fill="currentColor" className="text-primary" />
|
||||
</svg>
|
||||
<Image src="/hero_image.jpg" alt="hero image" width={500} height={500} className="w-full h-full"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user