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.
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
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!