make a top menu bar in all of the pages showing the aerolog logo with name on the left side, and Pages like 2d map - /map 3D Map - /3dmap log a flight - /log-flight and achivements - /achievements. make it like a top menu bar where when one page it selected it is shown as selectd on the top, make it done for all the pages
Now let me create a NavBar component and add it to the layout so it appears on all pages:
Now let me update the layout to include the NavBar:
Created a responsive NavBar component with the AeroLog logo on the left and navigation links (Home, 2D Map, 3D Map, Log Flight, Achievements) that highlight the active page. Added it to the root layout so it appears on all pages with a fixed position at the top. The navbar includes a hamburger menu for mobile devices and is hidden on login/register pages. All page content now has top padding to account for the fixed navbar height.
ok so flights of users are not showing up on the map, create table public.flights (
id bigint generated by default as identity not null,
username text not null,
departure_icao text not null,
arrival_icao text not null,
aircraft text not null,
flight_date timestamp without time zone not null,
source text not null default 'manual'::text,
user_id uuid not null,
constraint flights_pkey primary key (id)
) TABLESPACE pg_default;
Here is the table schema make sure it works, it is used in /map and /3dmap and basically everywhere else in the app
I can see the issue. The map pages are querying flights using .eq("user_id", uid) but according to the schema, user_id is a UUID. However, the code is storing aeroLogUserId in localStorage. Let me check how the login stores the user ID:
I found the issue. The login page only stores aeroLogUsername but does NOT store aeroLogUserId. The login query only selects username - it needs to also select the id field and store it in localStorage. Let me fix the login page:
Now let me also check the register page to ensure it stores the user_id as well:
The register page also needs to store the user_id. Let me fix it:
Fixed both the login and register pages to store aeroLogUserId in localStorage. The login page now selects both id and username from the users table, and the register page also stores the newly created user's id. This ensures the map pages can properly query flights using user_id to display the user's flights.