Skip to content

Commit

Permalink
remove eoy 2024 logic
Browse files Browse the repository at this point in the history
  • Loading branch information
parkiino committed Jul 15, 2024
1 parent 0374cc0 commit 7ccc6cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
7 changes: 0 additions & 7 deletions packages/kbn-avc-banner/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import avcBannerBackground from './avc_banner_background.svg';

// Logic to hide banner at EOY 2024
export const useIsStillYear2024 = () => {
const year2025 = new Date('January 01, 2025 00:00:00');
const today = new Date(Date.now());
return today < year2025;
};

export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => {
const { docLinks } = useKibana().services;
const { euiTheme } = useEuiTheme();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { FormattedMessage } from '@kbn/i18n-react';

import { useKibana } from '@kbn/kibana-react-plugin/public';

import { AVCResultsBanner2024, useIsStillYear2024 } from '@kbn/avc-banner';
import { AVCResultsBanner2024 } from '@kbn/avc-banner';

import {
isIntegrationPolicyTemplate,
Expand Down Expand Up @@ -313,7 +313,7 @@ export const OverviewPage: React.FC<Props> = memo(
</SideBar>
<EuiFlexItem grow={9} className="eui-textBreakWord">
{isUnverified && <UnverifiedCallout />}
{useIsStillYear2024 && isElasticDefend && showAVCBanner && (
{isElasticDefend && showAVCBanner && (
<>
<AVCResultsBanner2024 onDismiss={onBannerDismiss} />
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { useCallback, useMemo, useState } from 'react';
import { AVCResultsBanner2024, useIsStillYear2024 } from '@kbn/avc-banner';
import { AVCResultsBanner2024 } from '@kbn/avc-banner';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';

import { TogglePanel } from './toggle_panel';
Expand Down Expand Up @@ -78,7 +78,7 @@ export const OnboardingComponent: React.FC<OnboardingProps> = ({

return (
<div className={wrapperStyles}>
{useIsStillYear2024() && showAVCBanner && (
{showAVCBanner && (
<KibanaPageTemplate.Section paddingSize="none" className={bannerStyles}>
<AVCResultsBanner2024 onDismiss={onBannerDismiss} />
</KibanaPageTemplate.Section>
Expand Down

0 comments on commit 7ccc6cb

Please sign in to comment.