make website run
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { cookies } from 'next/headers';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { getAuthService } from '../../../../lib/auth';
|
||||
|
||||
const STATE_COOKIE = 'gp_demo_auth_state';
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import {
|
||||
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
import type {
|
||||
DashboardOverviewViewModel,
|
||||
DashboardFeedItemSummaryViewModel,
|
||||
|
||||
@@ -36,13 +36,6 @@ import {
|
||||
Megaphone,
|
||||
DollarSign,
|
||||
} from 'lucide-react';
|
||||
import {
|
||||
getGetProfileOverviewUseCase,
|
||||
getGetDriverTeamUseCase,
|
||||
getImageService,
|
||||
getGetAllTeamsUseCase,
|
||||
getGetTeamMembersUseCase,
|
||||
} from '@/lib/di-container';
|
||||
import { AllTeamsPresenter } from '@/lib/presenters/AllTeamsPresenter';
|
||||
import { TeamMembersPresenter } from '@/lib/presenters/TeamMembersPresenter';
|
||||
import { Driver, EntityMappers, type Team } from '@core/racing';
|
||||
|
||||
@@ -27,7 +27,6 @@ import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import { getGetDriversLeaderboardUseCase } from '@/lib/di-container';
|
||||
import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter';
|
||||
import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter';
|
||||
import Image from 'next/image';
|
||||
|
||||
@@ -4,14 +4,12 @@ import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import './globals.css';
|
||||
import { getAppMode } from '@/lib/mode';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
import { AlphaNav } from '@/components/alpha/AlphaNav';
|
||||
import AlphaBanner from '@/components/alpha/AlphaBanner';
|
||||
import AlphaFooter from '@/components/alpha/AlphaFooter';
|
||||
import { AuthProvider } from '@/lib/auth/AuthContext';
|
||||
import NotificationProvider from '@/components/notifications/NotificationProvider';
|
||||
import DevToolbar from '@/components/dev/DevToolbar';
|
||||
import { initializeDIContainer } from '@/lib/di-setup';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -50,12 +48,11 @@ export default async function RootLayout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
await initializeDIContainer();
|
||||
const mode = getAppMode();
|
||||
|
||||
if (mode === 'alpha') {
|
||||
const authService = getAuthService();
|
||||
const session = await authService.getCurrentSession();
|
||||
//const session = await authService.getCurrentSession();
|
||||
const session = null;
|
||||
|
||||
return (
|
||||
<html lang="en" className="scroll-smooth overflow-x-hidden">
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import { getGetDriversLeaderboardUseCase } from '@/lib/di-container';
|
||||
import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter';
|
||||
import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter';
|
||||
import Image from 'next/image';
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
} from 'lucide-react';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import { getGetDriversLeaderboardUseCase, getGetTeamsLeaderboardUseCase } from '@/lib/di-container';
|
||||
import { DriversLeaderboardPresenter } from '@/lib/presenters/DriversLeaderboardPresenter';
|
||||
import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter';
|
||||
import type { DriverLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/IDriversLeaderboardPresenter';
|
||||
|
||||
@@ -4,14 +4,6 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useParams, usePathname, useRouter } from 'next/navigation';
|
||||
import Breadcrumbs from '@/components/layout/Breadcrumbs';
|
||||
import LeagueHeader from '@/components/leagues/LeagueHeader';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getDriverRepository,
|
||||
getLeagueMembershipRepository,
|
||||
getSeasonRepository,
|
||||
getSponsorRepository,
|
||||
getSeasonSponsorshipRepository,
|
||||
} from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
import type { League } from '@core/racing/domain/entities/League';
|
||||
|
||||
@@ -23,19 +23,6 @@ import {
|
||||
type LeagueScoringConfigDTO,
|
||||
Race,
|
||||
} from '@core/racing';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getRaceRepository,
|
||||
getDriverRepository,
|
||||
getGetLeagueScoringConfigUseCase,
|
||||
getDriverStats,
|
||||
getAllDriverRankings,
|
||||
getGetLeagueStatsUseCase,
|
||||
getSeasonRepository,
|
||||
getSponsorRepository,
|
||||
getSeasonSponsorshipRepository,
|
||||
getCompleteRaceUseCase,
|
||||
} from '@/lib/di-container';
|
||||
import { LeagueScoringConfigPresenter } from '@/lib/presenters/LeagueScoringConfigPresenter';
|
||||
import { Trophy, Star, ExternalLink, Calendar, Users } from 'lucide-react';
|
||||
import { getMembership, getLeagueMembers } from '@/lib/leagueMembership';
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
import Card from '@/components/ui/Card';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getGetLeagueScoringConfigUseCase
|
||||
} from '@/lib/di-container';
|
||||
import { LeagueScoringConfigPresenter } from '@/lib/presenters/LeagueScoringConfigPresenter';
|
||||
import type { LeagueScoringConfigDTO } from '@core/racing/application/dto/LeagueScoringConfigDTO';
|
||||
import type { League } from '@core/racing/domain/entities/League';
|
||||
|
||||
@@ -6,7 +6,6 @@ import LeagueSchedule from '@/components/leagues/LeagueSchedule';
|
||||
import ScheduleRaceForm from '@/components/leagues/ScheduleRaceForm';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { getLeagueMembershipRepository } from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
|
||||
|
||||
@@ -4,16 +4,6 @@ import { useState, useEffect, useMemo } from 'react';
|
||||
import { useParams, useRouter } from 'next/navigation';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getDriverRepository,
|
||||
getGetLeagueFullConfigUseCase,
|
||||
getLeagueMembershipRepository,
|
||||
getDriverStats,
|
||||
getAllDriverRankings,
|
||||
getListLeagueScoringPresetsUseCase,
|
||||
getTransferLeagueOwnershipUseCase
|
||||
} from '@/lib/di-container';
|
||||
import { LeagueFullConfigPresenter } from '@/lib/presenters/LeagueFullConfigPresenter';
|
||||
import { LeagueScoringPresetsPresenter } from '@/lib/presenters/LeagueScoringPresetsPresenter';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
|
||||
@@ -5,10 +5,6 @@ import { useParams } from 'next/navigation';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import { LeagueSponsorshipsSection } from '@/components/leagues/LeagueSponsorshipsSection';
|
||||
import {
|
||||
getLeagueRepository,
|
||||
getLeagueMembershipRepository,
|
||||
} from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
import { AlertTriangle, Building, DollarSign } from 'lucide-react';
|
||||
|
||||
@@ -9,11 +9,6 @@ import {
|
||||
type DriverDTO,
|
||||
type LeagueDriverSeasonStatsDTO,
|
||||
} from '@core/racing';
|
||||
import {
|
||||
getGetLeagueDriverSeasonStatsUseCase,
|
||||
getDriverRepository,
|
||||
getLeagueMembershipRepository
|
||||
} from '@/lib/di-container';
|
||||
import { LeagueDriverSeasonStatsPresenter } from '@/lib/presenters/LeagueDriverSeasonStatsPresenter';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
|
||||
@@ -8,15 +8,6 @@ import Button from '@/components/ui/Button';
|
||||
import { ReviewProtestModal } from '@/components/leagues/ReviewProtestModal';
|
||||
import QuickPenaltyModal from '@/components/leagues/QuickPenaltyModal';
|
||||
import PenaltyFAB from '@/components/leagues/PenaltyFAB';
|
||||
import {
|
||||
getRaceRepository,
|
||||
getProtestRepository,
|
||||
getDriverRepository,
|
||||
getLeagueMembershipRepository,
|
||||
getReviewProtestUseCase,
|
||||
getApplyPenaltyUseCase,
|
||||
getPenaltyRepository
|
||||
} from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
import type { Protest } from '@core/racing/domain/entities/Protest';
|
||||
|
||||
@@ -5,16 +5,6 @@ import { useParams, useRouter } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import {
|
||||
getProtestRepository,
|
||||
getRaceRepository,
|
||||
getDriverRepository,
|
||||
getLeagueMembershipRepository,
|
||||
getReviewProtestUseCase,
|
||||
getApplyPenaltyUseCase,
|
||||
getRequestProtestDefenseUseCase,
|
||||
getSendNotificationUseCase
|
||||
} from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
import type { Protest } from '@core/racing/domain/entities/Protest';
|
||||
|
||||
@@ -32,7 +32,7 @@ import Input from '@/components/ui/Input';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import type { LeagueSummaryViewModel } from '@core/racing/application/presenters/IAllLeaguesWithCapacityAndScoringPresenter';
|
||||
import { AllLeaguesWithCapacityAndScoringPresenter } from '@/lib/presenters/AllLeaguesWithCapacityAndScoringPresenter';
|
||||
import { getGetAllLeaguesWithCapacityAndScoringUseCase } from '@/lib/di-container';
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// TYPES
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
import OnboardingWizard from '@/components/onboarding/OnboardingWizard';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import { getAppMode } from '@/lib/mode';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
import Hero from '@/components/landing/Hero';
|
||||
import AlternatingSection from '@/components/landing/AlternatingSection';
|
||||
import FeatureGrid from '@/components/landing/FeatureGrid';
|
||||
@@ -15,23 +14,19 @@ import SimPlatformMockup from '@/components/mockups/SimPlatformMockup';
|
||||
import MockupStack from '@/components/ui/MockupStack';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import {
|
||||
topLeagues,
|
||||
teams,
|
||||
getUpcomingRaces,
|
||||
} from '@core/testing-support';
|
||||
|
||||
export default async function HomePage() {
|
||||
const authService = getAuthService();
|
||||
const session = await authService.getCurrentSession();
|
||||
|
||||
const session = null; // TODO
|
||||
if (session) {
|
||||
redirect('/dashboard');
|
||||
}
|
||||
|
||||
const mode = getAppMode();
|
||||
const isAlpha = mode === 'alpha';
|
||||
const upcomingRaces = getUpcomingRaces(3);
|
||||
// const upcomingRaces = getUpcomingRaces(3);
|
||||
const upcomingRaces = []; // TODO
|
||||
const topLeagues = []; // TODO
|
||||
const teams = []; // TODO
|
||||
|
||||
return (
|
||||
<main className="min-h-screen">
|
||||
|
||||
@@ -4,7 +4,6 @@ import { useEffect, useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import { getLeagueRepository, getLeagueMembershipRepository } from '@/lib/di-container';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import type { League } from '@core/racing/domain/entities/League';
|
||||
import type { LeagueMembership } from '@core/racing/domain/entities/LeagueMembership';
|
||||
|
||||
@@ -34,11 +34,6 @@ import {
|
||||
Percent,
|
||||
Activity,
|
||||
} from 'lucide-react';
|
||||
import {
|
||||
getGetProfileOverviewUseCase,
|
||||
getImageService,
|
||||
getUpdateDriverProfileUseCase,
|
||||
} from '@/lib/di-container';
|
||||
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
|
||||
import type {
|
||||
ProfileOverviewViewModel,
|
||||
|
||||
@@ -6,16 +6,7 @@ import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Breadcrumbs from '@/components/layout/Breadcrumbs';
|
||||
import PendingSponsorshipRequests, { type PendingRequestDTO } from '@/components/sponsors/PendingSponsorshipRequests';
|
||||
import {
|
||||
getGetPendingSponsorshipRequestsUseCase,
|
||||
getAcceptSponsorshipRequestUseCase,
|
||||
getRejectSponsorshipRequestUseCase,
|
||||
getDriverRepository,
|
||||
getLeagueRepository,
|
||||
getTeamRepository,
|
||||
getLeagueMembershipRepository,
|
||||
getTeamMembershipRepository,
|
||||
} from '@/lib/di-container';
|
||||
|
||||
import { PendingSponsorshipRequestsPresenter } from '@/lib/presenters/PendingSponsorshipRequestsPresenter';
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { isLeagueAdminOrHigherRole } from '@/lib/leagueRoles';
|
||||
|
||||
@@ -8,7 +8,7 @@ import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Breadcrumbs from '@/components/layout/Breadcrumbs';
|
||||
import SponsorInsightsCard, { useSponsorMode, MetricBuilders, SlotTemplates } from '@/components/sponsors/SponsorInsightsCard';
|
||||
import { getImageService } from '@/lib/di-container';
|
||||
|
||||
import { TeamMembersPresenter } from '@/lib/presenters/TeamMembersPresenter';
|
||||
import { TeamDetailsPresenter } from '@/lib/presenters/TeamDetailsPresenter';
|
||||
import type { TeamDetailsViewModel } from '@core/racing/application/presenters/ITeamDetailsPresenter';
|
||||
@@ -16,11 +16,7 @@ import TeamRoster from '@/components/teams/TeamRoster';
|
||||
import TeamStandings from '@/components/teams/TeamStandings';
|
||||
import TeamAdmin from '@/components/teams/TeamAdmin';
|
||||
import JoinTeamButton from '@/components/teams/JoinTeamButton';
|
||||
import {
|
||||
getGetTeamDetailsUseCase,
|
||||
getGetTeamMembersUseCase,
|
||||
getTeamMembershipRepository,
|
||||
} from '@/lib/di-container';
|
||||
|
||||
import { useEffectiveDriverId } from '@/lib/currentDriver';
|
||||
import { Users, Trophy, TrendingUp, Star, Zap } from 'lucide-react';
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import { getGetTeamsLeaderboardUseCase } from '@/lib/di-container';
|
||||
import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter';
|
||||
import type {
|
||||
TeamLeaderboardItemViewModel,
|
||||
|
||||
@@ -28,7 +28,6 @@ import Card from '@/components/ui/Card';
|
||||
import Input from '@/components/ui/Input';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import CreateTeamForm from '@/components/teams/CreateTeamForm';
|
||||
import { getGetTeamsLeaderboardUseCase } from '@/lib/di-container';
|
||||
import { TeamsLeaderboardPresenter } from '@/lib/presenters/TeamsLeaderboardPresenter';
|
||||
import type { TeamLeaderboardItemViewModel, SkillLevel } from '@core/racing/application/presenters/ITeamsLeaderboardPresenter';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user