From a3198f1bab36b97803f1ca0f803a2548f6bbfec4 Mon Sep 17 00:00:00 2001 From: Liam Arbuckle Date: Sat, 24 Feb 2024 17:50:09 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=F0=9F=8E=A7=F0=9F=92=A8=20=E2=86=9D=20Ne?= =?UTF-8?q?w=20page=20component=20if=20user=20hasn't=20finished=20onboardi?= =?UTF-8?q?ng/location.=20[=20SGV2-9=20SGV2-10=20//=20FCDB-3=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/Planets/Sectors/SectorSetup.tsx | 2 +- components/_Core/Section/Navbar.tsx | 2 +- pages/index.tsx | 27 ++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/components/Content/Planets/Sectors/SectorSetup.tsx b/components/Content/Planets/Sectors/SectorSetup.tsx index fb6b8d59..44ad81af 100644 --- a/components/Content/Planets/Sectors/SectorSetup.tsx +++ b/components/Content/Planets/Sectors/SectorSetup.tsx @@ -29,7 +29,7 @@ export default function CreateBasePlanetSector() { } } catch (error) { console.error(error.message); - } + }; }; fetchUserPlanet(); diff --git a/components/_Core/Section/Navbar.tsx b/components/_Core/Section/Navbar.tsx index 7e6ea489..0a51fb9a 100644 --- a/components/_Core/Section/Navbar.tsx +++ b/components/_Core/Section/Navbar.tsx @@ -157,7 +157,7 @@ export const UserDropdownMenu = ({ user } : { user: string }) => { .then((result) => { if (result.data) { setProfile(result.data[0]); - } + }; }); }, [session]); diff --git a/pages/index.tsx b/pages/index.tsx index 8537d299..6b670540 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -37,7 +37,25 @@ export function PublicLanding() { /> ); + // User data config const session = useSession(); + const supabase = useSupabaseClient(); + const [profile, setProfile] = useState(null); + useEffect(() => { + supabase.from("profiles") + .select() + .eq("id", session?.user?.id) + .then((result) => { + if (result.data) { + setProfile(result.data[0]); + }; + }); + }, [session, supabase]); + useEffect(() => { + if (profile) { + console.log(profile.location ?? "Location not available"); + }; + }, [profile]); // Component context const [showFeedOverlay, setShowFeedOverlay] = useState(false); @@ -45,10 +63,17 @@ export function PublicLanding() { setShowFeedOverlay(true); }; + // Screen size parameters const isDesktopOrLaptop = useMediaQuery({ query: '(min-width: 1224px)' }); const isTabletOrMobile = useMediaQuery({ query: '(max-width: 1224px)' }); - if (session) { + if (session && !profile?.location) { + return ( +

Location

+ ); + }; + + if (session && profile?.location) { return ( From ff6028eb8f59b3cd6dabbd824eca1e9580eaaf61 Mon Sep 17 00:00:00 2001 From: Liam Arbuckle Date: Tue, 13 Feb 2024 14:55:41 +0000 Subject: [PATCH 02/28] =?UTF-8?q?=F0=9F=92=87=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=F0=9F=90=AD=20=E2=86=9D=20Some=20deta=20test?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 18436 -> 18436 bytes components/Modals/rover-interface.tsx | 4 ++-- .../Section/BottomBar 2.tsx} | 0 pages/index.tsx | 11 ++++++++++- 4 files changed, 12 insertions(+), 3 deletions(-) rename components/{Core/Section/BottomBar.tsx => _Core/Section/BottomBar 2.tsx} (100%) diff --git a/.DS_Store b/.DS_Store index 3b497b8c7fba6bfe70a08965e2ac67cf54967ff7..47a57e459e9e035bc71fd14c481ecf1f73f3a37e 100644 GIT binary patch delta 294 zcmZpfz}PZ@aYHxzWIYAJ$#d9cCWk8s0BPRMSK04#Ojc18oP1P3nvKDcfq}7Z^D_Zy z_Q|`H1t$whXtFWNg2W~}N|>=Rc7vI<5;|;*Kfx;3OYrkdt^*p$tSUO$O_y)-3!pA$ z)v2OJmS#E%hGxdKIttZ>hNhM}3g)Kfo7bwAvQG}tRRJpHXY8IFrh9hsS3QBrta|*D zo%A+MK4vI5nN?qOayPr+W^H|5#>v~+1t)tNXit71AUL_zKpku=!@S8=1}c-U862Cu gQbKU@T0^PHYYhZ8UpL&si0L_FUru7}v%kp!0P9&>0ssI2 delta 323 zcmZpfz}PZ@aYHxzWGQ{Y$#d9cCR-W^0BPRMSK04#urZ}GFfh!Uyh}iBa*2W9=8pmb z?333R2u>D~&}3t}3YK$}Fk@rh2xitw=uDntD7bl-1Pjk(Jq5wZ%&MZ3-E{dTzfcyO zd|pL#vV>{_r=g{#iH?G?h3VuhBk9e1RMXhmn4Q7eqjcqfs`)1?>ncyK&|N(_R99d! zs~-PkC%sKgodL)FP&^#nFwH{8OA=~ZK2PBI-~|AYeoAb?yU diff --git a/components/Modals/rover-interface.tsx b/components/Modals/rover-interface.tsx index fe84db83..5e84dfa5 100644 --- a/components/Modals/rover-interface.tsx +++ b/components/Modals/rover-interface.tsx @@ -463,8 +463,8 @@ export function RoverInterfaceDark() { - ) -} + ); +}; function AntennaIcon(props) { return ( diff --git a/components/Core/Section/BottomBar.tsx b/components/_Core/Section/BottomBar 2.tsx similarity index 100% rename from components/Core/Section/BottomBar.tsx rename to components/_Core/Section/BottomBar 2.tsx diff --git a/pages/index.tsx b/pages/index.tsx index 6b670540..d6d22da6 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -73,6 +73,15 @@ export function PublicLanding() { ); }; + // if (session?.user?.id === 'cebdc7a2-d8af-45b3-b37f-80f328ff54d6' && isTabletOrMobile) { + // return ( + // + // + //