input update max length

This commit is contained in:
Samandar Turgunboyev
2025-12-17 09:32:53 +05:00
parent 817a1a8727
commit c69db3cd3a
2 changed files with 4 additions and 79 deletions

View File

@@ -126,7 +126,7 @@ export const orders = [
export const user = { export const user = {
phone: '+998 90 123 45 67', phone: '+998 90 123 45 67',
email: 'akmal@example.com', email: 'akmal@example.com',
avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=Akmal', avatar: '/logos/logo.png',
memberSince: '2024-yil yanvar', memberSince: '2024-yil yanvar',
loyaltyPoints: 2450, loyaltyPoints: 2450,
totalOrders: 47, totalOrders: 47,

View File

@@ -18,9 +18,7 @@ import {
Package, Package,
RefreshCw, RefreshCw,
ShoppingBag, ShoppingBag,
TrendingUp,
Truck, Truck,
Wallet,
} from 'lucide-react'; } from 'lucide-react';
import { useState } from 'react'; import { useState } from 'react';
import { orders, user } from '../lib/data'; import { orders, user } from '../lib/data';
@@ -86,12 +84,6 @@ const Profile = () => {
{ id: 'history', label: 'Tarix', icon: History }, { id: 'history', label: 'Tarix', icon: History },
]; ];
const statistics = {
delivered: orders.filter((o) => o.status === 'delivered').length,
inTransit: orders.filter((o) => o.status === 'inTransit').length,
atPickup: orders.filter((o) => o.status === 'atPickup').length,
};
const renderContent = () => { const renderContent = () => {
switch (activeSection) { switch (activeSection) {
case 'orders': case 'orders':
@@ -114,74 +106,6 @@ const Profile = () => {
default: default:
return ( return (
<> <>
<div className="grid grid-cols-2 gap-3 md:gap-4 mb-6 md:mb-8">
<Card className="border-0 shadow-sm bg-gradient-to-br from-emerald-500 to-emerald-600 text-white">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-white/20 flex items-center justify-center">
<ShoppingBag className="w-4 h-4 md:w-5 md:h-5" />
</div>
<TrendingUp className="w-3 h-3 md:w-4 md:h-4 opacity-75" />
</div>
<p className="text-xl md:text-2xl font-bold">
{user.totalOrders}
</p>
<p className="text-[10px] md:text-sm opacity-80">
Jami buyurtmalar
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm bg-gradient-to-br from-blue-500 to-blue-600 text-white">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-white/20 flex items-center justify-center">
<Wallet className="w-4 h-4 md:w-5 md:h-5" />
</div>
<TrendingUp className="w-3 h-3 md:w-4 md:h-4 opacity-75" />
</div>
<p className="text-xl md:text-2xl font-bold">
{(user.totalSpent / 1000000).toFixed(1)}M
</p>
<p className="text-[10px] md:text-sm opacity-80">
Jami xarajat
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-amber-100 flex items-center justify-center">
<Truck className="w-4 h-4 md:w-5 md:h-5 text-amber-600" />
</div>
</div>
<p className="text-xl md:text-2xl font-bold text-foreground">
{statistics.inTransit}
</p>
<p className="text-[10px] md:text-sm text-muted-foreground">
{"Yo'lda"}
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-emerald-100 flex items-center justify-center">
<CheckCircle className="w-4 h-4 md:w-5 md:h-5 text-emerald-600" />
</div>
</div>
<p className="text-xl md:text-2xl font-bold text-foreground">
{statistics.delivered}
</p>
<p className="text-[10px] md:text-sm text-muted-foreground">
Yetkazildi
</p>
</CardContent>
</Card>
</div>
{/* Active Orders Section */} {/* Active Orders Section */}
<div className="mb-6 md:mb-8"> <div className="mb-6 md:mb-8">
<div className="flex items-center justify-between mb-3 md:mb-4"> <div className="flex items-center justify-between mb-3 md:mb-4">
@@ -194,7 +118,7 @@ const Profile = () => {
className="text-emerald-600 hover:text-emerald-700 h-8 text-xs md:text-sm" className="text-emerald-600 hover:text-emerald-700 h-8 text-xs md:text-sm"
onClick={() => setActiveSection('orders')} onClick={() => setActiveSection('orders')}
> >
Barchasi{' '} Barchasi
<ChevronRight className="w-3 h-3 md:w-4 md:h-4 ml-1" /> <ChevronRight className="w-3 h-3 md:w-4 md:h-4 ml-1" />
</Button> </Button>
</div> </div>
@@ -367,10 +291,11 @@ const Profile = () => {
{/* Desktop Sidebar - hidden on mobile */} {/* Desktop Sidebar - hidden on mobile */}
<div className="hidden md:block w-80 shrink-0"> <div className="hidden md:block w-80 shrink-0">
<div className="flex items-center gap-4 mb-8"> <div className="flex items-center gap-4 mb-8">
<Avatar className="w-14 h-14 ring-2 ring-emerald-500 ring-offset-2"> <Avatar className="w-14 h-14 ring-2 ring-emerald-500 ring-offset-2 flex items-center justify-center">
<AvatarImage <AvatarImage
src={user.avatar || '/placeholder.svg'} src={user.avatar || '/placeholder.svg'}
alt={user.phone} alt={user.phone}
className="h-12 w-12"
/> />
<AvatarFallback className="bg-emerald-500 text-white font-semibold"> <AvatarFallback className="bg-emerald-500 text-white font-semibold">
U U