From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Creating add product page - Next.js Tutorial
From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance
Creating add product page
In this lecture, we will create a page to add products. So in the products folder, let me create a folder named add and inside it, I will create a page JSX file. Let's create the component, add product and we'll return the JSX add products page. Let's save this file inside the screens folder, I will navigate to the products folder, then Then I will create an add folder and it will have the index.js file inside the component file. I will write const add products return h1 add products and let me also export this component. Now let's go to the page.jsx file and import the add products component from the screens folder. Here we need search params to display the error message, just like we used in adding users. So, I will destructure search params prop by saying search params. Then I will use the add products component and I will pass search params as props by saying search params is equal to search params in curly brackets. Since we are using the same UI interface as ad users, I navigate…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introduction2m 36s
-
(Locked)
Project creation2m 41s
-
(Locked)
Creating sidebar component3m 34s
-
(Locked)
Working on sidebar3m 46s
-
(Locked)
Combining utility classes with @apply3m 54s
-
(Locked)
RQ: @layer and @apply—combining utility classes1m 37s
-
(Locked)
Styling the sidebar4m 56s
-
(Locked)
Adding icons to the sidebar3m 3s
-
(Locked)
Creating users page5m 43s
-
(Locked)
Creating add users form7m 8s
-
(Locked)
Implementing component-based architecture6m 34s
-
(Locked)
Creating button and input components4m 16s
-
(Locked)
Refactoring code structure2m 40s
-
(Locked)
Database creation2m 30s
-
(Locked)
Adding users with server action4m
-
(Locked)
Implementing hashing3m 19s
-
(Locked)
RQ: Implementing hashing2m 4s
-
(Locked)
Validating user creation3m 44s
-
(Locked)
Rendering users in the table5m 44s
-
(Locked)
Creating edit user page3m 33s
-
(Locked)
Dynamic default values for edit2m 45s
-
(Locked)
Updating user data3m 43s
-
(Locked)
Deleting user3m 41s
-
(Locked)
Creating delete confirmation popup4m 17s
-
(Locked)
Enabling confirmation popup5m 32s
-
(Locked)
Deleting user by confirmation popup2m 24s
-
(Locked)
Creating product type page4m 39s
-
(Locked)
Creating add product type page3m 36s
-
(Locked)
Adding product types and products models into the schema3m 37s
-
(Locked)
RQ: Adding models in the schema—product type and product1m 6s
-
(Locked)
Adding product type using server action4m 26s
-
(Locked)
Rendering product types into the table2m
-
(Locked)
Creating edit product type page3m 19s
-
(Locked)
Dynamic default values for product type2m 33s
-
(Locked)
Updating product type with server action2m 39s
-
(Locked)
Deleting product type with server action1m 50s
-
(Locked)
Creating products page3m 46s
-
(Locked)
Creating products interface for listing4m 50s
-
(Locked)
Creating add product page2m 57s
-
(Locked)
Completing add products form2m 55s
-
(Locked)
Creating switch component5m 10s
-
(Locked)
Creating file input component6m 17s
-
(Locked)
Rendering dynamic product types data in add product page2m 12s
-
(Locked)
Creating server action for adding products3m 4s
-
(Locked)
Implementing image storage functionality5m 53s
-
(Locked)
Completing add product functionality4m 13s
-
(Locked)
Rendering dynamic data in products table3m 53s
-
(Locked)
Creating edit product page3m 13s
-
(Locked)
Dynamic default values for product3m 44s
-
(Locked)
Render default values in switch and file input2m 39s
-
(Locked)
Updating product with server action5m 14s
-
(Locked)
RQ: Updating product with server action1m 39s
-
(Locked)
Deleting product with server action2m 3s
-
(Locked)
-
-
-
-
-