diff --git a/public/logos/logo.png b/public/logos/logo.png new file mode 100644 index 0000000..6b4ff7b Binary files /dev/null and b/public/logos/logo.png differ diff --git a/src/features/auth/ui/Login.tsx b/src/features/auth/ui/Login.tsx index 825c538..d01c82a 100644 --- a/src/features/auth/ui/Login.tsx +++ b/src/features/auth/ui/Login.tsx @@ -153,7 +153,7 @@ const Login = () => {
{step === 'phone' ? ( - + ) : ( )} diff --git a/src/features/profile/lib/data.ts b/src/features/profile/lib/data.ts new file mode 100644 index 0000000..7eff467 --- /dev/null +++ b/src/features/profile/lib/data.ts @@ -0,0 +1,136 @@ +export const orders = [ + { + id: 'BUY-001', + date: '2024-12-10', + time: '14:30', + items: [ + { + name: 'RedBull', + quantity: 2, + price: 15000, + image: '/red-bull-energy-drink.jpg', + }, + { + name: 'Coca-Cola 1.5L', + quantity: 1, + price: 12000, + image: '/classic-coca-cola.png', + }, + { + name: 'Suv', + quantity: 1, + price: 18000, + image: '/small-mineral-water-bottle.jpg', + }, + ], + total: 45000, + deliveryFee: 5000, + address: 'Chilonzor tumani, 12-kvartal, 5-uy', + paymentMethod: 'Naqd', + courierName: 'Javohir Karimov', + courierPhone: '+998 90 111 22 33', + status: 'delivered', + paymentStatus: 'paid', + }, + { + id: 'BUY-002', + date: '2024-12-08', + time: '19:15', + items: [ + { + name: 'Milka', + quantity: 3, + price: 25000, + image: '/milka-chocolate-bar.jpg', + }, + ], + total: 62000, + deliveryFee: 7000, + address: 'Yunusobod tumani, 7-kvartal, 23-uy', + paymentMethod: 'Karta', + status: 'inTransit', + paymentStatus: 'paid', + estimatedTime: '15-20 daqiqa', + }, + { + id: 'BUY-003', + date: '2024-12-05', + time: '12:45', + items: [ + { + name: 'Coca-Cola', + quantity: 1, + price: 65000, + image: '/classic-coca-cola.png', + }, + { + name: 'Monster', + quantity: 2, + price: 15000, + image: '/monster-energy-drink.jpg', + }, + ], + total: 85000, + deliveryFee: 10000, + address: 'Sergeli tumani, 5-kvartal, 12-uy', + paymentMethod: 'Naqd', + status: 'atPickup', + paymentStatus: 'pending', + }, + { + id: 'BUY-004', + date: '2024-12-01', + time: '20:00', + items: [ + { + name: 'Milka', + quantity: 5, + price: 35000, + image: '/milka-chocolate-bar.jpg', + }, + { + name: 'Suv', + quantity: 3, + price: 3000, + image: '/small-mineral-water-bottle.jpg', + }, + ], + total: 184000, + deliveryFee: 8000, + address: 'Mirzo Ulugbek tumani, 3-kvartal', + paymentMethod: 'Karta', + status: 'delivered', + paymentStatus: 'paid', + }, + { + id: 'BUY-005', + date: '2024-11-28', + time: '13:20', + items: [ + { + name: 'Milka', + quantity: 1, + price: 120000, + image: '/milka-chocolate-bar.jpg', + }, + ], + total: 120000, + deliveryFee: 15000, + address: "Yakkasaroy tumani, Bobur ko'chasi", + paymentMethod: 'Karta', + status: 'delivered', + paymentStatus: 'paid', + }, +]; + +export const user = { + phone: '+998 90 123 45 67', + email: 'akmal@example.com', + avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=Akmal', + memberSince: '2024-yil yanvar', + loyaltyPoints: 2450, + totalOrders: 47, + totalSpent: 3250000, + address: 'Toshkent sh., Chilonzor tumani, 12-kvartal, 5-uy', + birthDate: '1995-05-15', +}; diff --git a/src/features/profile/ui/Favourite.tsx b/src/features/profile/ui/Favourite.tsx new file mode 100644 index 0000000..e20d5d7 --- /dev/null +++ b/src/features/profile/ui/Favourite.tsx @@ -0,0 +1,24 @@ +import { Heart } from 'lucide-react'; + +const Favourite = () => { + return ( +
+

+ Sevimlilar +

+
+
+ +
+

+ {"Sevimli mahsulotlar yo'q"} +

+

+ {"Mahsulotlarni sevimlilar ro'yxatiga qo'shing"} +

+
+
+ ); +}; + +export default Favourite; diff --git a/src/features/profile/ui/History.tsx b/src/features/profile/ui/History.tsx new file mode 100644 index 0000000..6d39577 --- /dev/null +++ b/src/features/profile/ui/History.tsx @@ -0,0 +1,115 @@ +import { Button } from '@/shared/ui/button'; +import { Card, CardContent } from '@/shared/ui/card'; +import { Tabs, TabsList, TabsTrigger } from '@/shared/ui/tabs'; +import { Calendar, CheckCircle, Clock, RefreshCw } from 'lucide-react'; +import Image from 'next/image'; +import { useState } from 'react'; +import { orders } from '../lib/data'; + +const HistoryTabs = () => { + const [historyTab, setHistoryTab] = useState('all'); + + return ( + <> +
+

Tarix

+
+ + + + Barchasi + + + Bu hafta + + + Bu oy + + + + +
+ {orders + .filter((o) => o.status === 'delivered') + .map((order, idx) => ( +
+
+
+ +
+ {idx < + orders.filter((o) => o.status === 'delivered').length - 1 && ( +
+ )} +
+ + +
+
+

+ {order.id} +

+
+ + + {order.date} + + + + {order.time} + +
+
+

+ {(order.total + order.deliveryFee).toLocaleString()}{' '} + {"so'm"} +

+
+
+ {order.items.map((item, i) => ( + {item.name} + ))} + + {order.items.map((i) => i.name).join(', ')} + +
+
+ +
+
+
+
+ ))} +
+ + ); +}; + +export default HistoryTabs; diff --git a/src/features/profile/ui/Orders.tsx b/src/features/profile/ui/Orders.tsx new file mode 100644 index 0000000..93e5c57 --- /dev/null +++ b/src/features/profile/ui/Orders.tsx @@ -0,0 +1,184 @@ +import { Badge } from '@/shared/ui/badge'; +import { Card, CardContent } from '@/shared/ui/card'; +import { Tabs, TabsList, TabsTrigger } from '@/shared/ui/tabs'; +import { CheckCircle, MapPin, Package, Truck } from 'lucide-react'; +import Image from 'next/image'; +import { useState } from 'react'; +import { orders } from '../lib/data'; + +const Orders = () => { + const [ordersTab, setOrdersTab] = useState('active'); + + const getStatusInfo = (status: string) => { + const statusMap: Record< + string, + { text: string; color: string; bgColor: string } + > = { + inTransit: { + text: "Yo'lda", + color: 'text-blue-600', + bgColor: 'bg-blue-100', + }, + atPickup: { + text: 'Punktda', + color: 'text-amber-600', + bgColor: 'bg-amber-100', + }, + delivered: { + text: 'Yetkazildi', + color: 'text-emerald-600', + bgColor: 'bg-emerald-100', + }, + cancelled: { + text: 'Bekor qilindi', + color: 'text-red-600', + bgColor: 'bg-red-100', + }, + }; + return ( + statusMap[status] || { + text: status, + color: 'text-muted-foreground', + bgColor: 'bg-muted', + } + ); + }; + + const getStatusIcon = (status: string) => { + switch (status) { + case 'inTransit': + return ; + case 'atPickup': + return ; + case 'delivered': + return ; + default: + return ; + } + }; + + return ( +
+
+

+ Buyurtmalar +

+
+ + + + + Faol ({orders.filter((o) => o.status !== 'delivered').length}) + + + Tugadi ({orders.filter((o) => o.status === 'delivered').length}) + + + Barcha ({orders.length}) + + + + +
+ {orders + .filter((o) => { + if (ordersTab === 'active') return o.status !== 'delivered'; + if (ordersTab === 'completed') return o.status === 'delivered'; + return true; + }) + .map((order) => { + const statusInfo = getStatusInfo(order.status); + return ( + + +
+
+
+ + {getStatusIcon(order.status)} + +
+
+

+ {order.id} +

+

+ {order.date} • {order.time} +

+
+
+ + {statusInfo.text} + +
+ +
+ {order.items.map((item, idx) => ( +
+ {item.name} +
+

+ {item.name} +

+

+ {item.quantity} × {item.price.toLocaleString()} +

+
+
+ ))} +
+ +
+
+ + {order.address} +
+
+

+ {(order.total + order.deliveryFee).toLocaleString()}{' '} + {"so'm"} +

+

+ Yetkazish: {order.deliveryFee.toLocaleString()} {"so'm"} +

+
+
+
+
+ ); + })} +
+
+ ); +}; + +export default Orders; diff --git a/src/features/profile/ui/Profile.tsx b/src/features/profile/ui/Profile.tsx index a9b6b42..7a3d14c 100644 --- a/src/features/profile/ui/Profile.tsx +++ b/src/features/profile/ui/Profile.tsx @@ -2,192 +2,41 @@ import { PartnershipForm } from '@/features/about/ui/AboutPage'; import Faq from '@/features/faq/ui/Faq'; +import Favourite from '@/features/favourite/ui/Favourite'; import { useRouter } from '@/shared/config/i18n/navigation'; import { Avatar, AvatarFallback, AvatarImage } from '@/shared/ui/avatar'; import { Badge } from '@/shared/ui/badge'; import { Button } from '@/shared/ui/button'; import { Card, CardContent } from '@/shared/ui/card'; -import { Input } from '@/shared/ui/input'; -import { Label } from '@/shared/ui/label'; -import { Switch } from '@/shared/ui/switch'; -import { Tabs, TabsList, TabsTrigger } from '@/shared/ui/tabs'; import { Bell, - Calendar, - Camera, CheckCircle, - ChevronDown, ChevronRight, - Clock, - CreditCard, - Edit3, - Globe, Handshake, - Heart, + HelpCircle, History, Home, LogOut, MapPin, MessageCircleQuestion, - Moon, Package, - Plus, RefreshCw, - Settings, - Shield, ShoppingBag, Star, TrendingUp, Truck, - User, Wallet, } from 'lucide-react'; -import Image from 'next/image'; import { useState } from 'react'; +import { orders, user } from '../lib/data'; +import HistoryTabs from './History'; +import Orders from './Orders'; +import CustomerSupport from './Support'; const Profile = () => { const [activeSection, setActiveSection] = useState('overview'); - const [ordersTab, setOrdersTab] = useState('active'); - const [historyTab, setHistoryTab] = useState('all'); const router = useRouter(); - const user = { - phone: '+998 90 123 45 67', - email: 'akmal@example.com', - avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=Akmal', - memberSince: '2024-yil yanvar', - loyaltyPoints: 2450, - totalOrders: 47, - totalSpent: 3250000, - address: 'Toshkent sh., Chilonzor tumani, 12-kvartal, 5-uy', - birthDate: '1995-05-15', - }; - - const orders = [ - { - id: 'BUY-001', - date: '2024-12-10', - time: '14:30', - items: [ - { - name: 'RedBull', - quantity: 2, - price: 15000, - image: '/red-bull-energy-drink.jpg', - }, - { - name: 'Coca-Cola 1.5L', - quantity: 1, - price: 12000, - image: '/classic-coca-cola.png', - }, - { - name: 'Suv', - quantity: 1, - price: 18000, - image: '/small-mineral-water-bottle.jpg', - }, - ], - total: 45000, - deliveryFee: 5000, - address: 'Chilonzor tumani, 12-kvartal, 5-uy', - paymentMethod: 'Naqd', - courierName: 'Javohir Karimov', - courierPhone: '+998 90 111 22 33', - status: 'delivered', - paymentStatus: 'paid', - }, - { - id: 'BUY-002', - date: '2024-12-08', - time: '19:15', - items: [ - { - name: 'Milka', - quantity: 3, - price: 25000, - image: '/milka-chocolate-bar.jpg', - }, - ], - total: 62000, - deliveryFee: 7000, - address: 'Yunusobod tumani, 7-kvartal, 23-uy', - paymentMethod: 'Karta', - status: 'inTransit', - paymentStatus: 'paid', - estimatedTime: '15-20 daqiqa', - }, - { - id: 'BUY-003', - date: '2024-12-05', - time: '12:45', - items: [ - { - name: 'Coca-Cola', - quantity: 1, - price: 65000, - image: '/classic-coca-cola.png', - }, - { - name: 'Monster', - quantity: 2, - price: 15000, - image: '/monster-energy-drink.jpg', - }, - ], - total: 85000, - deliveryFee: 10000, - address: 'Sergeli tumani, 5-kvartal, 12-uy', - paymentMethod: 'Naqd', - status: 'atPickup', - paymentStatus: 'pending', - }, - { - id: 'BUY-004', - date: '2024-12-01', - time: '20:00', - items: [ - { - name: 'Milka', - quantity: 5, - price: 35000, - image: '/milka-chocolate-bar.jpg', - }, - { - name: 'Suv', - quantity: 3, - price: 3000, - image: '/small-mineral-water-bottle.jpg', - }, - ], - total: 184000, - deliveryFee: 8000, - address: 'Mirzo Ulugbek tumani, 3-kvartal', - paymentMethod: 'Karta', - status: 'delivered', - paymentStatus: 'paid', - }, - { - id: 'BUY-005', - date: '2024-11-28', - time: '13:20', - items: [ - { - name: 'Milka', - quantity: 1, - price: 120000, - image: '/milka-chocolate-bar.jpg', - }, - ], - total: 120000, - deliveryFee: 15000, - address: "Yakkasaroy tumani, Bobur ko'chasi", - paymentMethod: 'Karta', - status: 'delivered', - paymentStatus: 'paid', - }, - ]; - const getStatusInfo = (status: string) => { const statusMap: Record< string, @@ -242,6 +91,7 @@ const Profile = () => { { id: 'history', label: 'Tarix', icon: History }, { id: 'agency', label: "Hamkor bo'lish", icon: Handshake }, { id: 'faq', label: 'Savol javoblar', icon: MessageCircleQuestion }, + { id: 'support', label: "Qo'llab-quvvatlash", icon: HelpCircle }, ]; const statistics = { @@ -253,486 +103,23 @@ const Profile = () => { const renderContent = () => { switch (activeSection) { case 'orders': - return ( -
-
-

- Buyurtmalar -

-
- - - - - Faol ({orders.filter((o) => o.status !== 'delivered').length}) - - - Tugadi ( - {orders.filter((o) => o.status === 'delivered').length}) - - - Barcha ({orders.length}) - - - - -
- {orders - .filter((o) => { - if (ordersTab === 'active') return o.status !== 'delivered'; - if (ordersTab === 'completed') - return o.status === 'delivered'; - return true; - }) - .map((order) => { - const statusInfo = getStatusInfo(order.status); - return ( - - -
-
-
- - {getStatusIcon(order.status)} - -
-
-

- {order.id} -

-

- {order.date} • {order.time} -

-
-
- - {statusInfo.text} - -
- -
- {order.items.map((item, idx) => ( -
- {item.name} -
-

- {item.name} -

-

- {item.quantity} ×{' '} - {item.price.toLocaleString()} -

-
-
- ))} -
- -
-
- - {order.address} -
-
-

- {( - order.total + order.deliveryFee - ).toLocaleString()}{' '} - {"so'm"} -

-

- Yetkazish: {order.deliveryFee.toLocaleString()}{' '} - {"so'm"} -

-
-
-
-
- ); - })} -
-
- ); + return ; case 'history': - return ( -
-
-

- Tarix -

-
- - - - - Barchasi - - - Bu hafta - - - Bu oy - - - - -
- {orders - .filter((o) => o.status === 'delivered') - .map((order, idx) => ( -
-
-
- -
- {idx < - orders.filter((o) => o.status === 'delivered').length - - 1 && ( -
- )} -
- - -
-
-

- {order.id} -

-
- - - {order.date} - - - - {order.time} - -
-
-

- {(order.total + order.deliveryFee).toLocaleString()}{' '} - {"so'm"} -

-
-
- {order.items.map((item, i) => ( - {item.name} - ))} - - {order.items.map((i) => i.name).join(', ')} - -
-
- -
-
-
-
- ))} -
-
- ); - - case 'settings': - return ( -
-

- Sozlamalar -

- - - -

- - {"Shaxsiy ma'lumotlar"} -

-
-
- - - - U - - - -
-
-

- {"A'zo"}: {user.memberSince} -

-
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
-

- - {"To'lov usullari"} -

- -
-
-
-
- VISA -
-
-

- •••• •••• •••• 4532 -

-

- 12/26 -

-
-
- - Asosiy - -
-
-
- - - -

- - Ilova sozlamalari -

-
-
-
- -
-

- Bildirishnomalar -

-

- Push xabarlar -

-
-
- -
-
-
- -
-

- {"Qorong'u rejim"} -

-

- Tungi rejim -

-
-
- -
-
-
- -
-

- Til -

-

- Ilova tili -

-
-
- -
-
-
- -
-

- Xavfsizlik -

-

- {"Parolni o'zgartirish"} -

-
-
- -
-
-
-
- - {/* Danger Zone */} - - -

- Xavfli zona -

-
-
-

- {"Hisobni o'chirish"} -

-

- {"Barcha ma'lumotlar o'chiriladi"} -

-
- -
-
-
-
- ); + return ; case 'favorites': - return ( -
-

- Sevimlilar -

-
-
- -
-

- {"Sevimli mahsulotlar yo'q"} -

-

- {"Mahsulotlarni sevimlilar ro'yxatiga qo'shing"} -

-
-
- ); + return ; case 'agency': return ; case 'faq': return ; + case 'support': + return ; default: - // Overview section return ( <>
diff --git a/src/features/profile/ui/Setting.tsx b/src/features/profile/ui/Setting.tsx new file mode 100644 index 0000000..d752e16 --- /dev/null +++ b/src/features/profile/ui/Setting.tsx @@ -0,0 +1,231 @@ +import { Avatar, AvatarFallback, AvatarImage } from '@/shared/ui/avatar'; +import { Badge } from '@/shared/ui/badge'; +import { Button } from '@/shared/ui/button'; +import { Card, CardContent } from '@/shared/ui/card'; +import { Input } from '@/shared/ui/input'; +import { Label } from '@/shared/ui/label'; +import { Switch } from '@/shared/ui/switch'; +import { + Bell, + Camera, + ChevronDown, + ChevronRight, + CreditCard, + Edit3, + Globe, + Moon, + Plus, + Settings, + Shield, + User, +} from 'lucide-react'; +import { user } from '../lib/data'; + +const Setting = () => { + return ( +
+

+ Sozlamalar +

+ + + +

+ + {"Shaxsiy ma'lumotlar"} +

+
+
+ + + + U + + + +
+
+

+ {"A'zo"}: {user.memberSince} +

+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+

+ + {"To'lov usullari"} +

+ +
+
+
+
+ VISA +
+
+

+ •••• •••• •••• 4532 +

+

12/26

+
+
+ + Asosiy + +
+
+
+ + + +

+ + Ilova sozlamalari +

+
+
+
+ +
+

+ Bildirishnomalar +

+

Push xabarlar

+
+
+ +
+
+
+ +
+

+ {"Qorong'u rejim"} +

+

Tungi rejim

+
+
+ +
+
+
+ +
+

Til

+

Ilova tili

+
+
+ +
+
+
+ +
+

+ Xavfsizlik +

+

+ {"Parolni o'zgartirish"} +

+
+
+ +
+
+
+
+ + {/* Danger Zone */} + + +

+ Xavfli zona +

+
+
+

+ {"Hisobni o'chirish"} +

+

+ {"Barcha ma'lumotlar o'chiriladi"} +

+
+ +
+
+
+
+ ); +}; + +export default Setting; diff --git a/src/features/profile/ui/Support.tsx b/src/features/profile/ui/Support.tsx new file mode 100644 index 0000000..7dacbcf --- /dev/null +++ b/src/features/profile/ui/Support.tsx @@ -0,0 +1,168 @@ +import { + AlertTriangle, + CheckCircle, + HelpCircle, + MessageCircle, + RotateCcw, + Send, +} from 'lucide-react'; +import { useState } from 'react'; + +export default function CustomerSupport() { + const [selectedCategory, setSelectedCategory] = useState(''); + const [message, setMessage] = useState(''); + const [showSuccess, setShowSuccess] = useState(false); + + const categories = [ + { + id: 'vozvrat', + title: 'Vozvrat (Qaytarish)', + description: "Mahsulotni qaytarish bo'yicha savol", + icon: RotateCcw, + }, + { + id: 'brak', + title: 'Brak mahsulotlar', + description: 'Nuqsonli yoki shikastlangan mahsulotlar', + icon: AlertTriangle, + }, + { + id: 'umumiy', + title: 'Umumiy murojaatlar', + description: 'Boshqa savollar va takliflar', + icon: HelpCircle, + }, + ]; + + const handleSendToTelegram = () => { + if (!selectedCategory || !message.trim()) { + alert('Iltimos, kategoriya va xabar matnini kiriting'); + return; + } + + const category = categories.find((c) => c.id === selectedCategory); + + if (!category) { + alert('Kategoriya topilmadi'); + return; + } + + const telegramText = `🔔 Yangi murojaat\n\n📋 Kategoriya: ${category.title}\n\n💬 Xabar:\n${message}`; + + const telegramUsername = 'web_app_0515_bot'; + const telegramUrl = `https://t.me/${telegramUsername}?text=${encodeURIComponent( + telegramText, + )}`; + + window.open(telegramUrl, '_blank'); + + setShowSuccess(true); + setTimeout(() => { + setShowSuccess(false); + setSelectedCategory(''); + setMessage(''); + }, 3000); + }; + + return ( +
+ <> + {/* Header */} +
+
+ +

+ {"Qo'llab-quvvatlash"} +

+
+

Sizga yordam berish uchun tayyormiz

+
+ + {/* Success Message */} + {showSuccess && ( +
+ +

+ Xabaringiz yuborildi! Tez orada javob beramiz. +

+
+ )} + + {/* Categories */} +
+

+ {"Murojaat yo'nalishini tanlang"} +

+
+ {categories.map((category) => { + const Icon = category.icon; + return ( + + ); + })} +
+
+ + {/* Message Input */} +
+

+ Xabar yozing +

+