mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
* Progress * Progress * Things are working * More tweaks * Fixing unit test * Tweaks and fixing e2e tests * Remove ... in Save as * Fixing unit test * Fixing e2e test * Fixes Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
22 lines
593 B
TypeScript
22 lines
593 B
TypeScript
import React, { useEffect } from 'react';
|
|
|
|
import { useGrafana } from 'app/core/context/GrafanaContext';
|
|
|
|
export interface AppChromeUpdateProps {
|
|
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>(({ actions }: AppChromeUpdateProps) => {
|
|
const { chrome } = useGrafana();
|
|
|
|
useEffect(() => {
|
|
chrome.update({ actions });
|
|
});
|
|
return null;
|
|
});
|
|
|
|
AppChromeUpdate.displayName = 'TopNavUpdate';
|