back to all posts

Build an Restaurant site with Gatsby and Snipcart - 6

by Nabendu Biswas / May 9th, 2020

#javascript #react #gatsby
Series: Gatsby-snipcart

Welcome to part-6 of the series. We will start creating Banner component in this part. This component will show the different text, which is displayed inside each picture for each page.

So, create a new file Banner.js inside the utils folder and put the below content in it. This component is quite similar to the Header component, we had created in previous part. We are taking three props — title, subtitle and children and displaying it by a styled-component BannerWrapper.

We are also having a default props for title, if not passed from the parent component.

Banner.jsBanner.js

Rest of the chapter is exclusive content and will be in my upcoming book Gatsby Cookbook.

Gatsby Cookbook

The book is currently 80% complete and available on leanpub to purchase at this url. So, please show your support and purchase the book or tell it to someone who is interested in developing blazing fast production websites in GatsbyJS.

https://leanpub.com/gatsbycookbook

leanpub

Now, our Menu page will show the menu text.

Menu pageMenu page

This completes part-6 of the series.

You can find the code for the project in this github repo.

Nabendu Biswas