## Major Features Added: ### Presentation Management - Complete CRUD operations for presentations (create, read, update, delete) - IndexedDB storage for offline presentation data - Comprehensive presentation list view with metadata - Navigation integration with header menu ### Slide Management - Full slide editor with layout selection and content editing - Live preview with theme styling applied - Speaker notes functionality - Enhanced layout previews with realistic sample content - Themed layout selection with proper CSS inheritance ### Aspect Ratio System - Support for 3 common presentation formats: 16:9, 4:3, 16:10 - Global CSS system baked into theme engine - Visual aspect ratio selection in presentation creation - Responsive scaling for different viewing contexts - Print-optimized styling with proper dimensions ### User Experience Improvements - Enhanced sample content generation for realistic previews - Improved navigation with presentation management - Better form styling and user interaction - Comprehensive error handling and loading states - Mobile-responsive design throughout ### Technical Infrastructure - Complete TypeScript type system for presentations - Modular component architecture - CSS aspect ratio classes for theme consistency - Enhanced template rendering with live updates - Robust storage utilities with proper error handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
124 lines
4.2 KiB
TypeScript
124 lines
4.2 KiB
TypeScript
import React from 'react';
|
|
import { Link, useLocation } from 'react-router-dom';
|
|
|
|
export const AppHeader: React.FC = () => {
|
|
const location = useLocation();
|
|
|
|
const getPageTitle = () => {
|
|
if (location.pathname === '/') {
|
|
return 'Welcome to Slideshare';
|
|
}
|
|
if (location.pathname === '/presentations') {
|
|
return 'My Presentations';
|
|
}
|
|
if (location.pathname === '/presentations/new') {
|
|
return 'Create New Presentation';
|
|
}
|
|
if (location.pathname.includes('/slide/') && location.pathname.includes('/edit')) {
|
|
const segments = location.pathname.split('/');
|
|
const slideId = segments[4];
|
|
if (slideId === 'new') {
|
|
return 'Add New Slide';
|
|
} else {
|
|
return 'Edit Slide';
|
|
}
|
|
}
|
|
if (location.pathname.includes('/presentations/') && location.pathname.includes('/slides/')) {
|
|
const segments = location.pathname.split('/');
|
|
if (segments.length === 6 && segments[1] === 'presentations') {
|
|
const mode = segments[3]; // 'edit' or 'view'
|
|
const slideNumber = segments[5];
|
|
if (mode === 'edit') {
|
|
return `Editing Slide ${slideNumber}`;
|
|
} else if (mode === 'view') {
|
|
return `Viewing Slide ${slideNumber}`;
|
|
}
|
|
return `Presentation Slide ${slideNumber}`;
|
|
}
|
|
}
|
|
if (location.pathname === '/themes') {
|
|
return 'Theme Browser';
|
|
}
|
|
if (location.pathname.includes('/themes/')) {
|
|
const segments = location.pathname.split('/');
|
|
if (segments.length === 3) {
|
|
return `Theme: ${segments[2]}`;
|
|
}
|
|
if (segments.length === 5 && segments[3] === 'layouts') {
|
|
return `Layout: ${segments[4]}`;
|
|
}
|
|
}
|
|
return 'Slideshare';
|
|
};
|
|
|
|
const getPageDescription = () => {
|
|
if (location.pathname === '/') {
|
|
return 'Create beautiful presentations with customizable themes';
|
|
}
|
|
if (location.pathname === '/presentations') {
|
|
return 'View and manage all your presentations';
|
|
}
|
|
if (location.pathname === '/presentations/new') {
|
|
return 'Select a theme and enter details for your new presentation';
|
|
}
|
|
if (location.pathname.includes('/slide/') && location.pathname.includes('/edit')) {
|
|
const segments = location.pathname.split('/');
|
|
const slideId = segments[4];
|
|
if (slideId === 'new') {
|
|
return 'Choose a layout and add content for your new slide';
|
|
} else {
|
|
return 'Edit slide content and layout';
|
|
}
|
|
}
|
|
if (location.pathname.includes('/presentations/') && location.pathname.includes('/slides/')) {
|
|
const segments = location.pathname.split('/');
|
|
if (segments.length === 6 && segments[1] === 'presentations') {
|
|
const mode = segments[3];
|
|
if (mode === 'edit') {
|
|
return 'Edit slide content, add notes, and manage your presentation';
|
|
} else if (mode === 'view') {
|
|
return 'View your presentation slides in read-only mode';
|
|
}
|
|
}
|
|
return 'View and manage your presentation slides';
|
|
}
|
|
if (location.pathname === '/themes') {
|
|
return 'Browse and select themes for your presentations';
|
|
}
|
|
if (location.pathname.includes('/themes/')) {
|
|
const segments = location.pathname.split('/');
|
|
if (segments.length === 3) {
|
|
return 'View theme details, layouts, and color palette';
|
|
}
|
|
if (segments.length === 5 && segments[3] === 'layouts') {
|
|
return 'View layout template, slots, and configuration';
|
|
}
|
|
}
|
|
return 'Slide authoring and presentation tool';
|
|
};
|
|
|
|
return (
|
|
<header className="app-header">
|
|
<nav className="app-nav">
|
|
<Link to="/" className="app-logo">
|
|
Slideshare
|
|
</Link>
|
|
<div className="nav-actions">
|
|
<Link to="/presentations" className="nav-link">
|
|
My Presentations
|
|
</Link>
|
|
<Link to="/presentations/new" className="nav-button primary">
|
|
Create Presentation
|
|
</Link>
|
|
<Link to="/themes" className="nav-link">
|
|
Themes
|
|
</Link>
|
|
</div>
|
|
</nav>
|
|
<div className="page-title-section">
|
|
<h1 className="page-title">{getPageTitle()}</h1>
|
|
<p className="page-description">{getPageDescription()}</p>
|
|
</div>
|
|
</header>
|
|
);
|
|
}; |