Skip to content

Commit 01f05ea

Browse files
authored
🥯⚾️ ↝ [SSG-85]: New project format/chapters initialised | Merge pull request #167 from Signal-K/SSG-85
🐊🥯 ↝ [SSG-85]: New project format/chapters initialised
2 parents 619fa6d + ccffcd7 commit 01f05ea

39 files changed

+2059
-1622
lines changed

app/api/gameplay/inventory/route.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ const inventoryItems: InventoryItem[] = [
4343
},
4444
{
4545
id: 3105,
46-
name: "LIDAR",
46+
name: "Weather Balloon", // "LIDAR",
4747
description: "Collect and study weather events and entities",
48-
icon_url: "/assets/Items/Scoper.png",
48+
icon_url: "/assets/Items/WeatherBalloon.png", //Scoper.png",
4949
ItemCategory: "Structure",
50-
locationType: 'Surface',
50+
locationType: 'Atmosphere',
5151
},
5252
{
5353
id: 3106,

app/layout.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { UserAnomaliesProvider } from "@/context/UserAnomalies";
1212
import { bgImage, backgroundImages } from "@/constants/backgrounds";
1313
import { Analytics } from "@vercel/analytics/react"
1414
import { MissionProvider } from "@/context/MissionContext";
15-
import AppLayout from "@/components/Layout/Layout";
1615
import Header from "@/components/ui/Header";
1716

1817
interface RootLayoutProps {
@@ -77,7 +76,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
7776
{/* <MissionProvider> */}
7877
<UserAnomaliesProvider>
7978
<InventoryProvider>
80-
<AppLayout>
8179
<div className="sci-fi-overlay">
8280
<svg className="sci-fi-shape sci-fi-shape-1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
8381
<path d="M100,10 L190,50 L190,150 L100,190 L10,150 L10,50 Z" fill="none" stroke="#5FCBC3" strokeWidth="2" />
@@ -105,7 +103,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
105103
<div className="relative min-h-screen w-full flex flex-col">
106104
{children}
107105
</div>
108-
</AppLayout>
109106
<Analytics />
110107
</InventoryProvider>
111108
</UserAnomaliesProvider>

app/page.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout";
3636
import Onboarding from "./scenes/onboarding/page";
3737
import VerticalToolbar from "@/components/Layout/Toolbar";
3838
import StructureMissionGuide from "@/components/Layout/Guide";
39+
import SimpleeMissionGuide from "./tests/singleMissionGuide";
3940

4041
export default function Home() {
4142
const session = useSession();
@@ -74,7 +75,7 @@ export default function Home() {
7475
<div className="flex flex-row space-y-4"></div>
7576
<div className="py-3">
7677
<div className="py-1">
77-
<EnhancedWeatherEvents />
78+
{/* <EnhancedWeatherEvents /> */}
7879
</div>
7980
<center>
8081
<OrbitalStructuresOnPlanet />
@@ -94,7 +95,8 @@ export default function Home() {
9495
<AllAutomatonsOnActivePlanet />
9596
</center>
9697
</div>
97-
<div className="w-full py-2"><StructureMissionGuide />
98+
{/* <div className="w-full py-2"><StructureMissionGuide /> */}
99+
<div className="w-full py-2"><SimpleeMissionGuide />
98100
</div>
99101
</EarthViewLayout>
100102
// 60: <SaturnView />,

app/scenes/globe/Structures.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { StructuresConfigForSandbox } from "@/constants/Structures/SandboxProper
88
import { InventoryStructureItem, StructureItemDetail } from "@/types/Items";
99
import { useActivePlanet } from "@/context/ActivePlanet";
1010
import "../../../styles/Anims/StarterStructureAnimations.css";
11-
import { CreateCommunityStation } from "@/components/Structures/Build/MakeCommunityStation";
11+
// import { CreateCommunityStation } from "@/components/Structures/Build/MakeCommunityStation";
1212

1313
interface StructuresOnPlanetProps {
1414
onStructuresFetch: (

app/starnet/consensus/page.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import React, { useEffect, useState } from "react";
44
import StarnetLayout from "@/components/Layout/Starnet";
55
import { ExoplanetTransitHunter } from "@/components/Projects/Telescopes/ExoplanetC23";
66
import ProfileCardModal from "@/components/profile/form";
7-
import { CommunityScienceStation } from "@/components/Structures/Community/StationModal";
8-
import { CreateCommunityStation } from "@/components/Structures/Build/MakeCommunityStation";
9-
import StationsOnPlanet from "@/components/Structures/Community/ViewAllStations";
107

118
export default function TestPage() {
129
return (
1310
<StarnetLayout>
14-
<StationsOnPlanet />
11+
{/* <StationsOnPlanet /> */}
12+
<ProfileCardModal />
1513
</StarnetLayout>
1614
);
1715
};

app/tests/missionsUnlocked.tsx

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { useEffect, useState } from "react";
2+
import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react";
3+
4+
interface InventoryItem {
5+
id: number;
6+
configuration: {
7+
"missions unlocked"?: string[];
8+
[key: string]: any; // Allow other properties in configuration
9+
};
10+
}
11+
12+
const UserMissions = () => {
13+
const supabase = useSupabaseClient();
14+
const session = useSession();
15+
16+
const [missions, setMissions] = useState<string[]>([]);
17+
const [loading, setLoading] = useState(true);
18+
const [error, setError] = useState<string | null>(null);
19+
20+
useEffect(() => {
21+
if (!session?.user) return;
22+
23+
const fetchUserMissions = async () => {
24+
setLoading(true);
25+
setError(null);
26+
27+
try {
28+
// Query inventory for items owned by the user and containing missions unlocked
29+
const { data, error } = await supabase
30+
.from("inventory")
31+
.select("id, configuration")
32+
.eq("owner", session.user.id)
33+
.not("configuration->missions unlocked", "is", null); // Ensure "missions unlocked" exists
34+
35+
if (error) throw error;
36+
37+
// Extract and deduplicate all "missions unlocked"
38+
const unlockedMissions = data
39+
?.flatMap((item: InventoryItem) => item.configuration["missions unlocked"] || [])
40+
.filter((mission: string) => mission); // Filter out empty values
41+
42+
const uniqueMissions = Array.from(new Set(unlockedMissions));
43+
44+
setMissions(uniqueMissions);
45+
} catch (err) {
46+
console.error("Error fetching user missions:", err);
47+
setError("Failed to fetch missions. Please try again.");
48+
} finally {
49+
setLoading(false);
50+
}
51+
};
52+
53+
fetchUserMissions();
54+
}, [session?.user, supabase]);
55+
56+
if (!session?.user) return <p className="text-gray-400">Please log in to see your missions.</p>;
57+
58+
if (loading) return <p className="text-gray-400">Loading missions...</p>;
59+
60+
if (error) return <p className="text-red-500">{error}</p>;
61+
62+
if (missions.length === 0) {
63+
return <p className="text-gray-400">No missions unlocked yet.</p>;
64+
}
65+
66+
return (
67+
<div className="bg-gray-800 text-white rounded-lg p-6">
68+
<h1 className="text-xl font-bold mb-4">Missions Unlocked</h1>
69+
<ul className="list-disc pl-6">
70+
{missions.map((mission, index) => (
71+
<li key={index} className="mb-2">
72+
{mission}
73+
</li>
74+
))}
75+
</ul>
76+
</div>
77+
);
78+
};
79+
80+
export default UserMissions;

app/tests/page.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ import { MiningComponentComponent } from "@/components/(scenes)/mining/mining-co
66
import Greenhouse from "@/page.test";
77
import BigMap from "@/components/(scenes)/planetScene/bigMap";
88
import DiscoveriesPage from "@/content/Classifications/minimalDiscoveries";
9+
import UserMissions from "./missionsUnlocked";
10+
import SimpleeMissionGuide from "./singleMissionGuide";
911
// import { TopographicMap } from "@/components/topographic-map";
1012

1113
export default function TestPage() {
1214
return (
1315
// <StarnetLayout>
1416
<>
17+
<UserMissions />
18+
<SimpleeMissionGuide />
1519
{/* <Greenhouse /> */}
1620
{/* <BigMap /> */}
17-
<DiscoveriesPage />
21+
{/* <DiscoveriesPage /> */}
1822
{/* <MiningComponent /> */}
1923
</>
2024
// {/* </StarnetLayout> */}

0 commit comments

Comments
 (0)