Skip to content

Commit f2eb19d

Browse files
Merge origin/develop into migrate-MUI
Resolve conflicts in ResultsFilters and ResultsMap by combining the widen-address-bar layout from develop with MUI v7 Grid/Box migrations. Co-authored-by: Cursor <cursoragent@cursor.com>
2 parents 59bb73d + 7cc41a3 commit f2eb19d

5 files changed

Lines changed: 31 additions & 53 deletions

File tree

client/src/components/FoodSeeker/AddressDropDown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export default function AddressDropDown({ autoFocus }: AddressDropDownProps) {
298298
return options;
299299
}}
300300
sx={{
301-
width: 600,
301+
width: "100%",
302302
backgroundColor: "#F0F0F0",
303303
"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline": {
304304
borderColor: "white",

client/src/components/FoodSeeker/SearchResults/ResultsFilters/ResultsFilters.tsx

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import AddressDropDown from "components/FoodSeeker/AddressDropDown";
44
import SwitchViewsButton from "./SwitchViewsButton";
55
import { TENANT_CONFIG } from "../../../../helpers/Constants";
66
import Geolocate from "./Geolocate";
7-
import useBreakpoints from "hooks/useBreakpoints";
87

98
interface ResultsFiltersProps {
109
showList: boolean;
@@ -16,7 +15,6 @@ const ResultsFilters: FC<ResultsFiltersProps> = ({
1615
toggleShowList,
1716
}) => {
1817
const { taglineText } = TENANT_CONFIG;
19-
const { isMobile } = useBreakpoints();
2018

2119
return (
2220
<Grid
@@ -30,7 +28,7 @@ const ResultsFilters: FC<ResultsFiltersProps> = ({
3028
>
3129
<Grid
3230
display={{ xs: "none", sm: "block" }}
33-
size={{ sm: 4 }}
31+
size={{ sm: "auto" }}
3432
sx={{
3533
paddingLeft: "1rem",
3634
}}
@@ -50,10 +48,9 @@ const ResultsFilters: FC<ResultsFiltersProps> = ({
5048

5149
<Grid
5250
container
53-
size={{ xs: 12, sm: 8 }}
51+
size={{ xs: 12, sm: "grow" }}
5452
justifyContent="center"
5553
alignItems="center"
56-
wrap="wrap-reverse"
5754
>
5855
<Stack
5956
direction={{ xs: "column-reverse", sm: "row" }}
@@ -63,32 +60,32 @@ const ResultsFilters: FC<ResultsFiltersProps> = ({
6360
alignItems: "center",
6461
}}
6562
>
66-
<Grid size={{ xs: 12, sm: 6 }}>
67-
<Stack
68-
direction="row"
63+
<Stack
64+
direction="row"
65+
alignItems="center"
66+
sx={{
67+
gap: "0.5rem",
68+
px: "1rem",
69+
boxSizing: "border-box",
70+
width: "100%",
71+
}}
72+
>
73+
<Box sx={{ flex: 1, minWidth: 0 }}>
74+
<AddressDropDown autoFocus={false} />
75+
</Box>
76+
77+
<Box
78+
display={{ xs: "flex", sm: "none" }}
6979
alignItems="center"
70-
sx={{
71-
marginX: "1rem",
72-
maxWidth: "99vw",
73-
gap: "0.5rem",
74-
}}
80+
gap="0.5rem"
7581
>
76-
<AddressDropDown autoFocus={false} />
77-
{isMobile && <Geolocate />}
78-
<Box
79-
sx={{
80-
maxWidth: "48px",
81-
boxSizing: "border-box",
82-
}}
83-
display={{ xs: "block", sm: "none" }}
84-
>
85-
<SwitchViewsButton
86-
isListView={showList}
87-
onClick={toggleShowList}
88-
/>
89-
</Box>
90-
</Stack>
91-
</Grid>
82+
<Geolocate />
83+
<SwitchViewsButton
84+
isListView={showList}
85+
onClick={toggleShowList}
86+
/>
87+
</Box>
88+
</Stack>
9289
</Stack>
9390
</Grid>
9491
</Grid>

client/src/components/FoodSeeker/SearchResults/ResultsMap/ResultsMap.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import RemoveIcon from "@mui/icons-material/RemoveRounded";
1515
import { MAPBOX_STYLE } from "constants/map";
1616
import { MAPBOX_ACCESS_TOKEN, DEFAULT_VIEWPORT } from "helpers/Constants";
1717
import useBreakpoints from "hooks/useBreakpoints";
18-
import useFeatureFlag from "hooks/useFeatureFlag";
1918
import "mapbox-gl/dist/mapbox-gl.css";
2019
import Map, { Layer, Marker, Source } from "react-map-gl";
2120
import { useLocation, useNavigate } from "react-router-dom";
@@ -110,7 +109,6 @@ const ResultsMap = ({
110109
const neighborhood = useNeighborhood() as { geojson?: any } | null;
111110
const regionGeoJSON = neighborhood?.geojson;
112111
const startIconCoordinates = searchCoordinates || userCoordinates;
113-
const hasAdvancedFilterFeatureFlag = useFeatureFlag("advancedFilter");
114112

115113
const onMouseEnter = useCallback(() => setCursor("pointer"), []);
116114
const onMouseLeave = useCallback(() => setCursor("auto"), []);
@@ -461,7 +459,8 @@ const ResultsMap = ({
461459
</Source>
462460
)}
463461
</Map>
464-
{!loading && hasAdvancedFilterFeatureFlag && (
462+
463+
{!loading && (
465464
<Box
466465
position="absolute"
467466
display="inline-flex"

client/src/components/FoodSeeker/SearchResults/SearchResults.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,6 @@ const SearchResults = () => {
116116
}
117117
}, [positionDraggable]);
118118

119-
// USE EFFECT BASED ON THIS FUNCTION IN Mobile.js
120-
// const handleStop = (e, ui) => {
121-
// const windowHeight = window.innerHeight / 100;
122-
// let newY;
123-
// if (ui.y < 20 * windowHeight) {
124-
// newY = hasAdvancedFilterFeatureFlag ? (100 / window.innerHeight) * 60 : 0;
125-
// } else if (ui.y > 20 * windowHeight && ui.y < 40 * windowHeight) {
126-
// newY = 17;
127-
// } else if (ui.y > 40 * windowHeight) {
128-
// newY = 54;
129-
// }
130-
// setPosition({ x: 0, y: newY * windowHeight });
131-
// };
132-
133119
// If path starts with "widget", then set the state variable isWidget to true,
134120
// so we stay in widget mode (w/o normal App Header and Footer)
135121
useEffect(() => {

client/src/components/FoodSeeker/SearchResults/layouts/Mobile.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Draggable, { DraggableEvent, DraggableData } from "react-draggable";
44
import { useFilterPanel } from "appReducer";
55
import AttributionInfo from "../AttributionInfo";
66
import { useAppDispatch } from "../../../../appReducer";
7-
import useFeatureFlag from "hooks/useFeatureFlag";
87

98
const getOverlayStyle = (positionY: number) => ({
109
position: "absolute" as const,
@@ -34,7 +33,6 @@ const MobileLayout: FC<MobileLayoutProps> = ({
3433
}) => {
3534
const filterPanelOpen = useFilterPanel();
3635
const initialY = showList ? 5 : 57;
37-
const hasAdvancedFilterFeatureFlag = useFeatureFlag("advancedFilter");
3836
const dispatch = useAppDispatch();
3937
const nodeRef = useRef<HTMLDivElement>(null);
4038
const [position, setPosition] = useState({
@@ -55,17 +53,15 @@ const MobileLayout: FC<MobileLayoutProps> = ({
5553
}
5654

5755
setPosition({ x: 0, y: newY * (window.innerHeight / 100) });
58-
}, [showList, filterPanelOpen, hasAdvancedFilterFeatureFlag]);
56+
}, [showList, filterPanelOpen]);
5957

6058
const handleDrag = (e: DraggableEvent, ui: DraggableData) => {
6159
setPosition({ x: 0, y: ui.y });
6260
};
6361

6462
const handleStop = (e: DraggableEvent, ui: DraggableData) => {
6563
const windowHeight = window.innerHeight / 100;
66-
const minY = hasAdvancedFilterFeatureFlag
67-
? (100 / window.innerHeight) * 60
68-
: 0;
64+
const minY = (100 / window.innerHeight) * 60;
6965
const maxY = 80;
7066
const snapPoints = [minY, 35, maxY];
7167
const snapThreshold = 5;

0 commit comments

Comments
 (0)