250 lines
7.8 KiB
Markdown
250 lines
7.8 KiB
Markdown
# Komponenten-Struktur Optimierung
|
|
|
|
## 📁 Neue Ordnerstruktur
|
|
|
|
Die Livewire-Komponenten wurden in logische Unterordner organisiert für bessere Wartbarkeit und Übersichtlichkeit:
|
|
|
|
```
|
|
resources/views/livewire/web/components/
|
|
├── ui/ # UI-Komponenten (Header, Footer, Forms)
|
|
│ ├── header.blade.php
|
|
│ ├── footer.blade.php
|
|
│ └── contact-form.blade.php
|
|
├── sections/ # Inhalts-Sektionen
|
|
│ ├── hero.blade.php
|
|
│ ├── ecosystem-core.blade.php
|
|
│ ├── vision-section.blade.php
|
|
│ ├── brand-worlds.blade.php
|
|
│ ├── final-cta.blade.php
|
|
│ ├── partner-hero.blade.php
|
|
│ ├── partner-benefits.blade.php
|
|
│ ├── partner-process.blade.php
|
|
│ ├── commitment-section.blade.php
|
|
│ ├── dark-stats-section.blade.php
|
|
│ ├── spotlights-section.blade.php
|
|
│ ├── final-commitment.blade.php
|
|
│ ├── about-hero.blade.php
|
|
│ ├── our-story.blade.php
|
|
│ ├── leadership-team.blade.php
|
|
│ ├── our-values.blade.php
|
|
│ ├── ecosystem-hero.blade.php
|
|
│ ├── ecosystem-stats.blade.php
|
|
│ ├── end-customer-section.blade.php
|
|
│ ├── broker-section.blade.php
|
|
│ ├── supplier-section.blade.php
|
|
│ ├── digital-core.blade.php
|
|
│ ├── magazin-list.blade.php
|
|
│ └── magazin-detail.blade.php
|
|
└── demo/ # Demo-Komponenten
|
|
├── theme-info.blade.php
|
|
├── logo-demo.blade.php
|
|
├── color-demo.blade.php
|
|
├── button-demo.blade.php
|
|
├── theme-switcher.blade.php
|
|
└── demo-section.blade.php
|
|
```
|
|
|
|
## 🎯 Komponenten-Kategorien
|
|
|
|
### **UI-Komponenten** (`ui/`)
|
|
- **Zweck:** Wiederverwendbare UI-Elemente
|
|
- **Verwendung:** Header, Footer, Formulare
|
|
- **Beispiele:**
|
|
- `header.blade.php` - Navigation und Logo
|
|
- `footer.blade.php` - Footer mit Links und Logo
|
|
- `contact-form.blade.php` - Kontaktformular
|
|
|
|
### **Sektions-Komponenten** (`sections/`)
|
|
- **Zweck:** Inhalts-Sektionen für verschiedene Seiten
|
|
- **Verwendung:** Hero-Bereiche, Inhalts-Sektionen, CTAs
|
|
- **Beispiele:**
|
|
- `hero.blade.php` - Haupt-Hero-Bereich
|
|
- `ecosystem-core.blade.php` - Ecosystem-Darstellung
|
|
- `partner-hero.blade.php` - Partner-Hero-Bereich
|
|
|
|
### **Demo-Komponenten** (`demo/`)
|
|
- **Zweck:** Theme-Demo und Testing-Komponenten
|
|
- **Verwendung:** Theme-Demo-Seite, Entwicklungstools
|
|
- **Beispiele:**
|
|
- `theme-info.blade.php` - Theme-Informationen
|
|
- `color-demo.blade.php` - Farb-Demo
|
|
- `button-demo.blade.php` - Button-Demo
|
|
|
|
## 🔄 Aktualisierte View-Referenzen
|
|
|
|
### **Vorher:**
|
|
```blade
|
|
<livewire:web.components.header />
|
|
<livewire:web.components.hero />
|
|
<livewire:web.components.footer />
|
|
```
|
|
|
|
### **Nachher:**
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<livewire:web.components.sections.hero />
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
## 📋 Aktualisierte Views
|
|
|
|
### **Home-View** (`web/home.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.sections.hero />
|
|
<livewire:web.components.sections.ecosystem-core />
|
|
<livewire:web.components.sections.vision-section />
|
|
<livewire:web.components.sections.brand-worlds />
|
|
<livewire:web.components.sections.final-cta />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **Partner-View** (`web/partner.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.sections.partner-hero />
|
|
<livewire:web.components.sections.partner-benefits />
|
|
<livewire:web.components.sections.partner-process />
|
|
<livewire:web.components.sections.commitment-section />
|
|
<livewire:web.components.sections.dark-stats-section />
|
|
<livewire:web.components.sections.spotlights-section />
|
|
<livewire:web.components.sections.final-commitment />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **About-View** (`web/about.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.sections.about-hero />
|
|
<livewire:web.components.sections.our-story />
|
|
<livewire:web.components.sections.leadership-team />
|
|
<livewire:web.components.sections.our-values />
|
|
<livewire:web.components.sections.partner-cta />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **Contact-View** (`web/contact.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.ui.contact-form />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **Ecosystem-View** (`web/ecosystem.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.sections.ecosystem-hero />
|
|
<livewire:web.components.sections.ecosystem-stats />
|
|
<livewire:web.components.sections.end-customer-section />
|
|
<livewire:web.components.sections.broker-section />
|
|
<livewire:web.components.sections.supplier-section />
|
|
<livewire:web.components.sections.digital-core />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **Magazin-Views** (`web/magazin.blade.php`, `web/magazin-detail.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.sections.magazin-list />
|
|
<!-- oder -->
|
|
<livewire:web.components.sections.magazin-detail :id="$id ?? 1" />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
### **Theme-Demo-View** (`web/theme-demo.blade.php`)
|
|
```blade
|
|
<livewire:web.components.ui.header />
|
|
<main>
|
|
<livewire:web.components.demo.theme-info />
|
|
<livewire:web.components.demo.logo-demo />
|
|
<livewire:web.components.demo.color-demo />
|
|
<livewire:web.components.demo.button-demo />
|
|
<livewire:web.components.demo.theme-switcher />
|
|
</main>
|
|
<livewire:web.components.ui.footer />
|
|
```
|
|
|
|
## 🚀 Vorteile der neuen Struktur
|
|
|
|
### **1. Bessere Organisation**
|
|
- ✅ Logische Gruppierung nach Funktionalität
|
|
- ✅ Klare Trennung zwischen UI, Inhalt und Demo
|
|
- ✅ Einfache Navigation durch die Komponenten
|
|
|
|
### **2. Verbesserte Wartbarkeit**
|
|
- ✅ Änderungen an UI-Komponenten betreffen alle Seiten
|
|
- ✅ Sektions-Komponenten sind wiederverwendbar
|
|
- ✅ Demo-Komponenten sind isoliert
|
|
|
|
### **3. Skalierbarkeit**
|
|
- ✅ Einfache Erweiterung um neue Komponenten
|
|
- ✅ Klare Namenskonventionen
|
|
- ✅ Modulare Architektur
|
|
|
|
### **4. Entwicklerfreundlichkeit**
|
|
- ✅ Intuitive Pfad-Struktur
|
|
- ✅ Vorhersagbare Komponenten-Namen
|
|
- ✅ Einfache Suche und Navigation
|
|
|
|
## 🔧 Wartung und Erweiterung
|
|
|
|
### **Neue UI-Komponente hinzufügen:**
|
|
```bash
|
|
# Komponente erstellen
|
|
php artisan livewire:make Web/Components/UI/NewComponent
|
|
|
|
# View in ui/ Ordner erstellen
|
|
touch resources/views/livewire/web/components/ui/new-component.blade.php
|
|
```
|
|
|
|
### **Neue Sektions-Komponente hinzufügen:**
|
|
```bash
|
|
# Komponente erstellen
|
|
php artisan livewire:make Web/Components/Sections/NewSection
|
|
|
|
# View in sections/ Ordner erstellen
|
|
touch resources/views/livewire/web/components/sections/new-section.blade.php
|
|
```
|
|
|
|
### **Neue Demo-Komponente hinzufügen:**
|
|
```bash
|
|
# Komponente erstellen
|
|
php artisan livewire:make Web/Components/Demo/NewDemo
|
|
|
|
# View in demo/ Ordner erstellen
|
|
touch resources/views/livewire/web/components/demo/new-demo.blade.php
|
|
```
|
|
|
|
## 📝 Best Practices
|
|
|
|
1. **Namenskonventionen:** Verwende kebab-case für Dateinamen
|
|
2. **Ordnerstruktur:** Halte die logische Gruppierung bei
|
|
3. **Wiederverwendbarkeit:** UI-Komponenten sollten generisch sein
|
|
4. **Spezifität:** Sektions-Komponenten können spezifisch sein
|
|
5. **Isolation:** Demo-Komponenten sollten isoliert bleiben
|
|
|
|
## 🔍 Migration abgeschlossen
|
|
|
|
Alle Views wurden erfolgreich aktualisiert:
|
|
- ✅ `web/home.blade.php`
|
|
- ✅ `web/partner.blade.php`
|
|
- ✅ `web/about.blade.php`
|
|
- ✅ `web/contact.blade.php`
|
|
- ✅ `web/ecosystem.blade.php`
|
|
- ✅ `web/magazin.blade.php`
|
|
- ✅ `web/magazin-detail.blade.php`
|
|
- ✅ `web/theme-demo.blade.php`
|
|
|
|
Die neue Struktur ist jetzt vollständig implementiert und alle Views verwenden die optimierten Komponenten-Pfade! 🎉
|