From 2c52850d63e0be4120b86424c7e821b271808705 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Thu, 1 Feb 2018 09:28:52 +1000 Subject: [PATCH] Add Schema Component --- src/components/Schema.js | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/components/Schema.js diff --git a/src/components/Schema.js b/src/components/Schema.js new file mode 100644 index 0000000..d50c13a --- /dev/null +++ b/src/components/Schema.js @@ -0,0 +1,48 @@ +import React from 'react' +import PropTypes from 'prop-types' + +const Schema = ({ + name, + address, + email, + phone: telephone, + url, + logoUrl, + type, + openingHours +}) => { + // see http://schema.org/docs/schemas.html + + const data = { + '@context': 'http://schema.org/', + '@type': type, + address: { + '@type': 'PostalAddress', + streetAddress: address + }, + name, + email, + telephone, + url, + openingHours + } + + return ( +