Skip to content

Commit

Permalink
🐟🩳 ↝ [SSM-30]: Forking UnownedStructures in EditMode.tsx for Communit…
Browse files Browse the repository at this point in the history
…y Station placing
  • Loading branch information
Gizmotronn committed Oct 22, 2024
1 parent af58b39 commit 5d589a4
Show file tree
Hide file tree
Showing 17 changed files with 395 additions and 326 deletions.
Binary file modified .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions app/api/gameplay/inventory/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ const inventoryItems: InventoryItem[] = [
ItemCategory: "Structure",
locationType: 'Surface',
},

// Community stations
{
id: 31011,
name: "Greenhouse",
description: "Collect and study biological anomalies across multiple locations",
icon_url: "/assets/Items/Greenhouse.png",
ItemCategory: 'CommunityStation',
locationType: 'Surface',
},

// Tests
{
Expand Down
40 changes: 39 additions & 1 deletion app/tests/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,49 @@ import StarnetLayout from "@/components/Layout/Starnet";
import { ExoplanetTransitHunter } from "@/components/Projects/Telescopes/ExoplanetC23";
import MissionPathway from "@/components/Missions/Pathway";
import ProfileCardModal from "@/components/profile/form";
import { CommunityScienceStation } from "@/components/Structures/Community/Modal";
import { CreateCommunityStation } from "@/components/Structures/Build/MakeCommunityStation";

export default function TestPage() {
return (
<StarnetLayout>
<MissionPathway />
<CommunityScienceStation stationName = {"Greenhouse"}
projects = {[
{
id: "1",
name: "Wildwatch Burrowing Owls",
identifier: "zoodex-burrOwls",
isUnlocked: false,
level: 0,
},
{
id: "2",
name: "Iguanas from Above",
identifier: "zoodex-iguanasFromAbove",
isUnlocked: false,
level: 0,
},
]}
missions = {[
{
id: "1",
name: "Spot an owl in the wild",
type: "Upload",
completionRate: 4,
project: "1",
level: 2,
isUnlocked: false,
},
]}
anomalies = {[
{
id: "1",
name: "Hardened owl",
description:
"A hardened owl that is ready to be transported to another lush location.",
},
]} />
<CreateCommunityStation />
</StarnetLayout>
);
};
195 changes: 0 additions & 195 deletions components/(scenes)/planetScene/SelectPlanet.tsx

This file was deleted.

Empty file.
38 changes: 0 additions & 38 deletions components/Layout/Sidebar.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -166,50 +166,4 @@ export function DiscoveryCardSingle({ classificationId }: DiscoveryCardSinglePro

interface ClassificationConfiguration {
[key: string]: string | number | boolean;
}

const ClassificationOptions: React.FC<{ classificationConfiguration: ClassificationConfiguration }> = ({ classificationConfiguration }) => {
const getRelevantOptions = (config: ClassificationConfiguration) => {
const options = [
cloudClassificationOptions,
planetClassificationOptions,
planktonPortalClassificationOptions,
diskDetectorClassificationOptions,
penguinWatchClassificationOptions,
roverImgClassificationOptions,
initialCloudClassificationOptions,
lidarEarthCloudsReadClassificationOptions,
lidarEarthCloudsUploadClassificationOptions,
zoodexBurrowingOwlClassificationOptions,
zoodexIguanasFromAboveClassificationOptions,
sunspotsConfigurationTemporary,
];

const allOptions = options.flat();

const configValues = Object.values(config).filter(value => typeof value === 'string') as string[];

return allOptions.filter(option =>
configValues.some(configValue => option.text.includes(configValue))
);
};
const relevantOptions = getRelevantOptions(classificationConfiguration);

return (
<div>
<h2>Classification Configuration:</h2>
<pre>{JSON.stringify(classificationConfiguration, null, 2)}</pre>

<h2>Classification Options:</h2>
<ul>
{relevantOptions.length > 0 ? (
relevantOptions.map(option => (
<li key={option.id}>{option.text}</li>
))
) : (
<li>No relevant options found</li>
)}
</ul>
</div>
);
};
}
11 changes: 8 additions & 3 deletions components/Structures/Build/EditMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface InventoryItem {
export function UnownedSurfaceStructures() {
const supabase = useSupabaseClient();
const session = useSession();

const { activePlanet } = useActivePlanet();

const [unownedStructures, setUnownedStructures] = useState<InventoryItem[]>([]);
Expand Down Expand Up @@ -127,9 +128,9 @@ export function UnownedSurfaceStructures() {
},
]);

if (error) {
if (error) {
throw error;
}
};

console.log(`${structure.name} has been added to the inventory.`);
setOpen(false);
Expand All @@ -140,7 +141,11 @@ export function UnownedSurfaceStructures() {
};

if (loading) {
return <p>Loading...</p>;
return (
<p>
Loading...
</p>
);
};

if (unownedStructures.length === 0) {
Expand Down
Loading

0 comments on commit 5d589a4

Please sign in to comment.