Skip to content

Commit

Permalink
remove buttons behind feature flag (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjun107 authored Apr 5, 2024
1 parent e5a749b commit 4fd561c
Showing 1 changed file with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as analytics from "services/analytics";
import { tenantDetails } from "../../../../helpers/Configuration";
import CategoryButton from "./CategoryButton";
import SwitchViewsButton from "./SwitchViewsButton";
import useFeatureFlag from "hooks/useFeatureFlag";

const ResultsFilters = ({
categoryIds,
Expand All @@ -26,6 +27,7 @@ const ResultsFilters = ({
const { getUserLocation } = useGeolocation();
const locationPermission = useLocationPermission();
const [error, setError] = useState("");
const hasAdvancedFilterFeatureFlag = useFeatureFlag("advancedFilter");

useEffect(() => {
if (error && locationPermission === "granted") {
Expand Down Expand Up @@ -98,31 +100,34 @@ const ResultsFilters = ({
alignItems: "center",
}}
>
<Grid2
container
xs={12}
sm={6}
spacing={1}
justifyContent={{ xs: "center", sm: "flex-start" }}
>
<Grid2 item>
<CategoryButton
icon="pantry"
onClick={togglePantry}
label="Pantries"
isSelected={isPantrySelected}
/>
</Grid2>
<Grid2 item>
<CategoryButton
icon="meal"
onClick={toggleMeal}
label="Meals"
isSelected={isMealsSelected}
style={{ marginLeft: 5 }}
/>
{!hasAdvancedFilterFeatureFlag && (
<Grid2
container
xs={12}
sm={6}
spacing={1}
justifyContent={{ xs: "center", sm: "flex-start" }}
>
<Grid2 item>
<CategoryButton
icon="pantry"
onClick={togglePantry}
label="Pantries"
isSelected={isPantrySelected}
/>
</Grid2>
<Grid2 item>
<CategoryButton
icon="meal"
onClick={toggleMeal}
label="Meals"
isSelected={isMealsSelected}
style={{ marginLeft: 5 }}
/>
</Grid2>
</Grid2>
</Grid2>
)}

<Grid2 xs={12} sm={6}>
<Stack
direction="row"
Expand Down

0 comments on commit 4fd561c

Please sign in to comment.