Skip to content

Commit

Permalink
Update banner.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehoops-cz committed Oct 16, 2023
1 parent db026af commit d335d81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
import { useSelector } from "react-redux";
import { selectCurrentPathogen } from "src/common/redux/selectors";
import { B } from "src/common/styles/basicStyle";
import { SplitPathogenWrapper } from "src/components/Split/SplitPathogenWrapper";
import { PATHOGEN_FEATURE_FLAGS } from "src/components/Split/types";
import { USER_FEATURE_FLAGS } from "src/components/Split/types";
import { StyledBanner, StyledNewTabLink } from "./style";
import { useTreatments } from "@splitsoftware/splitio-react";
import { isUserFlagOn } from "src/components/Split";

// Note: this was previously for privacy policy announcements
// It was pretty convenient to reuse - maybe we want to keep
// it around for one-off banners.

// Show Banner on Covid pages to let the user know that we
// are currently unable to ingest GISAID data
// Show Banner to let users know we are sunsetting the app
export const Announcements = (): JSX.Element => {
const pathogen = useSelector(selectCurrentPathogen);
const flag = useTreatments([USER_FEATURE_FLAGS.sunset_banner]);

const shouldShowSunsetBanner = isUserFlagOn(
flag,
USER_FEATURE_FLAGS.sunset_banner
);

return (
<>
<SplitPathogenWrapper
pathogen={pathogen}
feature={PATHOGEN_FEATURE_FLAGS.show_gisaid_ingestion_banner}
>
{shouldShowSunsetBanner && (
<StyledBanner sdsType="primary">
<B>
As of 4/13/23, we have switched from using GISAID for phylo tree
focal and contextual samples to using GenBank.&nbsp;
</B>
<StyledNewTabLink
href={
"https://help.czgenepi.org/hc/en-us/articles/14696829683860-GISAID-to-GenBank-Transition"
}
>
Learn more
<B>CZ GEN EPI will shut down on March 7, 2024. Click&nbsp;</B>
<StyledNewTabLink href={"https://help.czgenepi.org/hc/en-us"}>
here
</StyledNewTabLink>
<B>&nbsp;to learn more.</B>
</StyledBanner>
</SplitPathogenWrapper>
)}
</>
);
};
1 change: 1 addition & 0 deletions src/frontend/src/components/Split/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum USER_FEATURE_FLAGS {
// my_flag_name = "my_flag_name", (<-- format example)
internal_user = "internal_user",
multi_pathogen = "multi_pathogen",
sunset_banner = "sunset_banner",
}

/**
Expand Down

0 comments on commit d335d81

Please sign in to comment.