Skip to content

Commit 702f3ef

Browse files
committed
📅📼 ↝ [SSG-76 SSG-70 SSG-77]: First community expedition - just missing missions/achievements
1 parent d8e540f commit 702f3ef

File tree

5 files changed

+209
-118
lines changed

5 files changed

+209
-118
lines changed

‎app/scenes/mars/page.tsx

+35-29
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import React, { useEffect, useState } from "react";
44
import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react";
55
import { useActivePlanet } from "@/context/ActivePlanet";
66

7-
import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout";
7+
import { EarthActionSceneLayout, EarthViewLayout } from "@/components/(scenes)/planetScene/layout";
88
import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet";
99
import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/Structures/Structures";
1010
import { InventoryStructureItem } from "@/types/Items";
1111
import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system";
1212
import AllAutomatonsOnActivePlanet from "@/components/Structures/Auto/AllAutomatons";
13+
import { MiningComponentComponent } from "@/components/mining-component";
14+
import StructureMissionGuide from "@/components/Layout/Guide";
1315

1416
const MarsView: React.FC = () => {
1517
const supabase = useSupabaseClient();
@@ -53,33 +55,37 @@ export default MarsView;
5355

5456
const MarsStructures: React.FC = () => {
5557
return (
56-
<EarthViewLayout>
57-
<div className="w-full">
58-
<div className="flex flex-row space-y-4"></div>
59-
<div className="py-3">
60-
<div className="py-1">
61-
<PlanetarySystem />
62-
</div>
63-
<center>
64-
<OrbitalStructuresOnPlanet />
65-
</center>
66-
</div>
67-
</div>
68-
<div className="w-full">
69-
<div className="py-2">
70-
<center>
71-
<AtmosphereStructuresOnPlanet />
72-
</center>
73-
</div>
74-
</div>
75-
<div className="w-full">
76-
<center>
77-
<StructuresOnPlanet />
78-
</center>
79-
</div>
80-
<div className="relative flex-1">
81-
<AllAutomatonsOnActivePlanet />
82-
</div>
83-
</EarthViewLayout>
58+
<EarthActionSceneLayout>
59+
<MiningComponentComponent />
60+
<StructureMissionGuide />
61+
</EarthActionSceneLayout>
62+
// <EarthViewLayout>
63+
// <div className="w-full">
64+
// <div className="flex flex-row space-y-4"></div>
65+
// <div className="py-3">
66+
// <div className="py-1">
67+
// <PlanetarySystem />
68+
// </div>
69+
// <center>
70+
// <OrbitalStructuresOnPlanet />
71+
// </center>
72+
// </div>
73+
// </div>
74+
// <div className="w-full">
75+
// <div className="py-2">
76+
// <center>
77+
// <AtmosphereStructuresOnPlanet />
78+
// </center>
79+
// </div>
80+
// </div>
81+
// <div className="w-full">
82+
// <center>
83+
// <StructuresOnPlanet />
84+
// </center>
85+
// </div>
86+
// <div className="relative flex-1">
87+
// <AllAutomatonsOnActivePlanet />
88+
// </div>
89+
// </EarthViewLayout>
8490
);
8591
};

‎components/(scenes)/travel/BoardingPassCard.tsx

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import React from 'react';
2-
import { BoardingPass } from "@/types/Travel";
32
import Image from 'next/image';
43

4+
// Define the BoardingPass interface
5+
interface BoardingPass {
6+
userName: string;
7+
frequentFlyerNumber: string;
8+
frequentFlyerStatus: string;
9+
departurePlanet: string;
10+
departureTemperature: number;
11+
destinationPlanet: string;
12+
destinationTemperature: number;
13+
rocketType: string;
14+
departureTime: string; // ISO 8601 string
15+
}
16+
517
interface BoardingPassCardProps {
618
boardingPass: BoardingPass;
719
}
@@ -19,10 +31,19 @@ const BoardingPassCard: React.FC<BoardingPassCardProps> = ({ boardingPass }) =>
1931
</div>
2032
<div>
2133
<h3 className="text-xl font-semibold mb-2 text-[#B9E678]">Flight Information</h3>
22-
<p><span className="font-semibold">From:</span> {boardingPass.departurePlanet} ({boardingPass.departureTemperature}°C)</p>
23-
<p><span className="font-semibold">To:</span> {boardingPass.destinationPlanet} ({boardingPass.destinationTemperature}°C)</p>
34+
<p>
35+
<span className="font-semibold">From:</span> {boardingPass.departurePlanet}
36+
({boardingPass.departureTemperature}°C)
37+
</p>
38+
<p>
39+
<span className="font-semibold">To:</span> {boardingPass.destinationPlanet}
40+
({boardingPass.destinationTemperature}°C)
41+
</p>
2442
<p><span className="font-semibold">Rocket:</span> {boardingPass.rocketType}</p>
25-
<p><span className="font-semibold">Departure:</span> {new Date(boardingPass.departureTime).toLocaleString()}</p>
43+
<p>
44+
<span className="font-semibold">Departure:</span>
45+
{new Date(boardingPass.departureTime).toLocaleString()}
46+
</p>
2647
</div>
2748
</div>
2849
<div className="mt-6 flex justify-center">

‎components/(scenes)/travel/DestinationList.tsx

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
import React from 'react';
2-
import { Destination } from '@/types/Travel';
2+
3+
// Define the Destination interface
4+
interface Destination {
5+
id: string; // Unique identifier for each destination
6+
name: string; // Name of the destination
7+
type: 'solar' | 'exoplanet'; // Type of destination
8+
}
39

410
interface DestinationListProps {
5-
destinations: Destination[];
6-
onSelect: (destination: Destination) => void;
7-
selectedDestination: Destination | null;
11+
destinations: Destination[]; // List of destinations
12+
onSelect: (destination: Destination) => void; // Callback when a destination is selected
13+
selectedDestination: Destination | null; // Currently selected destination
814
}
915

10-
const DestinationList: React.FC<DestinationListProps> = ({ destinations, onSelect, selectedDestination }) => {
11-
const solarDestinations = destinations.filter(d => d.type === 'solar');
12-
const exoplanets = destinations.filter(d => d.type === 'exoplanet');
16+
const DestinationList: React.FC<DestinationListProps> = ({
17+
destinations,
18+
onSelect,
19+
selectedDestination,
20+
}) => {
21+
const solarDestinations = destinations.filter((d) => d.type === 'solar');
22+
const exoplanets = destinations.filter((d) => d.type === 'exoplanet');
1323

1424
return (
1525
<div className="mb-8">
@@ -18,11 +28,13 @@ const DestinationList: React.FC<DestinationListProps> = ({ destinations, onSelec
1828
<div>
1929
<h3 className="text-xl font-semibold mb-2 text-[#5FCBC3]">Solar System</h3>
2030
<ul className="space-y-2">
21-
{solarDestinations.map(destination => (
31+
{solarDestinations.map((destination) => (
2232
<li
2333
key={destination.id}
2434
className={`cursor-pointer p-2 rounded-md transition-colors ${
25-
selectedDestination?.id === destination.id ? 'bg-[#2C4F64]' : 'hover:bg-[#2C4F64]'
35+
selectedDestination?.id === destination.id
36+
? 'bg-[#2C4F64]'
37+
: 'hover:bg-[#2C4F64]'
2638
}`}
2739
onClick={() => onSelect(destination)}
2840
>
@@ -34,11 +46,13 @@ const DestinationList: React.FC<DestinationListProps> = ({ destinations, onSelec
3446
<div>
3547
<h3 className="text-xl font-semibold mb-2 text-[#5FCBC3]">Exoplanets</h3>
3648
<ul className="space-y-2">
37-
{exoplanets.map(destination => (
49+
{exoplanets.map((destination) => (
3850
<li
3951
key={destination.id}
4052
className={`cursor-pointer p-2 rounded-md transition-colors ${
41-
selectedDestination?.id === destination.id ? 'bg-[#2C4F64]' : 'hover:bg-[#2C4F64]'
53+
selectedDestination?.id === destination.id
54+
? 'bg-[#2C4F64]'
55+
: 'hover:bg-[#2C4F64]'
4256
}`}
4357
onClick={() => onSelect(destination)}
4458
>

‎components/(scenes)/travel/SolarSystem.tsx

+42-34
Original file line numberDiff line numberDiff line change
@@ -60,54 +60,54 @@ export default function SwitchPlanet() {
6060
exoplanets: Exoplanet[];
6161
}>({
6262
solarSystem: [
63+
// {
64+
// id: 10,
65+
// name: "Mercury",
66+
// color: "bg-[#2C3A4A]",
67+
// stats: { gravity: "3.7 m/s²", temp: "430°C" },
68+
// anomaly: 10,
69+
// planetType: 'Arid',
70+
// initialisationMissionId: 100001,
71+
// travelTime: '30 seconds',
72+
// description: '',
73+
// image: '/assets/Planets/Mercury.png',
74+
// },
75+
// {
76+
// id: 20,
77+
// name: "Venus",
78+
// color: "bg-yellow-200",
79+
// stats: { gravity: "8.87 m/s²", temp: "462°C" },
80+
// anomaly: 20,
81+
// planetType: 'Arid',
82+
// initialisationMissionId: 200001,
83+
// travelTime: '30 seconds',
84+
// description: '',
85+
// image: '/assets/Planets/Venus.png',
86+
// },
6387
{
64-
id: 10,
65-
name: "Mercury",
66-
color: "bg-[#2C3A4A]",
67-
stats: { gravity: "3.7 m/s²", temp: "430°C" },
68-
anomaly: 10,
69-
planetType: 'Arid',
70-
initialisationMissionId: 100001,
71-
travelTime: '30 seconds',
72-
description: '',
73-
image: '/assets/Planets/Mercury.png',
74-
},
75-
{
76-
id: 20,
77-
name: "Venus",
78-
color: "bg-yellow-200",
79-
stats: { gravity: "8.87 m/s²", temp: "462°C" },
80-
anomaly: 20,
88+
id: 40,
89+
name: "Mars",
90+
color: "bg-red-500",
91+
stats: { gravity: "3.71 m/s²", temp: "-63°C" },
92+
anomaly: 40,
8193
planetType: 'Arid',
82-
initialisationMissionId: 200001,
94+
initialisationMissionId: 400001,
8395
travelTime: '30 seconds',
8496
description: '',
85-
image: '/assets/Planets/Venus.png',
97+
image: '/assets/Planets/Mars.png',
8698
},
8799
{
88-
id: 69,
100+
id: 30, // 69
89101
name: "Earth",
90102
color: "bg-blue-500",
91103
stats: { gravity: "9.8 m/s²", temp: "15°C" },
92-
anomaly: 69,
104+
anomaly: 30,
93105
planetType: 'Lush',
94106
initialisationMissionId: 300001,
95107
travelTime: '30 seconds',
96108
description: '',
97109
image: '/assets/Planets/Earth.png',
98110
},
99-
{
100-
id: 40,
101-
name: "Mars",
102-
color: "bg-red-500",
103-
stats: { gravity: "3.71 m/s²", temp: "-63°C" },
104-
anomaly: 40,
105-
planetType: 'Arid',
106-
initialisationMissionId: 400001,
107-
travelTime: '30 seconds',
108-
description: '',
109-
image: '/assets/Planets/Mars.png',
110-
},
111111
],
112112
exoplanets: [],
113113
});
@@ -513,12 +513,20 @@ export default function SwitchPlanet() {
513513
<div className="flex flex-col justify-between items-center mb-4">
514514
<h3 className="text-xl font-semibold">{currentPlanet.name}</h3>
515515
<p className="text-sm">{currentPlanet.description}</p>
516-
<button
516+
{/* <button
517517
onClick={handleSelectMission}
518518
className="bg-[#5FCBC3] hover:bg-[#4BB3A5] text-white py-2 px-4 rounded-lg mt-2"
519519
>
520520
Select Mission
521+
</button> */}
522+
<div className="m-1">
523+
<button
524+
onClick={handleVisitPlanet}
525+
className="bg-[#5FCBC3] hover:bg-[#4BB3A5] text-white py-2 px-4 rounded-lg mt-2"
526+
>
527+
Visit
521528
</button>
529+
</div>
522530
</div>
523531

524532
<div className="flex justify-between items-center">

0 commit comments

Comments
 (0)