diff --git a/components/agility-common/PreviewBar.js b/components/agility-common/PreviewBar.js index 9c504059c..cbe0e3cf0 100644 --- a/components/agility-common/PreviewBar.js +++ b/components/agility-common/PreviewBar.js @@ -82,7 +82,7 @@ const PreviewBar = ({ isPreview, isDevelopmentMode }) => {
Loading page...
- } - - if (notFound === true) { - return - } - - const AgilityPageTemplate = dynamic(() => import('components/agility-pageTemplates/' + props.pageTemplateName)); - - if (dynamicPageItem?.seo?.metaDescription) { - page.seo.metaDescription = dynamicPageItem.seo.metaDescription - } - - return ( - <> - - {sitemapNode?.title} - Agility CMS Sample Blog - - - - - {dynamicPageItem?.seo?.ogImage && - - } - - - - - - - {/* */} - - - - {/* */} - - - - ) -} - -export default Layout diff --git a/components/agility-global/PreviewBar.js b/components/agility-global/PreviewBar.js deleted file mode 100644 index 3ec25f1db..000000000 --- a/components/agility-global/PreviewBar.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; - -const PreviewBar = ({ isPreview, isDevelopmentMode }) => { - - if (isPreview && !isDevelopmentMode) { - return ( -
- Powered by Agility CMS - You are viewing the latest changes in Preview Mode. -
- - -
-
- ) - } else if(isDevelopmentMode) { - return ( -
- Powered by Agility CMS - You are viewing the latest changes in Development Mode. -
-
- ) - } else { - return null - } -} - -const exitPreview = () => { - const exit = confirm("Would you like to exit Preview Mode?"); - if (exit === true) { - window.location = `/api/exitPreview?slug=${window.location.pathname}`; - } -} - -const getPreviewLink = () => { - const xhr = new XMLHttpRequest(); - xhr.onload = function () { - - // Process our return data - if (xhr.status >= 200 && xhr.status < 300) { - // What do when the request is successful - - const previewKey = xhr.responseText; - const previewLink = `${window.location.pathname}?agilitypreviewkey=${escape(previewKey)}`; - - prompt("To share this page in preview mode with others, copy the link below:", previewLink); - - } else { - // What do when the request fails - alert('Could not generate Preview Link. This indicates a problem with the API route that generates a Preview Link.') - } - }; - - // Create and send a GET request - xhr.open('GET', '/api/generatePreviewKey'); - xhr.send(); -} - -export default PreviewBar; \ No newline at end of file