From f4daa246dac41527da25409392854c544be80aa2 Mon Sep 17 00:00:00 2001 From: Salym Akhmedov Date: Mon, 8 Feb 2021 20:16:42 -0700 Subject: [PATCH] optional chaining operator Added optional chaining operator for all queries --- src/components/about.js | 2 +- src/components/call-to-action.js | 2 +- src/components/car-tint.js | 7 ++++++- src/components/carbon-price.js | 2 +- src/components/carbon-tint.js | 2 +- src/components/carbon-vs-ceramic.js | 2 +- src/components/ceramic-price .js | 2 +- src/components/ceramic-tint.js | 7 ++++++- src/components/contact.js | 2 +- src/components/faq.js | 2 +- src/components/footer.js | 2 +- src/components/header.js | 2 +- src/components/hero.js | 2 +- src/components/pricing.js | 2 +- src/components/reviews.js | 2 +- src/components/seo.js | 2 +- src/components/services.js | 2 +- 17 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/components/about.js b/src/components/about.js index 41c87cd..1f7529d 100644 --- a/src/components/about.js +++ b/src/components/about.js @@ -26,7 +26,7 @@ const About = () => { } `); - const { to, description, image } = data.wpPage.sections.about; + const { to, description, image } = data.wpPage.sections?.about; return (
diff --git a/src/components/call-to-action.js b/src/components/call-to-action.js index 12976ca..907b91c 100644 --- a/src/components/call-to-action.js +++ b/src/components/call-to-action.js @@ -36,7 +36,7 @@ const CallToAction = () => { subheadline, ctaButton, image, - } = data.wpPage.sections.callToAction; + } = data.wpPage.sections?.callToAction; return (