Skip to content

Commit c0e1843

Browse files
committed
🪸🪲 ↝ [SSG-61 SSG-54 SSC-34 SSG-63]: New onboarding/chapter-1 layout & flow; start
1 parent 83d635a commit c0e1843

File tree

4 files changed

+350
-29
lines changed

4 files changed

+350
-29
lines changed

app/scenes/earth/page.tsx

+35-29
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,66 @@
11
"use client";
22

3-
import React, { useCallback, useEffect, useState } from "react";
3+
import React, { ReactNode, useCallback, useEffect, useState } from "react";
44
import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react";
55
import { useActivePlanet } from "@/context/ActivePlanet";
66
import { EarthViewLayout } from "@/components/(scenes)/planetScene/layout";
77
import { InventoryStructureItem } from "@/types/Items";
88
import { PlanetarySystem } from "@/components/(scenes)/planetScene/orbitals/system";
9-
import StructuresOnPlanet, { AtmosphereStructuresOnPlanet, OrbitalStructuresOnPlanet } from "@/components/Structures/Structures";
9+
import StructuresOnPlanet, {
10+
AtmosphereStructuresOnPlanet,
11+
OrbitalStructuresOnPlanet,
12+
} from "@/components/Structures/Structures";
1013
import AllAutomatonsOnActivePlanet from "@/components/Structures/Auto/AllAutomatons";
1114
import InitialiseChapterOneUser from "@/components/(scenes)/chapters/one/InitialiseUser";
1215
import InventoryPage from "@/components/Inventory/Grid/Grid";
1316
import EnhancedWeatherEventsComponent from "@/components/enhanced-weather-events";
1417
import TopographicMap from "@/components/topographic-map";
1518

1619
const EarthView: React.FC = () => {
17-
return (
20+
return (
1821
<div className="min-h-screen w-full flex flex-col">
19-
<img
20-
className="absolute inset-0 w-full h-full object-cover"
21-
src="/assets/Backdrops/Earth.png"
22-
/>
23-
<div className="relative min-h-screen">
22+
<img
23+
className="absolute inset-0 w-full h-full object-cover"
24+
src="/assets/Backdrops/Earth.png"
25+
/>
26+
<div className="relative min-h-screen">
2427
<EarthStructures />
25-
</div>
28+
</div>
2629
</div>
2730
);
2831
};
2932

3033
export default EarthView;
3134

3235
const EarthStructures: React.FC = () => {
33-
return (
34-
<EarthViewLayout>
35-
<EnhancedWeatherEventsComponent />
36-
{/* <div className="w-full">
36+
return (
37+
<EarthViewLayout>
38+
<EnhancedWeatherEventsComponent />
39+
{/* <div className="w-full">
3740
<div className="py-3">
3841
<div className="py-1">
3942
<PlanetarySystem />
4043
</div>
4144
<center><OrbitalStructuresOnPlanet /></center>
4245
</div>
4346
</div> */}
44-
{/* <TopographicMap /> */}
45-
<div className="w-full">
46-
<div className="py-2">
47-
<center><AtmosphereStructuresOnPlanet /></center>
48-
</div>
49-
</div>
50-
<div className="w-full">
51-
<center>
52-
{/* <InventoryPage /> */}
53-
<StructuresOnPlanet /></center>
54-
</div>
55-
<div className="relative flex-1">
56-
<AllAutomatonsOnActivePlanet />
57-
</div>
58-
</EarthViewLayout>
59-
);
47+
{/* <TopographicMap /> */}
48+
<div className="w-full">
49+
<div className="py-2">
50+
<center>
51+
<AtmosphereStructuresOnPlanet />
52+
</center>
53+
</div>
54+
</div>
55+
<div className="w-full">
56+
<center>
57+
{/* <InventoryPage /> */}
58+
<StructuresOnPlanet />
59+
</center>
60+
</div>
61+
<div className="relative flex-1">
62+
<AllAutomatonsOnActivePlanet />
63+
</div>
64+
</EarthViewLayout>
65+
);
6066
};

app/scenes/earth/scene.tsx

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use client';
2+
3+
import { ReactNode } from "react";
4+
5+
export const EarthScene: React.FC<{
6+
toolbar?: ReactNode;
7+
topSection?: ReactNode;
8+
middleSection?: ReactNode;
9+
bottomSection?: ReactNode;
10+
}> = ({ toolbar, topSection, middleSection, bottomSection }) => {
11+
return (
12+
<div className="relative min-h-screen w-full flex flex-col justify-start">
13+
<img
14+
className="absolute inset-0 w-full h-full object-cover"
15+
src="/assets/Backdrops/Earth.png"
16+
alt="Earth Background"
17+
/>
18+
19+
<div className="relative flex flex-col h-full">
20+
{topSection && <div className="w-full h-[22.5vh]">{topSection}</div>}
21+
22+
<div className="flex w-full h-[55vh] relative">
23+
<div className="w-2/3 h-full mx-auto p-4 overflow-hidden">
24+
{middleSection}
25+
</div>
26+
27+
{toolbar && (
28+
<div className="absolute top-0 right-0 h-full flex flex-col justify-center p-7">
29+
{toolbar}
30+
</div>
31+
)}
32+
</div>
33+
34+
{bottomSection && (
35+
<div className="flex w-full h-[22.5vh]">
36+
<div className="w-2/3 h-full mx-auto p-4 overflow-hidden">
37+
{bottomSection}
38+
</div>
39+
</div>
40+
)}
41+
</div>
42+
</div>
43+
);
44+
};

app/scenes/onboarding/page.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
import { useSupabaseClient, useSession } from "@supabase/auth-helpers-react";
3+
import { EarthScene } from "../earth/scene";
4+
import InitialiseChapterOneUser from "@/components/(scenes)/chapters/one/InitialiseUser";
5+
import InventoryPage from "@/components/Inventory/Grid/Grid";
6+
import EnhancedWeatherEvents from "@/components/enhanced-weather-events";
7+
import { MissionSelectorComponent } from "@/components/mission-selector";
8+
9+
export default function Onboarding () {
10+
return (
11+
<EarthScene
12+
// topSection={<EnhancedWeatherEvents />}
13+
middleSection={<MissionSelectorComponent />}
14+
bottomSection={<InventoryPage />}
15+
/>
16+
);
17+
};

0 commit comments

Comments
 (0)