From 52b32a56e1f54050f26b087ef7c49f0cdadcaf8e Mon Sep 17 00:00:00 2001 From: cade-exygy <131277283+cade-exygy@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:55:00 -0500 Subject: [PATCH] fix: FCFS apply button behind flag (#2351) --- .../ListingDetailsApply.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx b/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx index 97076baa10..5f7fc96b77 100644 --- a/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx +++ b/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx @@ -21,6 +21,7 @@ import { } from "../../util/listingUtil" import { getSfGovUrl, renderInlineMarkup } from "../../util/languageUtil" import "./ListingDetailsApply.scss" +import { useFeatureFlag } from "../../hooks/useFeatureFlag" export interface ListingDetailsApplyProps { listing: RailsListing @@ -142,22 +143,25 @@ export const ListingDetailsApply = ({ listing }: ListingDetailsApplyProps) => { const isFcfsBmrSales = isFcfsListing(listing) const isFcfsApplicationClosed = !listing.Accepting_Online_Applications + const { unleashFlag: isSalesFcfsEnabled } = useFeatureFlag("FCFS", false) + if (isFcfsBmrSales ? isFcfsApplicationClosed : !isOpen(listing)) return null const isListingRental = isRental(listing) const acceptingPaperApps = acceptingPaperApplications(listing) - const howToApplyBlock = isFcfsBmrSales ? ( - - ) : ( - - ) + const howToApplyBlock = + isSalesFcfsEnabled && isFcfsBmrSales ? ( + + ) : ( + + ) const submitPaperApplicationBlocks = ( <>