2023-04-21 16:31:52 +00:00
|
|
|
import { AnnouncementBanner as Banner } from '@vegaprotocol/announcements';
|
2023-03-29 13:20:49 +00:00
|
|
|
import { useEnvironment } from '@vegaprotocol/environment';
|
2023-02-03 10:34:32 +00:00
|
|
|
|
2023-04-21 16:31:52 +00:00
|
|
|
export const AnnouncementBanner = () => {
|
2023-03-29 13:20:49 +00:00
|
|
|
const { ANNOUNCEMENTS_CONFIG_URL } = useEnvironment();
|
2023-02-03 10:34:32 +00:00
|
|
|
// Return an empty div so that the grid layout in _app.page.ts
|
|
|
|
// renders correctly
|
2023-03-29 13:20:49 +00:00
|
|
|
if (!ANNOUNCEMENTS_CONFIG_URL) {
|
2023-07-24 08:37:18 +00:00
|
|
|
return null;
|
2023-02-03 10:34:32 +00:00
|
|
|
}
|
|
|
|
|
2023-04-21 16:31:52 +00:00
|
|
|
return <Banner app="console" configUrl={ANNOUNCEMENTS_CONFIG_URL} />;
|
2023-02-03 10:34:32 +00:00
|
|
|
};
|