Skip to content

Commit

Permalink
fix: FCFS apply button behind flag (#2351)
Browse files Browse the repository at this point in the history
  • Loading branch information
cade-exygy authored and cliu02 committed Oct 10, 2024
1 parent 141e4ff commit 52b32a5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ? (
<FcfsBmrSalesHowToApply />
) : (
<StandardHowToApply
listingId={listing.listingID}
isListingRental={isListingRental}
isHabitatListing={isHabitatListing(listing)}
acceptingPaperApps={acceptingPaperApps}
/>
)
const howToApplyBlock =
isSalesFcfsEnabled && isFcfsBmrSales ? (
<FcfsBmrSalesHowToApply />
) : (
<StandardHowToApply
listingId={listing.listingID}
isListingRental={isListingRental}
isHabitatListing={isHabitatListing(listing)}
acceptingPaperApps={acceptingPaperApps}
/>
)

const submitPaperApplicationBlocks = (
<>
Expand Down

0 comments on commit 52b32a5

Please sign in to comment.