Skip to content

Commit

Permalink
fix: DAH-3176 hide directory 1.5 change (#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
tallulahkay authored Jan 21, 2025
1 parent 38f1cda commit 6d35c4d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
25 changes: 17 additions & 8 deletions app/javascript/modules/listings/DirectoryHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,12 @@ export const getListingGroup = (
hasFiltersSet?: boolean,
subtitle?: string,
icon?: IconTypes,
isOpen?: boolean
isOpen?: boolean,
newDirectoryEnabled?: boolean
) => {
const showListingsGroup = section !== DIRECTORY_SECTION_ADDITIONAL_LISTINGS || listings.length > 0
const showListingsGroup =
(newDirectoryEnabled && section !== DIRECTORY_SECTION_ADDITIONAL_LISTINGS) ||
listings.length > 0
return (
showListingsGroup && (
<ListingsGroup
Expand Down Expand Up @@ -357,7 +360,8 @@ export const upcomingLotteriesView = (
directoryType,
stackedDataFxn: StackedDataFxnType,
observerRef: React.MutableRefObject<null | IntersectionObserver>,
isOpen: boolean
isOpen: boolean,
newDirectoryEnabled?: boolean
) => {
return getListingGroup(
listings,
Expand All @@ -372,7 +376,8 @@ export const upcomingLotteriesView = (
undefined,
t("listings.upcomingLotteries.subtitle"),
null,
isOpen
isOpen,
newDirectoryEnabled
)
}

Expand All @@ -381,7 +386,8 @@ export const lotteryResultsView = (
directoryType,
stackedDataFxn: StackedDataFxnType,
observerRef: React.MutableRefObject<null | IntersectionObserver>,
isOpen?: boolean
isOpen?: boolean,
newDirectoryEnabled?: boolean
) => {
return getListingGroup(
listings,
Expand All @@ -396,7 +402,8 @@ export const lotteryResultsView = (
undefined,
t("listings.lotteryResults.subtitle"),
"result",
isOpen
isOpen,
newDirectoryEnabled
)
}

Expand All @@ -406,7 +413,8 @@ export const additionalView = (
stackedDataFxn: StackedDataFxnType,
observerRef: React.MutableRefObject<null | IntersectionObserver>,
filtersSet?: boolean,
isOpen?: boolean
isOpen?: boolean,
newDirectoryEnabled?: boolean
) => {
return getListingGroup(
listings,
Expand All @@ -421,7 +429,8 @@ export const additionalView = (
filtersSet,
t("listings.additional.subtitle"),
"doubleHouse",
isOpen
isOpen,
newDirectoryEnabled
)
}

Expand Down
9 changes: 6 additions & 3 deletions app/javascript/modules/listings/GenericDirectory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,24 @@ export const GenericDirectory = (props: RentalDirectoryProps) => {
props.getSummaryTable,
observerRef,
hasFiltersSet,
additionalIsOpen
additionalIsOpen,
newDirectoryEnabled
)}
{upcomingLotteriesView(
listings.upcoming,
props.directoryType,
props.getSummaryTable,
observerRef,
upcomingIsOpen
upcomingIsOpen,
newDirectoryEnabled
)}
{lotteryResultsView(
listings.results,
props.directoryType,
props.getSummaryTable,
observerRef,
resultsIsOpen
resultsIsOpen,
newDirectoryEnabled
)}
</div>
</>
Expand Down

0 comments on commit 6d35c4d

Please sign in to comment.