Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: map mobile recenter button #1065

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions sites/public/src/components/listings/ListingsList.tsx
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@ type ListingsListProps = {
const ListingsList = (props: ListingsListProps) => {
const map = useMap()

if (!map) return null

const moreMarkersOnMap = props.mapMarkers.length > 0
const listingsDiv = (
<div id="listingsList">
@@ -39,17 +37,19 @@ const ListingsList = (props: ListingsListProps) => {
{moreMarkersOnMap && (
<Button
onClick={() => {
fitBounds(
map,
props.mapMarkers.map((marker, index) => {
return {
id: marker.id,
key: index,
coordinate: { lat: marker.lat, lng: marker.lng },
}
}),
true
)
if (map) {
fitBounds(
map,
props.mapMarkers.map((marker, index) => {
return {
id: marker.id,
key: index,
coordinate: { lat: marker.lat, lng: marker.lng },
}
}),
true
)
}
}}
>
{t("t.recenterMap")}

Unchanged files with check annotations Beta

// eslint-disable-next-line import/export
export { customRender as render }
export const mockNextRouter = (query?: any) => {

Check warning on line 27 in sites/partners/__tests__/testUtils.tsx

GitHub Actions / run-linters

Unexpected any. Specify a different type
// eslint-disable-next-line @typescript-eslint/no-var-requires
const useRouter = jest.spyOn(require("next/router"), "useRouter")
const pushMock = jest.fn()
defaultText: getCustomValue(subKey, formValues?.race),
})),
}))
}, [register])

Check warning on line 54 in sites/partners/src/components/applications/PaperApplicationForm/sections/FormDemographics.tsx

GitHub Actions / run-linters

React Hook useMemo has a missing dependency: 'formValues?.race'. Either include it or remove the dependency array
return (
<>
}
}
return elements
}, [

Check warning on line 843 in sites/partners/src/components/listings/ListingFormActions.tsx

GitHub Actions / run-linters

React Hook useMemo has missing dependencies: 'isListingApprovalEnabled', 'isListingCopier', 'listingJurisdiction?.publicUrl', 'profile?.userRoles.isAdmin', 'profile?.userRoles.isJurisdictionalAdmin', 'profile?.userRoles.isLimitedJurisdictionalAdmin', 'profile?.userRoles.isPartner', 'setErrorAlert', 'showCopyListingDialog', and 'showSaveBeforeExitDialog'. Either include them or remove the dependency array. If 'showSaveBeforeExitDialog' changes too often, find the parent component that defines it and wrap that definition in useCallback
isListingApprover,
listing,
listingApprovalPermissions?.length,
}
}
},
[

Check warning on line 276 in sites/partners/src/components/listings/PaperListingForm/index.tsx

GitHub Actions / run-linters

React Hook useCallback has missing dependencies: 'formMethods' and 'setListingName'. Either include them or remove the dependency array. If 'setListingName' changes too often, find the parent component that defines it and wrap that definition in useCallback
units,
openHouseEvents,
editMode,
listing,
openHouseEvents,
setOpenHouseEvents,
disableDueDate,

Check warning on line 22 in sites/partners/src/components/listings/PaperListingForm/sections/ApplicationDates.tsx

GitHub Actions / run-linters

'disableDueDate' is defined but never used. Allowed unused args must match /^_/u
}: ApplicationDatesProps) => {
const openHouseHeaders = {
date: "t.date",
) => {
data: SelectAndOrderSection[]
loading: boolean
error: any

Check warning on line 31 in sites/partners/src/components/listings/PaperListingForm/sections/SelectAndOrder.tsx

GitHub Actions / run-linters

Unexpected any. Specify a different type
}
formKey: string
applicationSection: MultiselectQuestionsApplicationSectionEnum
}
}
export const isObject = (obj: any, key: string) => {

Check warning on line 179 in sites/partners/src/lib/helpers.ts

GitHub Actions / run-linters

Unexpected any. Specify a different type
return (
obj[key] &&
typeof obj[key] === "object" &&
* No empty strings - set to null but still included
* Arrays / non-empty strings / Date objects - no changes
*/
export const removeEmptyObjects = (obj: any, nested?: boolean) => {

Check warning on line 199 in sites/partners/src/lib/helpers.ts

GitHub Actions / run-linters

Unexpected any. Specify a different type
Object.keys(obj).forEach((key) => {
if (isObject(obj, key)) {
if (Object.keys(obj[key]).length === 0) {
}
setCsvExportLoading(false)
}, [])

Check warning on line 160 in sites/partners/src/lib/hooks.ts

GitHub Actions / run-linters

React Hook useCallback has missing dependencies: 'addToast' and 'listingsService'. Either include them or remove the dependency array
return {
onExport,
addToast(t("account.settings.alerts.genericError"), { variant: "alert" })
}
setExportLoading(false)
}, [])

Check warning on line 582 in sites/partners/src/lib/hooks.ts

GitHub Actions / run-linters

React Hook useCallback has missing dependencies: 'addToast', 'applicationsService', 'forLottery', 'includeDemographics', 'listingId', and 'lotteryService'. Either include them or remove the dependency array
return {
onExport,