# E-Voting Frontend Theme Implementation Guide
## Current Status
✅ **Completed**
- Tailwind CSS setup with dark theme
- ShadCN UI component library with custom colors
- Header component - fully themed with dark palette
- VoteCard component - fully themed with ShadCN
- Alert, Modal, Footer, LoadingSpinner - fully themed
- LoginPage - completely refactored with ShadCN components
- App name updated from "React App" to "E-Voting"
- All core infrastructure in place
⏳ **Pending**
- RegisterPage
- HomePage
- DashboardPage
- ActiveVotesPage, UpcomingVotesPage, HistoriquePage
- ArchivesPage, ElectionDetailsPage
- VotingPage
- ProfilePage
- ElectionDetailsModal
## Dark Theme Palette
### Color Variables (CSS Custom Properties)
```css
--color-accent-warm: #e8704b /* Primary accent */
--text-primary: #e0e0e0 /* Main text */
--text-secondary: #a3a3a3 /* Secondary text */
--text-tertiary: #737373 /* Muted text */
--bg-primary: #171717 /* Main background */
--bg-secondary: #171717 /* Card/secondary background */
--bg-overlay-light: rgba(255, 255, 255, 0.05)
--bg-overlay-dark: rgba(0, 0, 0, 0.8)
```
### Semantic Colors
```
Success: #10b981
Warning: #f97316
Danger: #ef4444
Info: #3b82f6
```
### Tailwind Color Classes
```
text-text-primary → #e0e0e0
text-text-secondary → #a3a3a3
text-text-tertiary → #737373
bg-bg-primary → #171717
bg-bg-secondary → #171717
text-accent-warm → #e8704b
border-text-tertiary → #4a4a4a
```
## Page Refactoring Checklist
### RegisterPage (Similar to LoginPage)
```jsx
// Use the same layout as LoginPage
// Replace className="auth-*" with Tailwind utilities
// Use ShadCN: Card, CardHeader, CardTitle, CardDescription, CardContent, Button, Input, Label, Alert
// Add form validation styling
```
**Key Sections:**
1. Left side: Registration form card
2. Right side: Benefits illustration (hidden on mobile)
3. Error/success alerts using ShadCN Alert
### HomePage
```jsx
// Hero section with gradient or accent color
// Features section with cards
// CTA buttons with proper styling
```
**Key Sections:**
1. Hero: Large heading, subtitle, CTA buttons
2. Stats: 3-4 stat cards showing system metrics
3. Features: Feature cards with icons and descriptions
4. How it Works: Step-by-step guide
5. CTA: Final call-to-action
**Styling Pattern:**
```jsx
// Hero Section
Your Title
Description
{/* Illustration or graphic */}
// Feature Cards
{features.map((feature) => (
{feature.icon}
{feature.title}
{feature.description}
))}
```
### DashboardPage
```jsx
// Stats grid at top
// Active votes section with VoteCard grid
// Upcoming votes section with VoteCard grid
// Historique section with VoteCard list
```
**Key Sections:**
1. Stats cards (Active, Future, Completed, Total)
2. "Active Votes" section with grid of VoteCard
3. "Upcoming Votes" section with VoteCard list
4. "Vote History" section with VoteCard list
**Styling Pattern:**
```jsx
{/* Stats Grid */}
{stats.map((stat) => (
{stat.value}
{stat.label}
))}
{/* Section */}
Active Votes
{votes.map((vote) => (
))}
```
### ActiveVotesPage & UpcomingVotesPage
Similar to DashboardPage sections, but focused:
- Filter and search functionality
- All active/upcoming votes displayed as card grid
- Empty state when no votes
### HistoriquePage
- List of completed elections
- Show user's vote choice
- Vote date display
- Results if published
### ArchivesPage
- Public archives of all elections
- Card grid layout
- Search/filter functionality
### ElectionDetailsPage
- Full election information
- Candidate list
- Results display
- Comments/discussion (if applicable)
### VotingPage
- Large, focused voting interface
- Election details prominent
- Candidate/option selection interface
- Confirm and submit vote
- Confirmation message after voting
### ProfilePage
- User information card
- Edit profile form
- Password change form
- Delete account option
- Activity history
### ElectionDetailsModal
```jsx
// Replace Modal component with ShadCN Dialog
// Show election details
// Show candidates
// Show results if published
// Show user's vote if applicable
```
**Example:**
```jsx
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '../lib/ui';
```
## Common Styling Patterns
### Background Sections
```jsx