Skip to content

Commit

Permalink
Make ReleaseStageBadge show free tag based on prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ambirdsall committed Jan 19, 2023
1 parent 24cdf53 commit f876995
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { GAIcon } from "components/icons/GAIcon";
import { Tooltip } from "components/ui/Tooltip";

import { ReleaseStage } from "core/request/AirbyteClient";
import { useFreeConnectorProgram } from "packages/cloud/components/experiments/FreeConnectorProgram/hooks/useFreeConnectorProgram";

import styles from "./ReleaseStageBadge.module.scss";

Expand All @@ -16,15 +15,17 @@ interface ReleaseStageBadgeProps {
* Whether to show a detailed message via a tooltip. If not specified, will be {@code true}.
*/
tooltip?: boolean;
showFreeTag?: boolean;
}

export const ReleaseStageBadge: React.FC<ReleaseStageBadgeProps> = ({ stage, small, tooltip = true }) => {
const { data: freeConnectorProgramInfo } = useFreeConnectorProgram();
const showFreeConnectorUi = Boolean(freeConnectorProgramInfo?.isEnrolled);
export const ReleaseStageBadge: React.FC<ReleaseStageBadgeProps> = ({
stage,
small,
tooltip = true,
showFreeTag = false,
}) => {
const { formatMessage } = useIntl();

const showFreeTag = showFreeConnectorUi && (stage === "alpha" || stage === "beta");

if (!stage || stage === ReleaseStage.custom) {
return null;
}
Expand Down

0 comments on commit f876995

Please sign in to comment.