diff --git a/.github/cron/workflows/codeql-analysis.yml b/.github/cron/workflows/codeql-analysis.sh similarity index 100% rename from .github/cron/workflows/codeql-analysis.yml rename to .github/cron/workflows/codeql-analysis.sh diff --git a/.github/cron/workflows/deta.yml b/.github/cron/workflows/deta.sh similarity index 100% rename from .github/cron/workflows/deta.yml rename to .github/cron/workflows/deta.sh diff --git a/.github/cron/workflows/nextjs.yml b/.github/cron/workflows/nextjs.sh similarity index 100% rename from .github/cron/workflows/nextjs.yml rename to .github/cron/workflows/nextjs.sh diff --git a/.github/deployments/vercel.sh b/.github/deployments/vercel.sh new file mode 100644 index 00000000..c2ea2870 --- /dev/null +++ b/.github/deployments/vercel.sh @@ -0,0 +1,21 @@ +name: Vercel Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml new file mode 100644 index 00000000..c2ea2870 --- /dev/null +++ b/.github/workflows/vercel.yml @@ -0,0 +1,21 @@ +name: Vercel Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} \ No newline at end of file diff --git a/app/api/citizen/modules/route.ts b/app/api/citizen/modules/route.ts deleted file mode 100644 index fad1033b..00000000 --- a/app/api/citizen/modules/route.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; -import { Mission } from "@/app/components/(structures)/StructuresForMission"; - -export interface CitizenScienceModule { - id: number; - name: string; - level?: number; // aka chapter - starterMission?: number; - structure: number; - description?: string; -}; - -const modules: CitizenScienceModule[] = [ - { - id: 1, - name: "Planet Candidate Identification", - level: 1, - starterMission: 1372001, - structure: 3103, - description: 'Use your telescope [on your planet] to search for new planet candidates to travel to', // "like in the onboarding?" - }, - { - id: 2, - name: "Animal Observations", - level: 1, - starterMission: 1370202, - structure: 3104, - description: "Central command has given you some animals from Earth to study their behaviour on {planetName}. Use the cameras in your base to keep track", - }, -// { -// id: 21, -// name: "Animal uploader", -// level: 1, -// starterMission: 1370202, -// structure: 3104, -// }, - { - id: 4, - name: "Cloud identification", - level: 1, - starterMission: 137121301, - structure: 3105, - description: 'The LIDAR module can be used to track weather events and understand more about cloud features', - }, - { - id: 5, - name: "Map the terrain (of your planet)", - level: 1, - starterMission: 13714101, - structure: 3102, - description: "Your rovers have been busy taking photos of the landscape, study their photos to find mineral deposits and map out your planet's terrain", - }, - - // Non citizen-science modules used for "active structure" - { - id: 106, - name: 'Go mining', - level: 1, - starterMission: 1370205, - structure: 3102, - }, - { - id: 107, - name: 'Repair Research Station', - level: 1, - starterMission: 1370206, - structure: 3106, - }, - { - id: 108, - name: 'Use the Research Station to unlock a new module', - level: 1, - starterMission: 1370207, - structure: 3106, - }, -]; - -export async function GET(req: NextRequest) { - return NextResponse.json(modules); -}; \ No newline at end of file diff --git a/app/api/citizen/zoodex/add/route.ts b/app/api/citizen/zoodex/add/route.ts deleted file mode 100644 index c283f969..00000000 --- a/app/api/citizen/zoodex/add/route.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NextRequest, NextResponse } from 'next/server'; - -interface Recipe { - [key: string]: number; -}; - -/* - -import { NextResponse } from "next/server"; -import { DataAPIClient } from "@datastax/astra-db-ts"; - -const client = new DataAPIClient( process.env.ASTRA_TOKEN ) -const db = client.db('https://4504da32-0d63-499c-bdd3-5f74c8aa2512-us-east-2.apps.astra.datastax.com'); - -export async function GET(req: any) { - const colls = await db.listCollections(); - console.log('Connected to astradb: ', colls); - - return NextResponse.json({ - success: true, - }); -};*/ \ No newline at end of file diff --git a/app/api/gameplay/inventory/automatons/modules/route.ts b/app/api/gameplay/inventory/automatons/modules/route.ts deleted file mode 100644 index 7b62e72f..00000000 --- a/app/api/gameplay/inventory/automatons/modules/route.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; - -interface AutomatonUpgradeModule { - id: number; - name: string; - topic: string; - level: number; -}; - -// or do we create a big route for all upgrades/tech trees? \ No newline at end of file diff --git a/app/api/gameplay/inventory/streamlined.ts b/app/api/gameplay/inventory/streamlined.ts deleted file mode 100644 index f02dae1c..00000000 --- a/app/api/gameplay/inventory/streamlined.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { NextRequest, NextResponse } from 'next/server'; - -interface Recipe { - [key: string]: number; -} - -interface InventoryItem { - id: number; - name: string; - description: string; - cost?: number; - icon_url: string; - ItemCategory: string; - parentItem?: number | null; - itemLevel?: number; - locationType?: string; - recipe?: Recipe; - gif?: string; -}; - -// Mock inventory items data -const inventoryItems: InventoryItem[] = [ - { id: 11, name: 'Coal', description: 'You can burn this to create power', cost: 1, icon_url: '/assets/Items/Coal.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1 }, - { id: 13, name: 'Silicon', description: '', cost: 1, icon_url: '/assets/Items/Silicon.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 15, name: 'Iron', description: 'Test', cost: 1, icon_url: '/assets/Items/Iron.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 16, name: 'Nickel', description: '/assets/Items/Nickel.png', cost: 1, icon_url: '/assets/Items/Nickel.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 17, name: 'Alloy', description: '/assets/Items/Alloy.png', cost: 1, icon_url: '/assets/Items/Alloy.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 18, name: 'Fuel', description: '', cost: 1, icon_url: '', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 19, name: 'Copper', description: '', cost: 1, icon_url: '/assets/Items/Copper.png', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 20, name: 'Chromium', description: '/assets/Items/Chromite.png', cost: 1, icon_url: '', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 21, name: 'Water-Ice', description: '/assets/Items/Ice.png', cost: 1, icon_url: '', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 23, name: 'Rover 1', description: '', cost: 1, icon_url: 'https://static-00.iconduck.com/assets.00/mars-rover-illustration-2048x2048-czfy73zy.png', ItemCategory: 'Automaton', parentItem: 22, itemLevel: 1, gif: "/assets/Items/Roover.gif", }, // https://cdn.dribbble.com/users/107759/screenshots/4248752/rover.gif - { id: 25, name: 'Empty', description: '', cost: 1, icon_url: '', ItemCategory: 'Minerals', parentItem: null, itemLevel: 1}, - { id: 32, name: 'Camera Receiver', description: 'Keep track of all the photos your anomalies have taken', cost: 1, icon_url: 'https://cdn-icons-png.flaticon.com/512/5169/5169909.png', ItemCategory: 'Structure', parentItem: null, itemLevel: 1, recipe: { '11': 1 }, locationType: 'Orbit' }, - - { - id: 3102, name: 'Automaton station', description: 'View, control and upgrade all your automatons and rovers here', cost: 1, icon_url: '/assets/Items/AutoController.png', ItemCategory: 'Structure', parentItem: 30, itemLevel: 1, locationType: 'Surface' - }, - { - id: 3103, name: 'Telescope', description: 'Space-based observations & classifications', icon_url: '/assets/Items/Telescope.png', ItemCategory: 'Structure', locationType: 'Surface' - }, - { - id: 3104, name: "Zoodex", description: "Populate your planet with some animals to gain an understanding of animal behaviour on your planet and aide local research back home", cost: 1, icon_url: "/assets/Items/Pokedex.png", ItemCategory: "Structure", parentItem: null, itemLevel: 1, locationType: "Surface" - }, - { - id: 3105, - name: "LIDAR", - // description: 'This tool is used to scan the surface of your planet and create a 3D model of the terrain', -- This is cool, but not what we're using lidar for yet (thanks copilot) - description: "Collect and study weather events and entities", - icon_url: "/assets/Items/Scoper.png", - ItemCategory: "Structure", - locationType: 'Surface', - }, - { - id: 3106, - name: "Research Station", - description: "Unlock new technology and research", - icon_url: "/assets/Items/Research.png", - ItemCategory: "Structure", - locationType: 'Surface', - }, - - // Tests - { - id: 10600, - name: "Helicopter", - // description: - description: "Fly, I'm not sure yet", - icon_url: "/assets/Items/Helicopter.png", - ItemCategory: "Structure", - locationType: 'Atmosphere', - }, - { - id: 10601, - name: "Camera receiver", - // description: - description: "Connect to rovers", - icon_url: "/assets/Items/CameraReceiver.png", - ItemCategory: "Structure", - locationType: 'Orbital', - }, -]; - -export async function GET(req: NextRequest) { - return NextResponse.json(inventoryItems); -}; \ No newline at end of file diff --git a/app/api/gameplay/missions/archive/route.ts b/app/api/gameplay/missions/archive/route.ts index 9081f261..947923ef 100644 --- a/app/api/gameplay/missions/archive/route.ts +++ b/app/api/gameplay/missions/archive/route.ts @@ -1,6 +1,5 @@ import { NextRequest, NextResponse } from "next/server"; -import { MineralDepositsNoAction } from "@/app/components/(structures)/Mining/AvailableDeposits"; -import { Mission } from "@/app/components/(structures)/StructuresForMission"; +import { MineralDepositsNoAction } from "@/components/(structures)/Mining/AvailableDeposits"; interface UserMissionInstance { id: number; @@ -9,6 +8,18 @@ interface UserMissionInstance { mission: number; }; +export interface Mission { + id: number; + name: string; + sequence?: number; + description?: string; + rewards?: number[]; + classificationModule?: string; + structure?: number; + chapter?: number; + component?: React.ComponentType; +}; + const missions: Mission[] = [ { id: 1, name: "Pick planet", description: "Select your starting planet", rewards: [29] }, // Possibly the user should get something, but really they're already getting a planet, so... | After further consideration for the order of missions, I think that giving the spaceship and then the rover will be a good option { id: 2, name: "Complete profile", description: "Fill in your profile data", rewards: [22] }, // Give them a rover/automaton without a location, we'll create a button that keeps track of the item that was created and show the user an option to "place" un-locationised items/structures diff --git a/app/api/gameplay/missions/chapterOne/route.ts b/app/api/gameplay/missions/chapterOne/route.ts index 52410fca..91363396 100644 --- a/app/api/gameplay/missions/chapterOne/route.ts +++ b/app/api/gameplay/missions/chapterOne/route.ts @@ -1,5 +1,16 @@ import { NextRequest, NextResponse } from "next/server"; -import { Mission } from "@/app/components/(structures)/StructuresForMission"; + +export interface Mission { + id: number; + name: string; + sequence?: number; + description?: string; + rewards?: number[]; + classificationModule?: string; + structure?: number; + chapter?: number; + component?: React.ComponentType; +}; const chapterOneMissions: Mission[] = [ { diff --git a/app/api/gameplay/missions/classifications/tutorials/route.ts b/app/api/gameplay/missions/classifications/tutorials/route.ts index 8de213bf..eee69598 100644 --- a/app/api/gameplay/missions/classifications/tutorials/route.ts +++ b/app/api/gameplay/missions/classifications/tutorials/route.ts @@ -1,5 +1,16 @@ import { NextRequest, NextResponse } from "next/server"; -import { Mission } from "@/app/components/(structures)/StructuresForMission"; + +export interface Mission { + id: number; + name: string; + sequence?: number; + description?: string; + rewards?: number[]; + classificationModule?: string; + structure?: number; + chapter?: number; + component?: React.ComponentType; +}; const classificationTutorialMissions: Mission[] = [ { diff --git a/app/api/gameplay/missions/route.ts b/app/api/gameplay/missions/route.ts index dcf55e71..c5ef6e2b 100644 --- a/app/api/gameplay/missions/route.ts +++ b/app/api/gameplay/missions/route.ts @@ -1,13 +1,16 @@ import { NextRequest, NextResponse } from "next/server"; -import { MineralDepositsNoAction } from "@/app/components/(structures)/Mining/AvailableDeposits"; -import { Mission } from "@/app/components/(structures)/StructuresForMission"; +import { MineralDepositsNoAction } from "@/components/(structures)/Mining/AvailableDeposits"; -interface UserMissionInstance { +export interface Mission { id: number; - user: string; - time_of_completion: string; - mission: number; + name: string; + sequence?: number; + description?: string; + rewards?: number[]; + classificationModule?: string; structure?: number; + chapter?: number; + component?: React.ComponentType; }; const missions: Mission[] = [ diff --git a/app/auth/UserProfileFields.tsx b/app/auth/UserProfileFields.tsx index 97e6a643..98429f5d 100644 --- a/app/auth/UserProfileFields.tsx +++ b/app/auth/UserProfileFields.tsx @@ -3,15 +3,17 @@ import { useProfileContext } from "@/context/UserProfile"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; -import { Mission } from "../components/(structures)/StructuresForMission"; -interface UserProfile { - username: string; - full_name: string; - location: number; - id: string; - avatar_url: string; - faction: string; +export interface Mission { + id: number; + name: string; + sequence?: number; + description?: string; + rewards?: number[]; + classificationModule?: string; + structure?: number; + chapter?: number; + component?: React.ComponentType; }; interface User { diff --git a/app/components/(dialogue)/createInventoryEntry.tsx b/app/components/(dialogue)/createInventoryEntry.tsx deleted file mode 100644 index ad226560..00000000 --- a/app/components/(dialogue)/createInventoryEntry.tsx +++ /dev/null @@ -1,70 +0,0 @@ -"use client"; - -import React, { useState } from "react"; -import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; -import { useActivePlanet } from "@/context/ActivePlanet"; - -interface InventoryEntryProps { - item: number; -}; - -const CreateInventoryEntry: React.FC = ({ item }) => { - const supabase = useSupabaseClient(); - const session = useSession(); - - const { activePlanet } = useActivePlanet(); - - const [isLoading, setIsLoading] = useState(false); - const [error, setError] = useState(null); - const [success, setSuccess] = useState(false); - - const handleCreateEntry = async () => { - if (!session?.user || !activePlanet?.id) { - setError("User or planet information is missing."); - return; - }; - - setIsLoading(true); - setError(null); - setSuccess(false); - - try { - const { data, error: insertError } = await supabase - .from("inventory") - .insert({ - owner: session.user.id, - anomaly: activePlanet.id, - item, - }); - - if (insertError) { - throw insertError; - }; - - setSuccess(true); - } catch (insertError: any) { - setError(insertError.message); - } finally { - setIsLoading(false); - }; - }; - - return ( -
-

Create Inventory Entry

- - {error &&
{error}
} - {success &&
Inventory entry created successfully!
} - - -
- ); -}; - -export default CreateInventoryEntry; \ No newline at end of file diff --git a/app/components/(dialogue)/guideBot.tsx b/app/components/(dialogue)/guideBot.tsx deleted file mode 100644 index bb960429..00000000 --- a/app/components/(dialogue)/guideBot.tsx +++ /dev/null @@ -1,266 +0,0 @@ -'use client'; - -import { useState, useEffect, useCallback } from "react"; -import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; -import { ChevronLeft, ChevronRight, X } from "lucide-react"; -import { motion } from 'framer-motion'; -import { useActivePlanet } from "@/context/ActivePlanet"; -import StarterMissionsStats from "../(scenes)/(missions)/CompletedMissions"; - -interface TutorialMessageProps { - isExpanded: boolean; - toggleExpand: () => void; -}; - - -interface Useractivemission { - id: number; - name: string; - structure?: number; - createStructure?: number; - starterMission?: number; -}; - - -export const CaptnCosmosGuideModal: React.FC = ({ isExpanded, toggleExpand }) => { - const supabase = useSupabaseClient(); - const session = useSession(); - const { activePlanet } = useActivePlanet(); - - const [missions, setMissions] = useState([]); - const [completedMissions, setCompletedMissions] = useState([]); - const [activemission, setactivemission] = useState(null); - const [error, setError] = useState(null); - - /* --- Start of changes --- - Added useEffect to fetch missions and active mission - */ - useEffect(() => { - const fetchMissionsAndactivemission = async () => { - if (!session?.user?.id) return; - - try { - const [missionsResponse, activemissionResponse] = await Promise.all([ - fetch('/api/gameplay/missions/active'), - supabase - .from('profiles') - .select('activemission') - .eq('id', session.user.id) - .single() - ]); - - const missionsData: Useractivemission[] = await missionsResponse.json(); - setMissions(missionsData); - - if (activemissionResponse.error) throw activemissionResponse.error; - setactivemission(activemissionResponse.data.activemission); - } catch (error) { - console.error("Error fetching missions or active mission:", error); - } - }; - - fetchMissionsAndactivemission(); - }, [session, supabase]); - /* --- End of changes --- */ - - useEffect(() => { - const fetchCompletedMissions = async () => { - if (!session?.user?.id) return; - - try { - const { data, error } = await supabase - .from('missions') - .select('mission') - .eq('user', session.user.id); - - if (error) throw error; - - const completedMissionIds = data.map((entry: { mission: number }) => entry.mission); - setCompletedMissions(completedMissionIds); - } catch (error) { - console.error("Error fetching completed missions:", error); - } - }; - - fetchCompletedMissions(); - }, [session, supabase]); - - useEffect(() => { - const fetchUseractivemission = async () => { - if (!session?.user?.id) return; - - try { - const { data, error } = await supabase - .from('profiles') - .select('activemission') - .eq('id', session.user.id) - .single(); - - if (error) throw error; - - setactivemission(data.activemission); - } catch (error) { - console.error("Error fetching active mission:", error); - } - }; - - fetchUseractivemission(); - }, [session, supabase]); - - const getNextMission = () => { - /* --- Start of changes --- - Sorted missions and updated logic to use 'starterMission' if available, otherwise 'id' - */ - const sortedMissions = [...missions].sort((a, b) => - (a.starterMission || a.id) - (b.starterMission || b.id) - ); - - return sortedMissions.find( - (mission) => - !completedMissions.includes(mission.starterMission || mission.id) && - (activemission === null || (mission.starterMission || mission.id) > activemission) - ); - /* --- End of changes --- */ - }; - - const resetMission = async (mission: Useractivemission) => { - try { - const { error: clearError } = await supabase - .from('profiles') - .update({ activemission: null }) - .eq('id', session?.user?.id); - - if (clearError) throw clearError; - - // Reset the mission after clearing - const { error: resetError } = await supabase - .from('profiles') - .update({ activemission: mission.starterMission || mission.id }) - .eq('id', session?.user?.id); - - if (resetError) throw resetError; - - /* --- Start of changes --- - Updated state setter to use 'starterMission' if available, otherwise 'id' - */ - setactivemission(mission.starterMission || mission.id); - /* --- End of changes --- */ - setError(null); - } catch (error: any) { - console.error("Error resetting mission:", error.message); - setError("Failed to reset mission."); - } - }; - - const startMission = async (mission: Useractivemission) => { - if (activemission !== null) { - setError("You already have an active mission."); - return; - } - - try { - const { error: updateError } = await supabase - .from('profiles') - .update({ activemission: mission.starterMission || mission.id }) - .eq('id', session?.user?.id); - if (updateError) throw updateError; - - /* --- Start of changes --- - Updated state setter to use 'starterMission' if available, otherwise 'id' - */ - setactivemission(mission.starterMission || mission.id); - /* --- End of changes --- */ - - if (mission.createStructure) { - const { error: inventoryError } = await supabase - .from('inventory') - .insert({ - item: mission.createStructure, - owner: session?.user?.id, - anomaly: activePlanet.id, - quantity: 1, - }); - - if (inventoryError) throw inventoryError; - } - - setError(null); - } catch (error: any) { - console.error("Error starting mission:", error.message); - setError("Failed to start mission."); - } - }; - - const nextMission = getNextMission(); - - return ( - -
-
-
- AI Avatar -
-
- {/* Close Button */} - - -

Capt'n Cosmos Says:

- - {/* Display StarterMissionsStats if the active mission is 1370203 or 1370204 */} - {(activemission === 1370203 || activemission === 1370204) ? ( - - ) : ( - <> - {/* Display the current mission */} - {activemission && ( -
- {/* --- Start of changes --- - Updated to use 'starterMission' if available, otherwise 'id' - */} -

Current Mission: {missions.find(m => (m.starterMission || m.id) === activemission)?.name || "Unknown Mission"}

- - {/* --- End of changes --- */} -
- )} - - {/* Display the next mission */} - {nextMission && ( -
-

Next Mission: {nextMission.name}

- - -
- )} - - )} -
-
-
-
- ); -}; \ No newline at end of file diff --git a/app/components/(scenes)/(missions)/CompletedMissions.tsx b/app/components/(scenes)/(missions)/CompletedMissions.tsx deleted file mode 100644 index 03e74dc2..00000000 --- a/app/components/(scenes)/(missions)/CompletedMissions.tsx +++ /dev/null @@ -1,192 +0,0 @@ -"use client"; - -import React, { useEffect, useState } from 'react'; -import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'; -import { ChevronDown, ChevronUp, CheckCircle, Circle } from 'lucide-react'; -import { useActivePlanet } from '@/context/ActivePlanet'; - -interface CitizenScienceModule { - id: number; - name: string; - level?: number; - starterMission?: number; - structure: number; - description?: string; -} - -interface MissionData { - mission: number; -} - -export default function StarterMissionsStats() { - const session = useSession(); - const supabase = useSupabaseClient(); - const { activePlanet } = useActivePlanet(); - - const [modules, setModules] = useState([]); - const [completedMissions, setCompletedMissions] = useState([]); - const [expandedMission, setExpandedMission] = useState(null); - const [activemission, setactivemission] = useState(null); - const [errorMessage, setErrorMessage] = useState(null); - - useEffect(() => { - const fetchData = async () => { - if (!session) return; - - try { - const [modulesResponse, missionsData, profileData] = await Promise.all([ - fetch('/api/citizen/modules'), - supabase.from('missions').select('mission').eq('user', session.user.id), - supabase.from('profiles').select('activemission').eq('id', session.user.id).single() - ]); - - const modulesData: CitizenScienceModule[] = await modulesResponse.json(); - setModules(modulesData); - - if (missionsData.error) throw missionsData.error; - const missionIds = missionsData.data.map((mission: MissionData) => mission.mission); - setCompletedMissions(missionIds); - - if (profileData.error) throw profileData.error; - setactivemission(profileData.data.activemission); - - } catch (error) { - console.error('Error fetching data:', error); - setErrorMessage('Failed to load mission data. Please try again.'); - } - }; - - fetchData(); - }, [session, supabase]); - - const isMissionCompleted = (starterMission: number | undefined): boolean => - starterMission !== undefined && completedMissions.includes(starterMission); - - const toggleMission = (id: number): void => - setExpandedMission(expandedMission === id ? null : id); - - const createInventoryEntry = async (module: CitizenScienceModule): Promise => { - if (!session || !activePlanet) return; - - try { - const { data: existingEntries, error: checkError } = await supabase - .from('inventory') - .select('*') - .eq('owner', session.user.id) - .eq('item', module.structure) - .eq('anomaly', activePlanet.id); - - if (checkError) throw checkError; - - if (existingEntries.length === 0) { - const { error: insertError } = await supabase - .from('inventory') - .insert({ - owner: session.user.id, - item: module.structure, - anomaly: activePlanet.id, - quantity: 1, - }); - - if (insertError) throw insertError; - } - } catch (error) { - console.error('Error creating inventory entry:', error); - setErrorMessage('Failed to update inventory. Please try again.'); - } - }; - - const updateactivemission = async (starterMission: number | undefined, module: CitizenScienceModule): Promise => { - if (!session) return; - - try { - await supabase.from('missions').upsert({ - user: session.user.id, - mission: 1370203, - time_of_completion: null, - configuration: {}, - rewarded_items: [], - }); - - const { error: updateError } = await supabase - .from('profiles') - .update({ activemission: starterMission }) - .eq('id', session.user.id); - - if (updateError) throw updateError; - - setactivemission(starterMission || null); - setErrorMessage(null); - console.log(`Active mission updated to: ${starterMission}`); - - await createInventoryEntry(module); - } catch (error) { - console.error('Error updating active mission:', error); - setErrorMessage('Failed to update active mission. Please try again.'); - } - }; - - const handleSetactivemission = (module: CitizenScienceModule): void => { - if (activemission === 1370203) { - updateactivemission(module.starterMission, module); - } else if (activemission) { - setErrorMessage("You already have an active mission. You must complete or cancel it before starting a new one."); - } else { - updateactivemission(module.starterMission, module); - } - }; - - const sortedModules = [...modules].sort((a, b) => - Number(isMissionCompleted(b.starterMission)) - Number(isMissionCompleted(a.starterMission)) - ); - - return ( -
-
-

Mission Log

- - {errorMessage && ( -
- {errorMessage} -
- )} - -
    - {sortedModules.map((module) => ( -
  • -
    toggleMission(module.id)} - > -
    - {isMissionCompleted(module.starterMission) ? ( - - ) : ( - - )} - {module.name} (Level {module.level}) -
    - {expandedMission === module.id ? ( - - ) : ( - - )} -
    - {expandedMission === module.id && module.description && ( -
    -

    {module.description}

    - -
    - )} -
  • - ))} -
-
-
- ); -} \ No newline at end of file diff --git a/app/components/(scenes)/chapters/(onboarding)/ProgressBar.tsx b/app/components/(scenes)/chapters/(onboarding)/ProgressBar.tsx deleted file mode 100644 index 8039ae61..00000000 --- a/app/components/(scenes)/chapters/(onboarding)/ProgressBar.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from "react"; - -interface ProgressBarProps { - currentStepIndex: number; - totalSteps: number; -}; - -const ProgressBar = ({ currentStepIndex, totalSteps }: ProgressBarProps) => { - const progressPercentage = ((currentStepIndex + 1) / totalSteps) * 100; - - return ( -
-
-
-
-

- Step {currentStepIndex + 1} of {totalSteps} -

-
- ); -}; - -export default ProgressBar; \ No newline at end of file diff --git a/app/components/(scenes)/chapters/helpers/animatedPointer.tsx b/app/components/(scenes)/chapters/helpers/animatedPointer.tsx deleted file mode 100644 index 2c9699d9..00000000 --- a/app/components/(scenes)/chapters/helpers/animatedPointer.tsx +++ /dev/null @@ -1,91 +0,0 @@ -'use client' - -import { motion } from "framer-motion" - -interface AnimatedPointerProps { - position?: "top" | "right" | "bottom" | "left" - arrowDirection?: "up" | "right" | "down" | "left" - offset?: number - size?: number -} - -export default function AnimatedPointer({ - position = "left", - arrowDirection = "right", - offset = 20, - size = 120 -}: AnimatedPointerProps = {}) { - const rotations = { - top: 0, - right: 90, - bottom: 180, - left: 270 - } - - const arrowRotations = { - up: 270, - right: 0, - down: 90, - left: 180 - } - - const positions = { - top: { top: -offset, left: '50%', transform: 'translateX(-50%)' }, - right: { top: '50%', right: -offset, transform: 'translateY(-50%)' }, - bottom: { bottom: -offset, left: '50%', transform: 'translateX(-50%)' }, - left: { top: '50%', left: -offset, transform: 'translateY(-50%)' } - } - - return ( - - - - - - - - - - - - - - - - ) -} \ No newline at end of file diff --git a/app/components/(scenes)/chapters/one/HelpPickup.tsx b/app/components/(scenes)/chapters/one/HelpPickup.tsx deleted file mode 100644 index 02edb0b2..00000000 --- a/app/components/(scenes)/chapters/one/HelpPickup.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; - -interface GuideButtonProps { - onClick: () => void; -} - -const GuideButton: React.FC = ({ onClick }) => { - return ( - - ); -}; - -export default GuideButton; \ No newline at end of file diff --git a/app/components/(structures)/StructuresForMission.tsx b/app/components/(structures)/StructuresForMission.tsx deleted file mode 100644 index b028979c..00000000 --- a/app/components/(structures)/StructuresForMission.tsx +++ /dev/null @@ -1,170 +0,0 @@ -import React, { useEffect, useState } from "react"; -import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; -import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructuresConfig } from "@/constants/Structures/Properties"; - -interface CitizenScienceModule { - id: number; - name: string; - level?: number; // aka chapter - starterMission?: number; // used to determine if a user has started it - structure: number; -}; - -export interface Mission { - id: number; - name: string; - sequence?: number; - description?: string; - rewards?: number[]; - classificationModule?: string; - structure?: number; - chapter?: number; - component?: React.ComponentType; -}; - -const modules: CitizenScienceModule[] = [ - { - id: 1, name: "Planet Candidate Identification", level: 1, starterMission: 1372001, structure: 3103, - }, - { - id: 2, name: "Animal Observations", level: 1, starterMission: 1370202, structure: 3104, - }, - { - id: 21, name: "Animal uploader", level: 1, starterMission: 1370202, structure: 3104, - }, - { - id: 4, name: "Cloud identification", level: 1, starterMission: 137121301, structure: 3105, - }, - { - id: 5, name: "Map the terrain (of your planet)", level: 1, starterMission: 13714101, structure: 3102, - }, -]; - -interface MissionStructureDisplayProps { - activemission: number; -}; - -interface StructureConfig { - name: string; - title: string; - labels: { text: string; variant: "default" | "secondary" | "destructive" }[]; - imageSrc: string; - actions: any[]; - buttons: { icon: React.ReactNode; text: string; showInNoModal: boolean; dynamicComponent?: React.ReactNode; sizePercentage?: number }[]; -} - -export function MissionStructureDisplay({ activemission }: MissionStructureDisplayProps) { - const supabase = useSupabaseClient(); - const session = useSession(); - const { activePlanet } = useActivePlanet(); - - const [selectedStructure, setSelectedStructure] = useState(null); - const [loading, setLoading] = useState(true); - const [insertLock, setInsertLock] = useState(false); // Prevent duplicate insertions - - useEffect(() => { - async function fetchStructureForMission() { - if (!session?.user?.id || !activePlanet?.id || insertLock) { - setLoading(false); - return; - } - - setInsertLock(true); // Set the lock before performing actions - - try { - // Find the corresponding module and structure based on the activemission ID - const module = modules.find(mod => mod.starterMission === activemission); - if (!module) { - setLoading(false); - return; - } - - // Fetch the structure details based on the module's structure ID - const structureId = module.structure; - const config = StructuresConfig[structureId]; - - // If structure is not defined in StructuresConfig, show "Structure not available" - if (!config) { - setSelectedStructure({ - name: "Structure not available", - title: "", - labels: [], - imageSrc: "/not-available.svg", // You can use any placeholder image - actions: [], // Ensure this is always an array - buttons: [], // Ensure this is always an array - }); - setLoading(false); - return; - } - - // Set the selected structure using the config - setSelectedStructure({ - name: config.name || "", - title: config.title || "", - labels: config.labels || [], - imageSrc: config.imageSrc || "/default-image.svg", - actions: config.actions || [], - buttons: config.buttons.map(button => ({ - ...button, - showInNoModal: button.showInNoModal || false, // Provide a default value for missing properties - })), - }); - - // Check if the structure already exists in the user's inventory - const { data: existingInventory, error: fetchError } = await supabase - .from('inventory') - .select('*') - .eq('owner', session.user.id) - .eq('anomaly', activePlanet.id) - .eq('item', structureId); - - if (fetchError) { - console.error("Error fetching inventory:", fetchError); - setLoading(false); - return; - } - - if (existingInventory.length === 0) { - const { error: insertError } = await supabase - .from('inventory') - .insert([ - { owner: session.user.id, - anomaly: activePlanet.id, - item: structureId, - time_of_deploy: new Date().toISOString(), - configuration: { "Uses": 10, "Created for": "Starter mission", "Mission ID": activemission }, - }, - ]); - - if (insertError) { - console.error("Error inserting structure into inventory:", insertError); - } - } - - } catch (error) { - console.error("Error fetching data:", error); - } finally { - setInsertLock(false); // Unlock after the operation is complete - setLoading(false); - } - } - - fetchStructureForMission(); - }, [activemission, session?.user?.id, activePlanet?.id, insertLock, supabase]); - - const handleClose = () => { - setTimeout(() => { - setSelectedStructure(null); - }, 100); - }; - - if (loading) { - return
Loading...
; - } - - return ( -
-
- ); -}; diff --git a/app/layout.tsx b/app/layout.tsx index acde2b34..2e4751ab 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -12,7 +12,7 @@ import { UserAnomaliesProvider } from "@/context/UserAnomalies"; import { bgImage, backgroundImages } from "@/constants/backgrounds"; import { Analytics } from "@vercel/analytics/react" import { MissionProvider } from "@/context/MissionContext"; -import TutorialPopup from "./components/(dialogue)/helpButton"; +import TutorialPopup from "../components/(dialogue)/helpButton"; // import { CreateStructureWithItemRequirementinfo } from "@/components/Gameplay/Inventory/Structures/Structure"; export default function RootLayout({ children }: { children: React.ReactNode }) { diff --git a/app/page.tsx b/app/page.tsx index 244f1aff..bb449b61 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,11 +1,11 @@ "use client" -import { OnboardingLayout } from "@/app/components/Template"; +import { OnboardingLayout } from "@/components/Template"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; -import { Landing } from "@/app/components/landing"; +import { Landing } from "@/components/landing"; import { useEffect, useState } from "react"; import LoginPage from "./auth/LoginModal"; -import OnboardingWindow from "./components/(scenes)/chapters/(onboarding)/window"; +import OnboardingWindow from "../components/(scenes)/chapters/(onboarding)/window"; import { useActivePlanet } from "@/context/ActivePlanet"; import { EarthView, diff --git a/app/scenes/earth/moon/page.tsx b/app/scenes/earth/moon/page.tsx index 80ee5c63..4791e8c7 100644 --- a/app/scenes/earth/moon/page.tsx +++ b/app/scenes/earth/moon/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const MoonView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/earth/page.tsx b/app/scenes/earth/page.tsx index 0ea4a517..714b8784 100644 --- a/app/scenes/earth/page.tsx +++ b/app/scenes/earth/page.tsx @@ -3,13 +3,13 @@ import React, { useCallback, useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { EarthViewLayout } from "@/app/components/(scenes)/planetScene/layout"; +import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout"; import { InventoryStructureItem } from "@/types/Items"; -import { PlanetarySystem } from "@/app/components/(scenes)/planetScene/orbitals/system"; -import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/app/components/(structures)/Structures"; +import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system"; +import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/(structures)/Structures"; import { SciFiPopupMenu } from "@/components/ui/popupMenu"; -import AllAutomatonsOnActivePlanet from "@/app/components/(vehicles)/(automatons)/AllAutomatons"; -import InitialiseChapterOneUser from "@/app/components/(scenes)/chapters/one/InitialiseUser"; +import AllAutomatonsOnActivePlanet from "@/components/(structures)/Auto/AllAutomatons"; +import InitialiseChapterOneUser from "@/components/(scenes)/chapters/one/InitialiseUser"; const EarthView: React.FC = () => { const supabase = useSupabaseClient(); diff --git a/app/scenes/jupiter/amalthea/page.tsx b/app/scenes/jupiter/amalthea/page.tsx index f3e17477..d56d2ff3 100644 --- a/app/scenes/jupiter/amalthea/page.tsx +++ b/app/scenes/jupiter/amalthea/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const AmaltheaView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/jupiter/europa/page.tsx b/app/scenes/jupiter/europa/page.tsx index 435dba72..d26a562d 100644 --- a/app/scenes/jupiter/europa/page.tsx +++ b/app/scenes/jupiter/europa/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const EuropaView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/jupiter/io/page.tsx b/app/scenes/jupiter/io/page.tsx index ae1789c9..391427ac 100644 --- a/app/scenes/jupiter/io/page.tsx +++ b/app/scenes/jupiter/io/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const IoView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/jupiter/page.tsx b/app/scenes/jupiter/page.tsx index 1e49a719..65cdff94 100644 --- a/app/scenes/jupiter/page.tsx +++ b/app/scenes/jupiter/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const JupiterView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/mars/deimos/page.tsx b/app/scenes/mars/deimos/page.tsx index de25c6b6..91753f2e 100644 --- a/app/scenes/mars/deimos/page.tsx +++ b/app/scenes/mars/deimos/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const DeimosView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/mars/page.tsx b/app/scenes/mars/page.tsx index a4d694b2..4163422b 100644 --- a/app/scenes/mars/page.tsx +++ b/app/scenes/mars/page.tsx @@ -4,12 +4,12 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { EarthViewLayout } from "@/app/components/(scenes)/planetScene/layout"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/app/components/(structures)/Structures"; +import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/(structures)/Structures"; import { InventoryStructureItem } from "@/types/Items"; -import { PlanetarySystem } from "@/app/components/(scenes)/planetScene/orbitals/system"; -import AllAutomatonsOnActivePlanet from "@/app/components/(vehicles)/(automatons)/AllAutomatons"; +import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system"; +import AllAutomatonsOnActivePlanet from "@/components/(structures)/Auto/AllAutomatons"; const MarsView: React.FC = () => { const supabase = useSupabaseClient(); diff --git a/app/scenes/mars/phobos/page.tsx b/app/scenes/mars/phobos/page.tsx index 093109ac..30914991 100644 --- a/app/scenes/mars/phobos/page.tsx +++ b/app/scenes/mars/phobos/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const PhobosView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/mercury/page.tsx b/app/scenes/mercury/page.tsx index f26c9fa2..a2853926 100644 --- a/app/scenes/mercury/page.tsx +++ b/app/scenes/mercury/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const MercuryView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/mining/page.tsx b/app/scenes/mining/page.tsx index 3ee9a869..dd80aa90 100644 --- a/app/scenes/mining/page.tsx +++ b/app/scenes/mining/page.tsx @@ -2,9 +2,9 @@ import React, { useState } from "react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import MineralDeposits from "@/app/components/(structures)/Mining/AvailableDeposits"; -import { SelectMineralPanel } from "@/app/components/(structures)/Mining/MiningPanels"; -import MineralsInventoryGrid from "@/app/components/(inventory)/mineralsPanel"; +import MineralDeposits from "@/components/(structures)/Mining/AvailableDeposits"; +import { SelectMineralPanel } from "@/components/(structures)/Mining/MiningPanels"; +import MineralsInventoryGrid from "@/components/(inventory)/mineralsPanel"; enum Step { MineralDeposits = "MINERAL_DEPOSITS", diff --git a/app/scenes/neptune/page.tsx b/app/scenes/neptune/page.tsx index a4087442..b561709d 100644 --- a/app/scenes/neptune/page.tsx +++ b/app/scenes/neptune/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const NeptuneView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/neptune/triton/page.tsx b/app/scenes/neptune/triton/page.tsx index b31db8cb..bc08cc50 100644 --- a/app/scenes/neptune/triton/page.tsx +++ b/app/scenes/neptune/triton/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const TritonView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/planet/page.tsx b/app/scenes/planet/page.tsx index 802becf8..9cbb85bb 100644 --- a/app/scenes/planet/page.tsx +++ b/app/scenes/planet/page.tsx @@ -3,15 +3,14 @@ import React, { useState, useEffect, useCallback } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import PlanetViewLayout from "@/app/components/(scenes)/planetScene/layout"; -import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/app/components/(structures)/Structures"; +import PlanetViewLayout from "@/components/(scenes)/planetScene/layout"; +import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/(structures)/Structures"; import { InventoryStructureItem } from "@/types/Items"; -import ChapterOneIntroduction from "@/app/components/(scenes)/chapters/one/ChapterOneIntro"; -import { PlanetarySystem } from "@/app/components/(scenes)/planetScene/orbitals/system"; +import ChapterOneIntroduction from "@/components/(scenes)/chapters/one/ChapterOneIntro"; +import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system"; // import { BottomMenuBar } from "@/app/components/sections/bottomMenuBar"; -import AllAutomatonsOnActivePlanet from "@/app/components/(vehicles)/(automatons)/AllAutomatons"; +import AllAutomatonsOnActivePlanet from "@/components/(structures)/Auto/AllAutomatons"; import { SciFiPopupMenu } from "@/components/ui/popupMenu"; -import GuideButton from "@/app/components/(scenes)/chapters/one/HelpPickup"; export default function PlanetViewPage() { const session = useSession(); @@ -102,9 +101,6 @@ export default function PlanetViewPage() { return (
- - {/* null} /> */} - setIsGuidePopupVisible(true)} /> {/* Add the Guide button */} {isGuidePopupVisible && (
diff --git a/app/scenes/pluto/page.tsx b/app/scenes/pluto/page.tsx index 290f6055..a886e727 100644 --- a/app/scenes/pluto/page.tsx +++ b/app/scenes/pluto/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const PlutoView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/saturn/enceladus/page.tsx b/app/scenes/saturn/enceladus/page.tsx index a34be3bc..a678cc49 100644 --- a/app/scenes/saturn/enceladus/page.tsx +++ b/app/scenes/saturn/enceladus/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const EnceladusView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/saturn/page.tsx b/app/scenes/saturn/page.tsx index 7a89f2e3..1338d1d2 100644 --- a/app/scenes/saturn/page.tsx +++ b/app/scenes/saturn/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const SaturnView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/saturn/titan/page.tsx b/app/scenes/saturn/titan/page.tsx index 365edb03..59c2e4b6 100644 --- a/app/scenes/saturn/titan/page.tsx +++ b/app/scenes/saturn/titan/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const TitanView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/uranus/miranda/page.tsx b/app/scenes/uranus/miranda/page.tsx index 348dd95d..5cb3fcfa 100644 --- a/app/scenes/uranus/miranda/page.tsx +++ b/app/scenes/uranus/miranda/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const MirandaView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/uranus/page.tsx b/app/scenes/uranus/page.tsx index d9d3af73..b685b87a 100644 --- a/app/scenes/uranus/page.tsx +++ b/app/scenes/uranus/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const UranusView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/scenes/venus/page.tsx b/app/scenes/venus/page.tsx index 5c316ed7..a1de7e13 100644 --- a/app/scenes/venus/page.tsx +++ b/app/scenes/venus/page.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import InitialisePlanet from "@/app/components/(scenes)/planetScene/initialisePlanet"; -import PlanetStructures from "@/app/components/(structures)/PlanetStructures"; +import InitialisePlanet from "@/components/(scenes)/planetScene/initialisePlanet"; +import PlanetStructures from "@/components/(anomalies)/(planets)/PlanetStructures"; const VenusView: React.FC = () => { const { activePlanet, updatePlanetLocation } = useActivePlanet(); diff --git a/app/tests/page.tsx b/app/tests/page.tsx index 89a7fe16..29d05e79 100644 --- a/app/tests/page.tsx +++ b/app/tests/page.tsx @@ -1,9 +1,9 @@ "use client"; import React, { useEffect, useState, useCallback } from "react"; -import LaunchpadStructure from "../components/(structures)/Launchpad/Dashboard"; -import MissionList from "../components/(scenes)/planetScene/availableMissions"; -import { PlanetSwitcher } from "../components/(scenes)/planetScene/SwitchPlanet"; +import LaunchpadStructure from "../../components/(structures)/Launchpad/Dashboard"; +import MissionList from "../../components/(scenes)/planetScene/availableMissions"; +import { PlanetSwitcher } from "../../components/(scenes)/planetScene/SwitchPlanet"; export default function TestPage() { return ( diff --git a/app/components/(anomalies)/(data)/Mars-Photos.tsx b/components/(anomalies)/(data)/Mars-Photos.tsx similarity index 96% rename from app/components/(anomalies)/(data)/Mars-Photos.tsx rename to components/(anomalies)/(data)/Mars-Photos.tsx index d2c46bca..d0ab57bc 100644 --- a/app/components/(anomalies)/(data)/Mars-Photos.tsx +++ b/components/(anomalies)/(data)/Mars-Photos.tsx @@ -2,8 +2,8 @@ import { useState, useEffect } from "react"; import axios from "axios"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; -import { MapPinIcon } from "@/app/components/(inventory)/items/MineralDeposits"; +import ClassificationForm from "@/components/(classifications)/PostForm"; +import { MapPinIcon } from "@/components/(inventory)/items/MineralDeposits"; import Spinner from "@/components/ui/Spinner"; export const RooverFromAppeears: React.FC = () => { @@ -16,12 +16,12 @@ export const RooverFromAppeears: React.FC = () => { const [imagesCollected, setImagesCollected] = useState(false); const [isClassified, setIsClassified] = useState(false); const [mineralDeposits, setMineralDeposits] = useState([]); - const [loading, setLoading] = useState(true); // Add loading state for the spinner + const [loading, setLoading] = useState(true); const resourceList = ["11", "15", "16", "17", "19", "20"]; const fetchMarsImages = async () => { - setLoading(true); // Start loading when fetching begins + setLoading(true); const randomDate = Math.floor(Math.random() * 1000) + 1; const selectedRover = "perseverance"; const apiUrl = `https://api.nasa.gov/mars-photos/api/v1/rovers/${selectedRover}/photos?sol=${randomDate}&api_key=iT0FQTZKpvadCGPzerqXdO5F4b62arNBOP0dtkXE`; @@ -35,13 +35,13 @@ export const RooverFromAppeears: React.FC = () => { setRoverConfig(response.data); } else { setRovers([{ id: Date.now(), avatar_url: "No images found" }]); - } + }; } catch (error) { console.error("Error fetching rover images from NASA:", error); setRovers([{ id: Date.now(), avatar_url: "An error occurred while fetching the images." }]); } finally { - setLoading(false); // End loading when fetching is done - } + setLoading(false); + }; }; useEffect(() => { @@ -78,7 +78,7 @@ export const RooverFromAppeears: React.FC = () => { if (error) { console.error("Error inserting anomalies: ", error.message); throw error; - } + }; setImagesCollected(true); alert("Images collected successfully!"); @@ -112,19 +112,19 @@ export const RooverFromAppeears: React.FC = () => { if (error) { console.error("Error inserting mineral deposits: ", error.message); throw error; - } + }; alert("Mining settlement established successfully!"); } catch (error) { console.error("Error establishing mining settlement: ", error); alert("Failed to establish the mining settlement."); - } + }; }; }; return (
- {loading ? ( // Show spinner if loading is true + {loading ? ( ) : ( <> @@ -196,7 +196,6 @@ export const RooverFromAppeears: React.FC = () => { ); }; - export const RoverPhoto: React.FC = () => { const supabase = useSupabaseClient(); const session = useSession(); @@ -297,4 +296,4 @@ export const RoverPhoto: React.FC = () => { )}
); -}; +}; \ No newline at end of file diff --git a/app/components/(structures)/PlanetStructures.tsx b/components/(anomalies)/(planets)/PlanetStructures.tsx similarity index 88% rename from app/components/(structures)/PlanetStructures.tsx rename to components/(anomalies)/(planets)/PlanetStructures.tsx index 7ccbc804..a26d5deb 100644 --- a/app/components/(structures)/PlanetStructures.tsx +++ b/components/(anomalies)/(planets)/PlanetStructures.tsx @@ -4,10 +4,10 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; import { InventoryStructureItem } from "@/types/Items"; -import { EarthViewLayout } from "../(scenes)/planetScene/layout"; -import { PlanetarySystem } from "../(scenes)/planetScene/orbitals/system"; -import StructuresOnPlanet, { OrbitalStructuresOnPlanet, AtmosphereStructuresOnPlanet } from "./Structures"; -import AllAutomatonsOnActivePlanet from "../(vehicles)/(automatons)/AllAutomatons"; +import { EarthViewLayout } from "../../(scenes)/planetScene/layout"; +import { PlanetarySystem } from "../../(scenes)/planetScene/orbitals/system"; +import StructuresOnPlanet, { OrbitalStructuresOnPlanet, AtmosphereStructuresOnPlanet } from "../../(structures)/Structures"; +import AllAutomatonsOnActivePlanet from "../../(structures)/Auto/AllAutomatons"; const PlanetStructures: React.FC = () => { const supabase = useSupabaseClient(); diff --git a/app/components/(anomalies)/(planets)/classificationsGenerated.tsx b/components/(anomalies)/(planets)/classificationsGenerated.tsx similarity index 100% rename from app/components/(anomalies)/(planets)/classificationsGenerated.tsx rename to components/(anomalies)/(planets)/classificationsGenerated.tsx diff --git a/app/components/(anomalies)/(planets)/generated.tsx b/components/(anomalies)/(planets)/generated.tsx similarity index 100% rename from app/components/(anomalies)/(planets)/generated.tsx rename to components/(anomalies)/(planets)/generated.tsx diff --git a/app/components/(create)/(classifications)/ClassificationResults.tsx b/components/(classifications)/ClassificationResults.tsx similarity index 100% rename from app/components/(create)/(classifications)/ClassificationResults.tsx rename to components/(classifications)/ClassificationResults.tsx diff --git a/app/components/(create)/(classifications)/FormConfigurations.ts b/components/(classifications)/FormConfigurations.ts similarity index 100% rename from app/components/(create)/(classifications)/FormConfigurations.ts rename to components/(classifications)/FormConfigurations.ts diff --git a/app/components/(create)/(classifications)/MegaClassificationForm.tsx b/components/(classifications)/MegaClassificationForm.tsx similarity index 98% rename from app/components/(create)/(classifications)/MegaClassificationForm.tsx rename to components/(classifications)/MegaClassificationForm.tsx index 4cac9a99..b147cca5 100644 --- a/app/components/(create)/(classifications)/MegaClassificationForm.tsx +++ b/components/(classifications)/MegaClassificationForm.tsx @@ -4,8 +4,8 @@ import React, { useState, useEffect } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; import { useProfileContext } from "@/context/UserProfile"; -import { ClassificationOutput } from "@/app/components/(create)/(classifications)/ClassificationResults"; -import { UserAvatarNullUpload } from "@/app/components/(settings)/profile/Avatar"; +import { ClassificationOutput } from "@/components/(classifications)/ClassificationResults"; +import { UserAvatarNullUpload } from "@/components/profile/Avatar"; export interface ClassificationOption { id: number; diff --git a/app/components/(create)/(classifications)/PostForm.tsx b/components/(classifications)/PostForm.tsx similarity index 99% rename from app/components/(create)/(classifications)/PostForm.tsx rename to components/(classifications)/PostForm.tsx index 4f2994f8..6df4324e 100644 --- a/app/components/(create)/(classifications)/PostForm.tsx +++ b/components/(classifications)/PostForm.tsx @@ -4,9 +4,9 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; import { useProfileContext } from "@/context/UserProfile"; -import UserAvatar, { UserAvatarNullUpload } from "@/app/components/(settings)/profile/Avatar"; +import UserAvatar, { UserAvatarNullUpload } from "@/components/profile/Avatar"; import { ClassificationOutput } from "./ClassificationResults"; -import IntroduceUserToResearch from "../../(scenes)/chapters/(onboarding)/initialiseResearch"; +import IntroduceUserToResearch from "../(scenes)/chapters/(onboarding)/initialiseResearch"; interface ClassificationOption { id: number; diff --git a/app/components/(create)/(classifications)/YourClassifications.tsx b/components/(classifications)/YourClassifications.tsx similarity index 99% rename from app/components/(create)/(classifications)/YourClassifications.tsx rename to components/(classifications)/YourClassifications.tsx index c92e4623..7f883403 100644 --- a/app/components/(create)/(classifications)/YourClassifications.tsx +++ b/components/(classifications)/YourClassifications.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useCallback } from "react"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; import { format } from 'date-fns'; -import ClassificationSummary from "../../(anomalies)/(planets)/classificationsGenerated"; +import ClassificationSummary from "../(anomalies)/(planets)/classificationsGenerated"; interface Classification { id: number; diff --git a/app/components/(create)/(classifications)/temp/NestQuestGoForm.tsx b/components/(classifications)/temp/NestQuestGoForm.tsx similarity index 98% rename from app/components/(create)/(classifications)/temp/NestQuestGoForm.tsx rename to components/(classifications)/temp/NestQuestGoForm.tsx index 099271b4..56db6476 100644 --- a/app/components/(create)/(classifications)/temp/NestQuestGoForm.tsx +++ b/components/(classifications)/temp/NestQuestGoForm.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { UserAvatarNullUpload } from "@/app/components/(settings)/profile/Avatar"; -import IntroduceUserToResearch from "@/app/components/(scenes)/chapters/(onboarding)/initialiseResearch"; +import { UserAvatarNullUpload } from "@/components/profile/Avatar"; +import IntroduceUserToResearch from "@/components/(scenes)/chapters/(onboarding)/initialiseResearch"; interface ClassificationFormProps { anomalyType: string; diff --git a/app/components/(dialogue)/helpButton.tsx b/components/(dialogue)/helpButton.tsx similarity index 100% rename from app/components/(dialogue)/helpButton.tsx rename to components/(dialogue)/helpButton.tsx diff --git a/app/components/(structures)/entryInfo.tsx b/components/(inventory)/entryInfo.tsx similarity index 100% rename from app/components/(structures)/entryInfo.tsx rename to components/(inventory)/entryInfo.tsx diff --git a/app/components/(structures)/fetchId.tsx b/components/(inventory)/fetchId.tsx similarity index 100% rename from app/components/(structures)/fetchId.tsx rename to components/(inventory)/fetchId.tsx diff --git a/app/components/(inventory)/items/MineralDeposits.tsx b/components/(inventory)/items/MineralDeposits.tsx similarity index 100% rename from app/components/(inventory)/items/MineralDeposits.tsx rename to components/(inventory)/items/MineralDeposits.tsx diff --git a/app/components/(inventory)/mineralsPanel.tsx b/components/(inventory)/mineralsPanel.tsx similarity index 99% rename from app/components/(inventory)/mineralsPanel.tsx rename to components/(inventory)/mineralsPanel.tsx index ad4c61a5..22988521 100644 --- a/app/components/(inventory)/mineralsPanel.tsx +++ b/components/(inventory)/mineralsPanel.tsx @@ -20,7 +20,6 @@ interface InventoryItem { owner: string; quantity: number; anomaly: number; - // Other fields... } const MineralsInventoryGrid = () => { diff --git a/app/components/(scenes)/chapters/(onboarding)/initialiseResearch.tsx b/components/(scenes)/chapters/(onboarding)/initialiseResearch.tsx similarity index 100% rename from app/components/(scenes)/chapters/(onboarding)/initialiseResearch.tsx rename to components/(scenes)/chapters/(onboarding)/initialiseResearch.tsx diff --git a/app/components/(scenes)/chapters/(onboarding)/window.tsx b/components/(scenes)/chapters/(onboarding)/window.tsx similarity index 95% rename from app/components/(scenes)/chapters/(onboarding)/window.tsx rename to components/(scenes)/chapters/(onboarding)/window.tsx index 78b987bf..8d8e01cc 100644 --- a/app/components/(scenes)/chapters/(onboarding)/window.tsx +++ b/components/(scenes)/chapters/(onboarding)/window.tsx @@ -2,11 +2,11 @@ import { useState, useEffect } from "react"; import { motion } from "framer-motion"; -import ProfileCardModal from "@/app/components/(settings)/profile/form"; +import ProfileCardModal from "@/components/profile/form"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; -import { FirstTelescopeClassification } from "@/app/components/(structures)/Telescopes/Transiting"; +import { FirstTelescopeClassification } from "@/components/Projects/Telescopes/Transiting"; import { useActivePlanet } from "@/context/ActivePlanet"; -import DeployRooversInitial from "../../roovers/deployAndReturn"; +import DeployRooversInitial from "../../../(structures)/Auto/deployAndReturn"; import GeneratedStarterPlanet from "../../../(anomalies)/(planets)/generated"; import { Mission } from "@/types/Missions"; import { OnboardingStepProps } from "@/types/Onboarding"; @@ -269,12 +269,6 @@ const OnboardingWindow = () => { > Back - {/* step.id === currentStep - )} - totalSteps={steps.length} - /> */}
); -}; - -// 21, 13, 15 -// 13, 15, 16 -// 19, 15, 20 -// 20, 16, 13 -// 17, 19, 15 -// 13, 11, 17 \ No newline at end of file +}; \ No newline at end of file diff --git a/app/components/(scenes)/roovers/deployAndReturn.tsx b/components/(structures)/Auto/deployAndReturn.tsx similarity index 98% rename from app/components/(scenes)/roovers/deployAndReturn.tsx rename to components/(structures)/Auto/deployAndReturn.tsx index ba649fca..dcbfab05 100644 --- a/app/components/(scenes)/roovers/deployAndReturn.tsx +++ b/components/(structures)/Auto/deployAndReturn.tsx @@ -10,7 +10,7 @@ import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { RooverFromAppeears } from "@/app/components/(anomalies)/(data)/Mars-Photos"; +import { RooverFromAppeears } from "@/components/(anomalies)/(data)/Mars-Photos"; interface RoverData { photos: string[]; diff --git a/app/components/(structures)/Build/EditMode.tsx b/components/(structures)/Build/EditMode.tsx similarity index 100% rename from app/components/(structures)/Build/EditMode.tsx rename to components/(structures)/Build/EditMode.tsx diff --git a/app/components/(structures)/Config/AutomatonUpgradeBox.tsx b/components/(structures)/Config/AutomatonUpgradeBox.tsx similarity index 100% rename from app/components/(structures)/Config/AutomatonUpgradeBox.tsx rename to components/(structures)/Config/AutomatonUpgradeBox.tsx diff --git a/app/components/(structures)/Config/RepairStructure.tsx b/components/(structures)/Config/RepairStructure.tsx similarity index 100% rename from app/components/(structures)/Config/RepairStructure.tsx rename to components/(structures)/Config/RepairStructure.tsx diff --git a/app/components/(structures)/IndividualStructure.tsx b/components/(structures)/IndividualStructure.tsx similarity index 100% rename from app/components/(structures)/IndividualStructure.tsx rename to components/(structures)/IndividualStructure.tsx diff --git a/app/components/(structures)/Launchpad/Dashboard.tsx b/components/(structures)/Launchpad/Dashboard.tsx similarity index 100% rename from app/components/(structures)/Launchpad/Dashboard.tsx rename to components/(structures)/Launchpad/Dashboard.tsx diff --git a/app/components/(structures)/Mining/AvailableDeposits.tsx b/components/(structures)/Mining/AvailableDeposits.tsx similarity index 100% rename from app/components/(structures)/Mining/AvailableDeposits.tsx rename to components/(structures)/Mining/AvailableDeposits.tsx diff --git a/app/components/(structures)/Mining/MiningPanels.tsx b/components/(structures)/Mining/MiningPanels.tsx similarity index 96% rename from app/components/(structures)/Mining/MiningPanels.tsx rename to components/(structures)/Mining/MiningPanels.tsx index 88aef82b..692fc738 100644 --- a/app/components/(structures)/Mining/MiningPanels.tsx +++ b/components/(structures)/Mining/MiningPanels.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import { MineralDeposit } from "@/types/Items"; -import { ActiveAutomatonForMining } from "@/app/components/(vehicles)/(automatons)/ActiveAutomaton"; +import { ActiveAutomatonForMining } from "../Auto/ActiveAutomaton"; import MineralDeposits from "./AvailableDeposits"; import MineralsInventoryGrid from "../../(inventory)/mineralsPanel"; diff --git a/app/components/(structures)/Missions/AvailableMissions.tsx b/components/(structures)/Missions/AvailableMissions.tsx similarity index 100% rename from app/components/(structures)/Missions/AvailableMissions.tsx rename to components/(structures)/Missions/AvailableMissions.tsx diff --git a/app/components/(structures)/Research/TechTree.tsx b/components/(structures)/Research/TechTree.tsx similarity index 100% rename from app/components/(structures)/Research/TechTree.tsx rename to components/(structures)/Research/TechTree.tsx diff --git a/app/components/(structures)/Structures.tsx b/components/(structures)/Structures.tsx similarity index 95% rename from app/components/(structures)/Structures.tsx rename to components/(structures)/Structures.tsx index 522e9a95..747b8876 100644 --- a/app/components/(structures)/Structures.tsx +++ b/components/(structures)/Structures.tsx @@ -7,10 +7,9 @@ import { InventoryStructureItem, StructureItemDetail } from "@/types/Items"; import IndividualStructure from "./IndividualStructure"; import { StructuresConfig } from "@/constants/Structures/Properties"; import { LockIcon } from "lucide-react"; -import AnimatedPointer from "../(scenes)/chapters/helpers/animatedPointer"; import { IndividualStructureProps } from "./IndividualStructure"; -import "../../../styles/Anims/StarterStructureAnimations.css"; +import "../../styles/Anims/StarterStructureAnimations.css"; interface StructuresOnPlanetProps { onStructuresFetch: ( @@ -20,7 +19,6 @@ interface StructuresOnPlanetProps { ) => void; }; -import { CitizenScienceModule } from "@/app/api/citizen/modules/route"; import { UnownedSurfaceStructures } from "./Build/EditMode"; export default function StructuresOnPlanet({ onStructuresFetch }: StructuresOnPlanetProps) { @@ -41,9 +39,6 @@ export default function StructuresOnPlanet({ onStructuresFetch }: StructuresOnPl } try { - const modulesResponse = await fetch('/api/citizen/modules'); - const modulesData: CitizenScienceModule[] = await modulesResponse.json(); - const response = await fetch('/api/gameplay/inventory'); const itemsData: StructureItemDetail[] = await response.json(); @@ -165,12 +160,9 @@ export function OrbitalStructuresOnPlanet({ onStructuresFetch }: StructuresOnPla if (!session?.user?.id || !activePlanet?.id) { setLoading(false); return; - } + }; try { - // Fetch Citizen Science Module data - const modulesResponse = await fetch('/api/citizen/modules'); - const modulesData: CitizenScienceModule[] = await modulesResponse.json(); // Fetch item details from the gameplay API const response = await fetch('/api/gameplay/inventory'); @@ -311,10 +303,6 @@ export function AtmosphereStructuresOnPlanet({ onStructuresFetch }: StructuresOn } try { - // Fetch Citizen Science Module data - const modulesResponse = await fetch('/api/citizen/modules'); - const modulesData: CitizenScienceModule[] = await modulesResponse.json(); - // Fetch item details from the gameplay API const response = await fetch('/api/gameplay/inventory'); const itemsData: StructureItemDetail[] = await response.json(); diff --git a/app/components/(structures)/structureInfo.tsx b/components/(structures)/structureInfo.tsx similarity index 100% rename from app/components/(structures)/structureInfo.tsx rename to components/(structures)/structureInfo.tsx diff --git a/app/components/(structures)/Data/ZoodexDataSources.tsx b/components/Data/ZoodexDataSources.tsx similarity index 99% rename from app/components/(structures)/Data/ZoodexDataSources.tsx rename to components/Data/ZoodexDataSources.tsx index de032114..24235049 100644 --- a/app/components/(structures)/Data/ZoodexDataSources.tsx +++ b/components/Data/ZoodexDataSources.tsx @@ -1,8 +1,8 @@ 'use client'; import { CloudDrizzleIcon, SunDimIcon, TelescopeIcon, TestTube } from 'lucide-react'; -import { BurrowingOwlIcon } from '../../Icons/BurrowingOwl'; -import { FishIcon } from '../../Icons/FishIcon'; +import { BurrowingOwlIcon } from '../Icons/BurrowingOwl'; +import { FishIcon } from '../Icons/FishIcon'; export const zoodexDataSources = [ { diff --git a/app/components/(structures)/Data/unlockNewDataSources.tsx b/components/Data/unlockNewDataSources.tsx similarity index 99% rename from app/components/(structures)/Data/unlockNewDataSources.tsx rename to components/Data/unlockNewDataSources.tsx index bb0c06af..9a6c575e 100644 --- a/app/components/(structures)/Data/unlockNewDataSources.tsx +++ b/components/Data/unlockNewDataSources.tsx @@ -3,10 +3,10 @@ import { useEffect, useState } from "react"; import { ChevronDown, ChevronUp, Unlock } from "lucide-react"; import { lidarDataSources, telescopeDataSources, zoodexDataSources, roverDataSources } from "./ZoodexDataSources"; -import { StructureInfo } from "../structureInfo"; +import { StructureInfo } from "../(structures)/structureInfo"; import { useActivePlanet } from "@/context/ActivePlanet"; import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react"; -import { InventoryIdFetcher } from "../fetchId"; +import { InventoryIdFetcher } from "../(inventory)/fetchId"; export function DataSourcesModal({ structureId, structure }: DataSourcesModalProps) { const supabase = useSupabaseClient(); @@ -191,8 +191,8 @@ export function DataSourcesModal({ structureId, structure }: DataSourcesModalPro console.log("Updated configuration:", newConfiguration); } catch (err) { console.error("Error updating inventory configuration:", err); - } - } + }; + }; }; return ( diff --git a/app/components/Icons/BurrowingOwl.tsx b/components/Icons/BurrowingOwl.tsx similarity index 100% rename from app/components/Icons/BurrowingOwl.tsx rename to components/Icons/BurrowingOwl.tsx diff --git a/app/components/Icons/FishIcon.tsx b/components/Icons/FishIcon.tsx similarity index 100% rename from app/components/Icons/FishIcon.tsx rename to components/Icons/FishIcon.tsx diff --git a/app/components/(structures)/Lidar/Clouds.tsx b/components/Projects/Lidar/Clouds.tsx similarity index 98% rename from app/components/(structures)/Lidar/Clouds.tsx rename to components/Projects/Lidar/Clouds.tsx index 793f4546..feab94b6 100644 --- a/app/components/(structures)/Lidar/Clouds.tsx +++ b/components/Projects/Lidar/Clouds.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import ClassificationForm from "@/components/(classifications)/PostForm"; import { Anomaly } from "../Telescopes/Transiting"; import { CloudspottingOnMars } from "./cloudspottingOnMars"; diff --git a/app/components/(structures)/Lidar/cloudspottingOnMars.tsx b/components/Projects/Lidar/cloudspottingOnMars.tsx similarity index 98% rename from app/components/(structures)/Lidar/cloudspottingOnMars.tsx rename to components/Projects/Lidar/cloudspottingOnMars.tsx index b00ffa8b..009cfb8c 100644 --- a/app/components/(structures)/Lidar/cloudspottingOnMars.tsx +++ b/components/Projects/Lidar/cloudspottingOnMars.tsx @@ -3,8 +3,8 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; interface LidarProps { anomalyId: string; diff --git a/app/components/(structures)/Telescopes/DiskDetector.tsx b/components/Projects/Telescopes/DiskDetector.tsx similarity index 98% rename from app/components/(structures)/Telescopes/DiskDetector.tsx rename to components/Projects/Telescopes/DiskDetector.tsx index 66214bd5..c22ce785 100644 --- a/app/components/(structures)/Telescopes/DiskDetector.tsx +++ b/components/Projects/Telescopes/DiskDetector.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; import { Anomaly } from "./Transiting"; interface TelescopeProps { diff --git a/app/components/(structures)/Telescopes/Sunspots.tsx b/components/Projects/Telescopes/Sunspots.tsx similarity index 98% rename from app/components/(structures)/Telescopes/Sunspots.tsx rename to components/Projects/Telescopes/Sunspots.tsx index 336c0f6f..e023a122 100644 --- a/app/components/(structures)/Telescopes/Sunspots.tsx +++ b/components/Projects/Telescopes/Sunspots.tsx @@ -3,9 +3,9 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import { ClassificationFormComponentT } from "../../(create)/(classifications)/MegaClassificationForm"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import { ClassificationFormComponentT } from "@/components/(classifications)/MegaClassificationForm"; +import ClassificationForm from "@/components/(classifications)/PostForm"; interface TelescopeProps { anomalyId: string; diff --git a/app/components/(structures)/Telescopes/Transiting.tsx b/components/Projects/Telescopes/Transiting.tsx similarity index 97% rename from app/components/(structures)/Telescopes/Transiting.tsx rename to components/Projects/Telescopes/Transiting.tsx index 082d35dc..dbc6b159 100644 --- a/app/components/(structures)/Telescopes/Transiting.tsx +++ b/components/Projects/Telescopes/Transiting.tsx @@ -3,10 +3,10 @@ import React, { useEffect, useState } from 'react'; import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'; import { useActivePlanet } from '@/context/ActivePlanet'; -import ClassificationForm from '../../(create)/(classifications)/PostForm'; -import { StructureInfo } from '../structureInfo'; -import { ClassificationFormComponentT } from '../../(create)/(classifications)/MegaClassificationForm'; -import { planetClassificationConfig } from '../../(create)/(classifications)/FormConfigurations'; +import ClassificationForm from '@/components/(classifications)/PostForm'; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import { ClassificationFormComponentT } from '@/components/(classifications)/MegaClassificationForm'; +import { planetClassificationConfig } from '@/components/(classifications)/FormConfigurations'; export interface Anomaly { id: bigint; diff --git a/app/components/(structures)/Zoodex/ClassifyOthersAnimals.tsx b/components/Projects/Zoodex/ClassifyOthersAnimals.tsx similarity index 98% rename from app/components/(structures)/Zoodex/ClassifyOthersAnimals.tsx rename to components/Projects/Zoodex/ClassifyOthersAnimals.tsx index d0e70ea6..6c0365e8 100644 --- a/app/components/(structures)/Zoodex/ClassifyOthersAnimals.tsx +++ b/components/Projects/Zoodex/ClassifyOthersAnimals.tsx @@ -3,9 +3,9 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import ClassificationForm from '../../(create)/(classifications)/PostForm'; -import { zoodexDataSources } from "../Data/ZoodexDataSources"; -import { StructureInfo } from "../structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; +import { zoodexDataSources } from "@/components/Data/ZoodexDataSources"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; import { BurrowingOwl } from "./burrowingOwls"; import { ZoodexIguanas } from "./iguanasFromAbove"; import { NestQuestGo } from "./NestQuestGo"; diff --git a/app/components/(structures)/Zoodex/NestQuestGo.tsx b/components/Projects/Zoodex/NestQuestGo.tsx similarity index 97% rename from app/components/(structures)/Zoodex/NestQuestGo.tsx rename to components/Projects/Zoodex/NestQuestGo.tsx index 97bd5ab4..df352d01 100644 --- a/app/components/(structures)/Zoodex/NestQuestGo.tsx +++ b/components/Projects/Zoodex/NestQuestGo.tsx @@ -3,9 +3,9 @@ import React, { useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; -import { NestQuestGoClassificationForm } from "../../(create)/(classifications)/temp/NestQuestGoForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; +import { NestQuestGoClassificationForm } from "@/components/(classifications)/temp/NestQuestGoForm"; interface ZoodexProps { anomalyId: string; diff --git a/app/components/(structures)/Zoodex/burrowingOwls.tsx b/components/Projects/Zoodex/burrowingOwls.tsx similarity index 99% rename from app/components/(structures)/Zoodex/burrowingOwls.tsx rename to components/Projects/Zoodex/burrowingOwls.tsx index 440156e7..89a4826f 100644 --- a/app/components/(structures)/Zoodex/burrowingOwls.tsx +++ b/components/Projects/Zoodex/burrowingOwls.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; import { Anomaly } from "../Telescopes/Transiting"; interface ZoodexProps { diff --git a/app/components/(structures)/Zoodex/iguanasFromAbove.tsx b/components/Projects/Zoodex/iguanasFromAbove.tsx similarity index 98% rename from app/components/(structures)/Zoodex/iguanasFromAbove.tsx rename to components/Projects/Zoodex/iguanasFromAbove.tsx index 16e386dd..cf86060b 100644 --- a/app/components/(structures)/Zoodex/iguanasFromAbove.tsx +++ b/components/Projects/Zoodex/iguanasFromAbove.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react"; import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react"; import { useActivePlanet } from "@/context/ActivePlanet"; -import { StructureInfo } from "../structureInfo"; -import ClassificationForm from "../../(create)/(classifications)/PostForm"; +import { StructureInfo } from "@/components/(structures)/structureInfo"; +import ClassificationForm from "@/components/(classifications)/PostForm"; interface ZoodexProps { anomalyId: string; diff --git a/app/components/Template.tsx b/components/Template.tsx similarity index 100% rename from app/components/Template.tsx rename to components/Template.tsx diff --git a/app/components/landing.tsx b/components/landing.tsx similarity index 100% rename from app/components/landing.tsx rename to components/landing.tsx diff --git a/app/components/(settings)/profile/Avatar.tsx b/components/profile/Avatar.tsx similarity index 100% rename from app/components/(settings)/profile/Avatar.tsx rename to components/profile/Avatar.tsx diff --git a/app/components/(settings)/profile/form.tsx b/components/profile/form.tsx similarity index 100% rename from app/components/(settings)/profile/form.tsx rename to components/profile/form.tsx diff --git a/components/ui/popupMenu.tsx b/components/ui/popupMenu.tsx index 86138e29..5695af12 100644 --- a/components/ui/popupMenu.tsx +++ b/components/ui/popupMenu.tsx @@ -3,9 +3,7 @@ import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { ChevronLeft, ChevronRight, Globe, Rocket, Star, Zap } from 'lucide-react'; -import { ClassificationViewerAll } from '@/app/components/(create)/(classifications)/YourClassifications'; -import MineralsInventoryGrid from '@/app/components/(inventory)/mineralsPanel'; -import StarterMissionsStats from '@/app/components/(scenes)/(missions)/CompletedMissions'; +import { ClassificationViewerAll } from '@/components/(classifications)/YourClassifications'; interface TutorialMessageProps { isExpanded: boolean; @@ -98,24 +96,9 @@ export function SciFiPopupMenu() {
)} - {showMiningInventory && ( -
-
- - -
-
- )} - {showMissionList && (
-