Skip to content

Commit

Permalink
Merge pull request #5034 from google/bug/4983-zero-state-entity-dashb…
Browse files Browse the repository at this point in the history
…oard-notifications

Bug/4983 - Display zero data states notifications in the entity dashboard
  • Loading branch information
tofumatt authored Apr 6, 2022
2 parents 74bf720 + 21e6fbc commit f97bace
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/js/components/DashboardEntityApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import PageHeader from './PageHeader';
import Layout from './layout/Layout';
import { CORE_WIDGETS } from '../googlesitekit/widgets/datastore/constants';
import ScrollEffect from './ScrollEffect';
import EntityBannerNotifications from './notifications/EntityBannerNotifications';
const { useSelect } = Data;

function DashboardEntityApp() {
Expand Down Expand Up @@ -179,7 +180,7 @@ function DashboardEntityApp() {
return (
<Fragment>
<ScrollEffect />
<Header showNavigation>
<Header subHeader={ <EntityBannerNotifications /> } showNavigation>
<EntitySearchInput />
<DateRangeSelector />
<HelpMenu />
Expand Down
29 changes: 29 additions & 0 deletions assets/js/components/notifications/EntityBannerNotifications.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* EntityBannerNotifications component.
*
* Site Kit by Google, Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Internal dependencies
*/
import { useFeature } from '../../hooks/useFeature';
import ZeroDataStateNotifications from './ZeroDataStateNotifications';

export default function EntityBannerNotifications() {
const zeroDataStatesEnabled = useFeature( 'zeroDataStates' );

return zeroDataStatesEnabled && <ZeroDataStateNotifications />;
}

0 comments on commit f97bace

Please sign in to comment.