Implement house points system: Add houseJoinPoints, houseLeavePoints, and houseCreatePoints to SitePreferences model and update related services. Enhance house management features to award and deduct points for house creation, membership removal, and leaving a house. Update environment configuration for PostgreSQL and adjust UI components to reflect new functionalities.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled

This commit is contained in:
Julien Froidefond
2025-12-18 08:48:31 +01:00
parent 12bc44e3ac
commit 1b82bd9ee6
23 changed files with 1026 additions and 113 deletions

View File

@@ -7,6 +7,7 @@ import { usePathname } from "next/navigation";
import PlayerStats from "@/components/profile/PlayerStats";
import { Button, ThemeToggle } from "@/components/ui";
import ChallengeBadge from "./ChallengeBadge";
import InvitationBadge from "./InvitationBadge";
interface UserData {
username: string;
@@ -23,12 +24,14 @@ interface NavigationProps {
initialUserData?: UserData | null;
initialIsAdmin?: boolean;
initialActiveChallengesCount?: number;
initialPendingInvitationsCount?: number;
}
export default function Navigation({
initialUserData,
initialIsAdmin,
initialActiveChallengesCount = 0,
initialPendingInvitationsCount = 0,
}: NavigationProps) {
const { data: session } = useSession();
const [isMenuOpen, setIsMenuOpen] = useState(false);
@@ -119,19 +122,7 @@ export default function Navigation({
</Link>
{isAuthenticated && (
<>
<Link
href="/houses"
className="transition text-xs font-normal uppercase tracking-widest"
style={{ color: "var(--foreground)" }}
onMouseEnter={(e) =>
(e.currentTarget.style.color = "var(--accent-color)")
}
onMouseLeave={(e) =>
(e.currentTarget.style.color = "var(--foreground)")
}
>
MAISONS
</Link>
<InvitationBadge initialCount={initialPendingInvitationsCount} />
<ChallengeBadge initialCount={initialActiveChallengesCount} />
</>
)}
@@ -295,20 +286,10 @@ export default function Navigation({
</Link>
{isAuthenticated && (
<>
<Link
href="/houses"
onClick={() => setIsMenuOpen(false)}
className="transition text-xs font-normal uppercase tracking-widest py-2"
style={{ color: "var(--foreground)" }}
onMouseEnter={(e) =>
(e.currentTarget.style.color = "var(--accent-color)")
}
onMouseLeave={(e) =>
(e.currentTarget.style.color = "var(--foreground)")
}
>
MAISONS
</Link>
<InvitationBadge
initialCount={initialPendingInvitationsCount}
onNavigate={() => setIsMenuOpen(false)}
/>
<ChallengeBadge
initialCount={initialActiveChallengesCount}
onNavigate={() => setIsMenuOpen(false)}