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.
Is featured banner - Next.js Tutorial
From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Is featured banner
So now we want to add the Is Featured checkbox and the Banner Image Upload. So one thing I want to do before we handle that is in the, let's see, we want to go in the Zod schema. So Lib, Validators. We have the Is Featured and Banner commented out. We just want to uncomment those because now we're going to use them. So just do that, close that up. And then let's go into our Components, Admin, Product form. And then from here, we'll see we're watching the Images field in the form. We want to do the same for Is Featured and Banner. So let's take this and this and change it to Is Featured. Because it's a checkbox, we want to constantly watch it to see if it's checked or not. And then Banner is basically another image field, right? So we want to watch it so that when we select an image, It will show in the banner box like it does here with the images. And then, let's see, the other thing that we're going to want to do is go down to the is featured. I think we have a comment, which is…
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)
Section intro1m 11s
-
(Locked)
Get products for admin page8m 24s
-
(Locked)
Display products7m 55s
-
(Locked)
Delete products4m 16s
-
(Locked)
Create and update actions8m 30s
-
(Locked)
Create product page and form9m 35s
-
(Locked)
Form fields and slugify13m 27s
-
(Locked)
Create product form submission6m 23s
-
(Locked)
Uploadthing configuration8m 9s
-
(Locked)
Add image upload12m 56s
-
(Locked)
Product cleanup7m 57s
-
(Locked)
Is featured banner8m 55s
-
(Locked)
Product update form9m 57s
-
(Locked)
-
-
-
-
-
-