mirror of
https://github.com/ceratic/project_vollidioten_website.git
synced 2026-05-14 00:16:47 +02:00
feat: add world map functionality and admin map management
- Added world map page with interactive marker display - Implemented admin map management for marker CRUD operations - Added map layers and markers seed data to database - Integrated new routes for map functionality - Updated database configuration for production environment - Added documentation page route - Enhanced package.json with required dependencies for map features
This commit is contained in:
@@ -4,6 +4,7 @@ import { authService } from '../services/AuthService';
|
||||
import NpcBannerManagementModal from '../components/NpcBannerManagementModal';
|
||||
import NpcLogoManagementModal from '../components/NpcLogoManagementModal';
|
||||
import NpcGalleryManagementModal from '../components/NpcGalleryManagementModal';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
interface AdminPageProps {
|
||||
onBack: () => void;
|
||||
@@ -699,6 +700,7 @@ const EditNpcCompanyCard: React.FC<{ company: any; npcCitizens: any[]; onUpdate:
|
||||
};
|
||||
|
||||
const AdminPage: React.FC<AdminPageProps> = ({ onBack }) => {
|
||||
const navigate = useNavigate();
|
||||
const [user, setUser] = useState(authService.getUser());
|
||||
const [activeTab, setActiveTab] = useState<'overview' | 'create-npc' | 'edit-npcs' | 'cities' | 'create-city' | 'manage-admins'>('overview');
|
||||
const [npcs, setNpcs] = useState<any>({ citizens: [], companies: [] });
|
||||
@@ -729,7 +731,7 @@ const AdminPage: React.FC<AdminPageProps> = ({ onBack }) => {
|
||||
if (!isAdmin) return;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (activeTab === 'edit-npcs' || activeTab === 'create-npc') {
|
||||
if (activeTab === 'edit-npcs' || activeTab === 'create-npc') {
|
||||
loadNpcs();
|
||||
} else if (activeTab === 'cities' || activeTab === 'create-city') {
|
||||
loadCities();
|
||||
@@ -813,7 +815,9 @@ const AdminPage: React.FC<AdminPageProps> = ({ onBack }) => {
|
||||
defenseRating: 5,
|
||||
government: 'Demokratie',
|
||||
specialty: 'Handel'
|
||||
}, null, 2)
|
||||
}, null, 2),
|
||||
bannerFile: null as File | null,
|
||||
logoFile: null as File | null
|
||||
});
|
||||
|
||||
const [editingCity, setEditingCity] = useState<any>(null);
|
||||
@@ -991,6 +995,12 @@ const AdminPage: React.FC<AdminPageProps> = ({ onBack }) => {
|
||||
>
|
||||
Stadt erstellen
|
||||
</button>
|
||||
<button
|
||||
onClick={() => navigate('/admin/map-management')}
|
||||
className={`px-6 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap border-transparent text-textMuted hover:text-white`}
|
||||
>
|
||||
Karten-Management
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Error Display */}
|
||||
|
||||
Reference in New Issue
Block a user