Landing Page Revisited

A look at the incorporation of menus in our landing page of the application.

Menus are a clean way of giving the user several navigation options in an application without cluttering up the user interface too much. Material UI has us covered in that department.

About the application

In this application, we now have two separate main views, one for the landing page and one for the list of books.

This is what the application looks like:

Copyright (c) 2020 John Sheehan

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Adding a router and moving the landing page into a separate file

Separating a landing page within the application

Looking at the structure of the application, we currently have two main views:

  • The landing page
  • The book list

We only need to show one of these at a time, independent of one another. So, separating those further is a requirement now because that will make things more simple. Otherwise, they will remain stuck in the same element tree.

Next, let’s have a look at our modified app.py module.

At line 24, the BookList component shows us that all the books in the database are already self-contained. We can apply the same approach for the landing page to make that self-contained. So, at line 23, this will now get separated from the app.py application entrance ...