Skip to content

Commit

Permalink
Merge pull request #308 from prezly/feature/mt-5280-implement-banner-…
Browse files Browse the repository at this point in the history
…on-preview-newsrooms

[MT-5280] Feature - Implement banner on preview newsrooms
  • Loading branch information
e1himself authored Aug 11, 2022
2 parents a7ea230 + 64e4dcc commit ee83109
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
7 changes: 5 additions & 2 deletions modules/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Analytics, useAnalyticsContext } from '@prezly/analytics-nextjs';
import { PageSeo, useNewsroom, useNewsroomContext } from '@prezly/theme-kit-nextjs';
import { LoadingBar, ScrollToTopButton } from '@prezly/themes-ui-components';
import { LoadingBar, NotificationsBar, ScrollToTopButton } from '@prezly/themes-ui-components';
import dynamic from 'next/dynamic';
import { Router } from 'next/router';
import type { PropsWithChildren } from 'react';
Expand Down Expand Up @@ -29,13 +29,14 @@ const CookieConsentBar = dynamic(() => import('./CookieConsentBar'), {
function Layout({ children, description, imageUrl, title, hasError }: PropsWithChildren<Props>) {
const [isLoadingPage, setIsLoadingPage] = useState(false);
const newsroom = useNewsroom();
const { contacts } = useNewsroomContext();
const { contacts, notifications } = useNewsroomContext();
const { isEnabled: isAnalyticsEnabled } = useAnalyticsContext();

useEffect(() => {
function onRouteChangeStart() {
setIsLoadingPage(true);
}

function routeChangeComplete() {
setIsLoadingPage(false);
}
Expand All @@ -59,6 +60,7 @@ function Layout({ children, description, imageUrl, title, hasError }: PropsWithC
noindex={!isAnalyticsEnabled}
nofollow={!isAnalyticsEnabled}
/>
<NotificationsBar notifications={notifications} />
<CookieConsentBar />
<div className={styles.layout}>
<Header hasError={hasError} />
Expand All @@ -75,4 +77,5 @@ function Layout({ children, description, imageUrl, title, hasError }: PropsWithC
</>
);
}

export default Layout;
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@prezly/story-content-format": "0.56.2",
"@prezly/theme-kit-nextjs": "1.17.0",
"@prezly/themes-intl-messages": "1.15.0",
"@prezly/themes-ui-components": "0.6.1",
"@prezly/themes-ui-components": "0.7.0",
"@prezly/uploadcare": "2.3.4",
"@prezly/uploadcare-image": "0.3.1",
"@react-hookz/web": "14.7.1",
Expand Down

3 comments on commit ee83109

@vercel
Copy link

@vercel vercel bot commented on ee83109 Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ee83109 Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ee83109 Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.