ტანსაცმლის გაცვლის სივრცე


import React, { useState } from 'react'; import { Camera, Heart, User, Search, Upload, Star, MapPin, Clock } from 'lucide-react'; const ClothingSwapApp = () => { const [activeTab, setActiveTab] = useState('browse'); const [selectedCategory, setSelectedCategory] = useState('all'); const [likedItems, setLikedItems] = useState(new Set()); const [uploadedImages, setUploadedImages] = useState([]); // Sample clothing items with Georgian names const sampleItems = [ { id: 1, title: "ელეგანტური შავი კაბა", category: "dress", size: "M", condition: "მთლად ახალი", image: "https://images.unsplash.com/photo-1566479179817-c2b0e3e3b502?w=400&h=500&fit=crop", owner: "ნინო გ.", location: "თბილისი", uploadDate: "2 დღის წინ", likes: 12, description: "ძალიან ლამაზი შავი კაბა, მხოლოდ ერთხელ ცვლა მქონდა. იდეალურია საღამოს ღონისძიებებისთვის." }, { id: 2, title: "თბილი ზამთრის ქურთუკი", category: "coat", size: "L", condition: "კარგი მდგომარეობა", image: "https://images.unsplash.com/photo-1544966503-7cc5ac882d5e?w=400&h=500&fit=crop", owner: "მარიამ თ.", location: "ბათუმი", uploadDate: "1 კვირის წინ", likes: 8, description: "თბილი და მყუდრო ქურთუკი, შესანიშნავია ზამთრისთვის. ბუნებრივი ბეწვით." }, { id: 3, title: "ჯინსური პანტალონი", category: "pants", size: "S", condition: "ძალიან კარგი", image: "https://images.unsplash.com/photo-1541099649105-f69ad21f3246?w=400&h=500&fit=crop", owner: "ანა მ.", location: "ქუთაისი", uploadDate: "3 დღის წინ", likes: 15, description: "მაღალი ხარისხის ჯინსი, კლასიკური ფორმა. ძალიან კომფორტულია." }, { id: 4, title: "ლამაზი ბლუზა", category: "shirt", size: "M", condition: "ახალივით", image: "https://images.unsplash.com/photo-1485462537746-965f33f7f6a7?w=400&h=500&fit=crop", owner: "თეა კ.", location: "თბილისი", uploadDate: "5 დღის წინ", likes: 6, description: "ნაზი და ელეგანტური ბლუზა, შესანიშნავია ოფისისთვის ან შეხვედრებისთვის." }, { id: 5, title: "სპორტული კედები", category: "shoes", size: "38", condition: "კარგი", image: "https://images.unsplash.com/photo-1549298916-b41d501d3772?w=400&h=500&fit=crop", owner: "ლუკა რ.", location: "ბათუმი", uploadDate: "1 დღის წინ", likes: 9, description: "კომფორტული სპორტული კედები, შესანიშნავია სირბილისთვის ან ყოველდღიური ცვლისთვის." }, { id: 6, title: "ვარდისფერი სვეტერი", category: "sweater", size: "S", condition: "მთლად ახალი", image: "https://images.unsplash.com/photo-1574180566232-aaad1b5b8450?w=400&h=500&fit=crop", owner: "სალომე ვ.", location: "თბილისი", uploadDate: "4 დღის წინ", likes: 18, description: "რბილი და თბილი სვეტერი, ნაზი ვარდისფერი ფერით. იდეალურია შემოდგომისთვის." } ]; const categories = [ { id: 'all', name: 'ყველა', icon: '👗' }, { id: 'dress', name: 'კაბები', icon: '👗' }, { id: 'shirt', name: 'მაისურები', icon: '👔' }, { id: 'pants', name: 'პანტალონები', icon: '👖' }, { id: 'coat', name: 'ქურთუკები', icon: '🧥' }, { id: 'shoes', name: 'ფეხსაცმელი', icon: '👟' }, { id: 'sweater', name: 'სვეტრები', icon: '🧶' } ]; const handleLike = (itemId) => { const newLikedItems = new Set(likedItems); if (newLikedItems.has(itemId)) { newLikedItems.delete(itemId); } else { newLikedItems.add(itemId); } setLikedItems(newLikedItems); }; const handleImageUpload = (event) => { const files = Array.from(event.target.files); files.forEach(file => { if (file.type.startsWith('image/')) { const reader = new FileReader(); reader.onload = (e) => { const newItem = { id: Date.now() + Math.random(), title: "ჩემი ნივთი", category: "other", size: "", condition: "კარგი", image: e.target.result, owner: "შენ", location: "ზუგდიდი", uploadDate: "ახლახან", likes: 0, description: "ჩემი ატვირთული ნივთი გაცვლისთვის" }; setUploadedImages(prev => [...prev, newItem]); }; reader.readAsDataURL(file); } }); }; const filteredItems = [...sampleItems, ...uploadedImages].filter(item => selectedCategory === 'all' || item.category === selectedCategory ); const ItemCard = ({ item }) => (
{item.title}
ზომა {item.size}

{item.title}

{item.description}

{item.owner}
{item.location}
{item.uploadDate}
{item.likes}
); return (
{/* Header */}

👗 ტანსაცმლის გაცვლა

{activeTab === 'browse' && ( <> {/* Categories */}

კატეგორიები

{categories.map(category => ( ))}
{/* Items Grid */}
{filteredItems.map(item => ( ))}
</> )} {activeTab === 'upload' && (

ახალი ნივთის დამატება

ატვირთეთ ტანსაცმლის ფოტო

აირჩიეთ ერთი ან რამდენიმე ფოტო თქვენი ტანსაცმლისა

{uploadedImages.length > 0 && (

ატვირთული ნივთები ({uploadedImages.length})

{uploadedImages.map(item => (
{item.title}
✓ ატვირთულია
))}
)}
)}
); }; export default ClothingSwapApp;

No comments:

Post a Comment

დავეხმაროთ ერთმანეთ ცნობიერების მაღლბაში, ის რაც დღეს ნაგავია - ხვალ ვაქციოთ საჭირო ნივთად

ნარჩენების კვლევის აპლიკაცია 🌱 ნარჩენების კვლევის აპლიკაცია სკოლების ნარჩენ...