Adding a details view

The details view is shown when the user scans a code or clicks on an item in the recent scans list. It shows the content of the scan and the date, as shown in the following screenshot:

Adding a details view

If the content of the scan is a URL, we will show a button to open that link, as shown in the following screenshot:

Adding a details view

At the end of this chapter, we will style this page properly.

We add a function to src/model.ts that will return true when the scan (probably) contains a URL. We consider a scan that contains no spaces and begins with http:// or ...

Get TypeScript: Modern JavaScript Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.