Refactor app into components and add file upload progress

Components created:
- Header: App header with GitHub links
- ActionSelector: Step 1 - Choose create/join/scan
- MethodSelector: Step 2 - Choose connection method
- ConnectionForm: Step 3 - Enter connection details
- ChatView: Step 4 - Connected chat interface
- Message: Individual message display (text/file)
- QRScanner: QR code scanning component
- QRCodeDisplay: QR code display component
- FileUploadProgress: Progress bar for file uploads

Features:
- Clean component separation with props
- File upload progress bar with percentage
- Cancel upload functionality
- Disabled file button during upload
- Visual progress indicator with gradient
- All logic remains in App.jsx for state management
This commit is contained in:
2025-11-07 22:26:19 +01:00
parent 8e9edb6d79
commit 9f9068e7c7
11 changed files with 622 additions and 365 deletions

View File

@@ -514,6 +514,74 @@ input[type="text"]:disabled {
transform: scale(1.05);
}
.file-upload-progress {
background: #f8f9fa;
border: 2px solid #667eea;
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
}
.file-upload-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.file-upload-name {
font-weight: 600;
color: #333;
font-size: 0.9rem;
}
.file-upload-cancel {
background: #dc3545;
color: white;
border: none;
width: 24px;
height: 24px;
border-radius: 50%;
font-size: 1.2rem;
line-height: 1;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
}
.file-upload-cancel:hover {
background: #c82333;
transform: scale(1.1);
}
.progress-bar {
background: #e0e0e0;
border-radius: 8px;
height: 24px;
overflow: hidden;
position: relative;
}
.progress-bar-fill {
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
height: 100%;
transition: width 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.progress-text {
color: white;
font-size: 0.75rem;
font-weight: 600;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.logs {
margin-top: 24px;
border-top: 2px solid #f0f0f0;