website refactor
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
|
||||
import { useCreateTeam } from '@/hooks/team';
|
||||
import { useEffectiveDriverId } from "@/lib/hooks/useEffectiveDriverId";
|
||||
import { useCreateTeam } from "@/lib/hooks/team";
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Image from 'next/image';
|
||||
import { UserPlus, Users, Trophy } from 'lucide-react';
|
||||
import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
import { getMediaUrl } from '@/lib/utilities/media';
|
||||
|
||||
const SKILL_LEVELS: {
|
||||
@@ -14,7 +13,7 @@ const SKILL_LEVELS: {
|
||||
{
|
||||
id: 'pro',
|
||||
label: 'Pro',
|
||||
icon: () => null, // We'll import Crown if needed
|
||||
icon: () => null,
|
||||
color: 'text-yellow-400',
|
||||
bgColor: 'bg-yellow-400/10',
|
||||
borderColor: 'border-yellow-400/30',
|
||||
@@ -46,7 +45,17 @@ const SKILL_LEVELS: {
|
||||
];
|
||||
|
||||
interface FeaturedRecruitingProps {
|
||||
teams: TeamSummaryViewModel[];
|
||||
teams: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
logoUrl?: string;
|
||||
category?: string;
|
||||
memberCount: number;
|
||||
totalWins: number;
|
||||
performanceLevel: string;
|
||||
isRecruiting: boolean;
|
||||
}>;
|
||||
onTeamClick: (id: string) => void;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import Button from '@/components/ui/Button';
|
||||
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
|
||||
import { useTeamMembership, useJoinTeam, useLeaveTeam } from '@/hooks/team';
|
||||
import { useEffectiveDriverId } from "@/lib/hooks/useEffectiveDriverId";
|
||||
import { useTeamMembership, useJoinTeam, useLeaveTeam } from "@/lib/hooks/team";
|
||||
import { useState } from 'react';
|
||||
|
||||
interface JoinTeamButtonProps {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { ChevronRight, Users, Trophy, UserPlus } from 'lucide-react';
|
||||
import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
import TeamCard from './TeamCard';
|
||||
|
||||
type SkillLevel = 'pro' | 'advanced' | 'intermediate' | 'beginner';
|
||||
@@ -18,7 +17,22 @@ interface SkillLevelConfig {
|
||||
|
||||
interface SkillLevelSectionProps {
|
||||
level: SkillLevelConfig;
|
||||
teams: TeamSummaryViewModel[];
|
||||
teams: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
logoUrl?: string;
|
||||
memberCount: number;
|
||||
rating?: number;
|
||||
totalWins: number;
|
||||
totalRaces: number;
|
||||
performanceLevel: string;
|
||||
isRecruiting: boolean;
|
||||
specialization?: string;
|
||||
region?: string;
|
||||
languages: string[];
|
||||
category?: string;
|
||||
}>;
|
||||
onTeamClick: (id: string) => void;
|
||||
defaultExpanded?: boolean;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,17 @@ import { useState } from 'react';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import { useTeamJoinRequests, useUpdateTeam, useApproveJoinRequest, useRejectJoinRequest } from '@/hooks/team';
|
||||
import { useTeamJoinRequests, useUpdateTeam, useApproveJoinRequest, useRejectJoinRequest } from "@/lib/hooks/team";
|
||||
import type { TeamJoinRequestViewModel } from '@/lib/view-models/TeamJoinRequestViewModel';
|
||||
import type { TeamDetailsViewModel } from '@/lib/view-models/TeamDetailsViewModel';
|
||||
|
||||
interface TeamAdminProps {
|
||||
team: Pick<TeamDetailsViewModel, 'id' | 'name' | 'tag' | 'description' | 'ownerId'>;
|
||||
team: {
|
||||
id: string;
|
||||
name: string;
|
||||
tag: string;
|
||||
description?: string;
|
||||
ownerId: string;
|
||||
};
|
||||
onUpdate: () => void;
|
||||
}
|
||||
|
||||
@@ -18,7 +23,7 @@ export default function TeamAdmin({ team, onUpdate }: TeamAdminProps) {
|
||||
const [editedTeam, setEditedTeam] = useState({
|
||||
name: team.name,
|
||||
tag: team.tag,
|
||||
description: team.description,
|
||||
description: team.description || '',
|
||||
});
|
||||
|
||||
// Use hooks for data fetching
|
||||
@@ -141,7 +146,7 @@ export default function TeamAdmin({ team, onUpdate }: TeamAdminProps) {
|
||||
setEditedTeam({
|
||||
name: team.name,
|
||||
tag: team.tag,
|
||||
description: team.description,
|
||||
description: team.description || '',
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useRouter } from 'next/navigation';
|
||||
import Image from 'next/image';
|
||||
import { Award, ChevronRight, Crown, Trophy, Users } from 'lucide-react';
|
||||
import Button from '@/components/ui/Button';
|
||||
import type { TeamSummaryViewModel } from '@/lib/view-models/TeamSummaryViewModel';
|
||||
import { getMediaUrl } from '@/lib/utilities/media';
|
||||
|
||||
const SKILL_LEVELS: {
|
||||
@@ -48,7 +47,17 @@ const SKILL_LEVELS: {
|
||||
];
|
||||
|
||||
interface TeamLeaderboardPreviewProps {
|
||||
topTeams: TeamSummaryViewModel[];
|
||||
topTeams: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
logoUrl?: string;
|
||||
category?: string;
|
||||
memberCount: number;
|
||||
totalWins: number;
|
||||
isRecruiting: boolean;
|
||||
rating?: number;
|
||||
performanceLevel: string;
|
||||
}>;
|
||||
onTeamClick: (id: string) => void;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import Card from '@/components/ui/Card';
|
||||
import DriverIdentity from '@/components/drivers/DriverIdentity';
|
||||
import { useTeamRoster } from '@/hooks/team';
|
||||
import { useTeamRoster } from "@/lib/hooks/team";
|
||||
import { useState } from 'react';
|
||||
import type { DriverViewModel } from '@/lib/view-models/DriverViewModel';
|
||||
|
||||
@@ -11,7 +11,14 @@ type TeamMemberRole = 'owner' | 'manager' | 'member';
|
||||
|
||||
interface TeamRosterProps {
|
||||
teamId: string;
|
||||
memberships: any[];
|
||||
memberships: Array<{
|
||||
driverId: string;
|
||||
driverName: string;
|
||||
role: 'owner' | 'manager' | 'member';
|
||||
joinedAt: string;
|
||||
isActive: boolean;
|
||||
avatarUrl: string;
|
||||
}>;
|
||||
isAdmin: boolean;
|
||||
onRemoveMember?: (driverId: string) => void;
|
||||
onChangeRole?: (driverId: string, newRole: TeamRole) => void;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import Card from '@/components/ui/Card';
|
||||
import { useTeamStandings } from '@/hooks/team';
|
||||
import { useTeamStandings } from "@/lib/hooks/team";
|
||||
|
||||
interface TeamStandingsProps {
|
||||
teamId: string;
|
||||
|
||||
Reference in New Issue
Block a user