This guide explains how to update and manage images throughout the Voyana tourism website.
- Location:
src/pages/ProfilePage.tsx - Component:
ProfileImageUpload.tsx - How to update: Click the camera icon on profile picture
- Supported formats: JPEG, PNG, WebP
- Max size: 2MB
- Location: Various page files (HomePage, ExplorePage, PlaceDetailsPage)
- Current images: Stored as URLs in component data
- How to update: Modify the image URLs in the respective files
- Location:
src/components/MemoryUploadModal.tsx - How to upload: Click "Share Memory" button on place details
- Supported formats: JPEG, PNG, WebP
- Max size: 5MB per image
- Max count: 5 images per memory
- Location:
src/pages/PlaceDetailsPage.tsx - How to add: Through the memory upload system
- Display: Shows in review sections
// In any component file, find the image URL and replace it
const place = {
image: 'https://new-image-url.com/image.jpg' // Replace this URL
};// Use the ImageUpload component for user uploads
<ImageUpload
onImageSelect={handleImageSelect}
maxSize={5}
acceptedTypes={['image/jpeg', 'image/png', 'image/webp']}
/>// Use ProfileImageUpload component
<ProfileImageUpload
currentImage={userAvatar}
onImageUpdate={handleProfileImageUpdate}
userName={user.name}
/>src/
βββ components/
β βββ ImageUpload.tsx # Generic image upload component
β βββ ProfileImageUpload.tsx # Profile picture upload
β βββ MemoryUploadModal.tsx # Memory/experience upload
βββ pages/
β βββ HomePage.tsx # Hero & featured destination images
β βββ ExplorePage.tsx # Place listing images
β βββ PlaceDetailsPage.tsx # Place detail images & galleries
β βββ ProfilePage.tsx # Profile & saved place images
βββ utils/
βββ imageUtils.ts # Image utility functions
File: src/pages/HomePage.tsx
const destinations = [
{
id: 1,
name: 'Jaipur, Rajasthan',
image: 'YOUR_NEW_IMAGE_URL_HERE', // Update this
// ... other properties
}
];File: src/pages/ExplorePage.tsx
const places = [
{
id: 1,
name: 'Amber Fort',
image: 'YOUR_NEW_IMAGE_URL_HERE', // Update this
// ... other properties
}
];File: src/pages/PlaceDetailsPage.tsx
const places = {
1: {
images: [
'YOUR_NEW_IMAGE_URL_1', // Update these
'YOUR_NEW_IMAGE_URL_2',
'YOUR_NEW_IMAGE_URL_3',
'YOUR_NEW_IMAGE_URL_4'
],
// ... other properties
}
};import { validateImageFile } from './utils/imageUtils';
const { isValid, error } = validateImageFile(file);
if (!isValid) {
console.error(error);
}import { resizeImage } from './utils/imageUtils';
const resizedBlob = await resizeImage(file, 800, 600, 0.8);import { createImagePreview } from './utils/imageUtils';
const previewUrl = await createImagePreview(file);- Pexels (Free): https://www.pexels.com/
- Unsplash (Free): https://unsplash.com/
- Pixabay (Free): https://pixabay.com/
- Resolution: Minimum 1260x750px
- Aspect Ratio: 16:9 or 4:3
- Format: JPEG (for photos), PNG (for graphics)
- Quality: High quality, well-lit, clear
- Resolution: 400x400px minimum
- Aspect Ratio: 1:1 (square)
- Format: JPEG or PNG
- Content: Clear face photo, professional
- Resolution: 800x600px minimum
- Format: JPEG, PNG, WebP
- Size: Under 5MB each
- Content: Travel experiences, places, food, culture
When implementing with a real backend:
// Example API call for image upload
const uploadImage = async (file: File) => {
const formData = new FormData();
formData.append('image', file);
const response = await fetch('/api/upload', {
method: 'POST',
body: formData
});
const data = await response.json();
return data.imageUrl;
};- For immediate updates: Replace image URLs directly in component files
- For user uploads: Use the provided upload components
- For new features: Extend the existing image utilities
The image system is designed to be flexible and easily extensible for future enhancements!