mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* First stab at new page layouts behind feature toggle * Simplifying PageHeader * Progress on a new model that can more easily support new and old page layouts * Progress * rename folder * Progress * Minor change * fixes * Fixing tests * Make breadcrumbs work * Add tests for old Page component * Adding tests for new Page component and behavior * fixing page header test * Fixed test * AppChrome outside route * Renaming folder * Minor fix * Updated * Fixing StoragePage * Fix for banners Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
23 lines
651 B
TypeScript
23 lines
651 B
TypeScript
import React, { useEffect } from 'react';
|
|
|
|
import { NavModelItem } from '@grafana/data';
|
|
|
|
import { appChromeService } from './AppChromeService';
|
|
|
|
export interface AppChromeUpdateProps {
|
|
pageNav?: NavModelItem;
|
|
actions?: React.ReactNode;
|
|
}
|
|
/**
|
|
* This needs to be moved to @grafana/ui or runtime.
|
|
* This is the way core pages and plugins update the breadcrumbs and page toolbar actions
|
|
*/
|
|
export const AppChromeUpdate = React.memo<AppChromeUpdateProps>(({ pageNav, actions }: AppChromeUpdateProps) => {
|
|
useEffect(() => {
|
|
appChromeService.update({ pageNav, actions });
|
|
});
|
|
return null;
|
|
});
|
|
|
|
AppChromeUpdate.displayName = 'TopNavUpdate';
|