Final Touches

In this lesson, we're going to give final touches to our application

Before publishing our application, there are a few changes I would like to make to our application. These changes might improve functionality or the aesthetics of our application.

If we open the browser, our application says React app instead of our app name, so let's go to index.html and replace React app with Learnify. Now let's restart the server and it will say, Learnify.

If we open the description page, I noticed that our book now button is not doing anything. So let's create a function which will say bookNow. This button will accept the course id of type string. Now when the user clicks on this button, we want to add this course to the basket, if it doesn't exist already, and directly go to the checkout button. So we can dispatch addBasketItemAsync function and pass id as the course id. After that, we will use history to push the user to the checkout page. So let's import history as useHisory and push the user to the checkout page. Let's now pass this function as an onClick event to the book now button and pass the course dot id.




Start a new discussion. All notification go to the author.