1. 4
    Create a Application Layout in Next.js and Cart Page
    1m 11s

Create a Application Layout in Next.js and Cart Page

Shadid Haque
InstructorShadid Haque
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated 2 years ago

Our application code is still pretty bare at this point. For a shop application, we'll want a consistent Nav bar. We'll wrap that Nav around our existing code in _app.js to have a consistent nav across all pages.

In this lesson, I paste in the presentational code with all the Tailwind pre-written. This course isn't about crafting UIs so we skim past this part, I encourage you to dig around the Nav component if you want to see how I did that.

Shadid Haque: [0:00] Let's create a new navbar for our application. I'm going to create a new folder called components. Inside components, I'm going to create a new file called Nav.tsx. In this file, we're going to add some pre-written code for the navbar. The focus of this course is not CSS. That's why we added these pre-written components.

[0:21] Let's go ahead and add this Nav Component to our _app.tsx file. This way, the navbar will appear in every pages. We have not created the cart page yet. That's why we're seeing this, "404. This page could not be found."

[0:46] Let's go ahead and create a cart page to view our cart. Under pages directory, we create a new file called cart.tsx. Here we add a simple React component with some text.

egghead
egghead
~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today