From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

User layout and menu

User layout and menu

Okay, so we're able to log in and purchase products using PayPal. Now I want the user to be able to see their orders. So we'll have a page like this where it shows all the orders. Now before we can do that, I'm going to create a separate layout for user pages, which in our case is going to be orders and the profile page. And that layout will consist of, you know, this top bar right here with the user menu. Okay. So we're going to have to create a new folder because we want this to go to slash user slash orders and slash user slash profile. So in the app folder, we'll create a folder called user. Not with parentheses because that would be just a group and it wouldn't integrate the URL. And we do want to integrate the URL. We also wanted to have a separate layout. So we'll create a new file called layout TSX. So any page in this user folder will use that layout. And then we'll just copy the root layout TSX for now, just grab that, paste that in the user layout, we'll get rid of the…

Contents