Skip to content

Commit

Permalink
updated variable name to communicate boolean value
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Dratch committed Jul 7, 2024
1 parent 2850709 commit 4d43b07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/find-properties/[[...opa_id]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const MapPage = ({ params }: MapPageProps) => {
const [featureCount, setFeatureCount] = useState<number>(0);
const [currentView, setCurrentView] = useState<BarClickOptions>("detail");
const [loading, setLoading] = useState(true);
const [loadingError, setLoadingError] = useState(false);
const [hasLoadingError, setHasLoadingError] = useState(false);
const [selectedProperty, setSelectedProperty] =
useState<MapGeoJSONFeature | null>(null);
const [isStreetViewModalOpen, setIsStreetViewModalOpen] =
Expand Down Expand Up @@ -233,7 +233,7 @@ const MapPage = ({ params }: MapPageProps) => {
featuresInView={featuresInView}
setFeaturesInView={setFeaturesInView}
setLoading={setLoading}
setLoadingError={setLoadingError}
setHasLoadingError={setHasLoadingError}
selectedProperty={selectedProperty}
setSelectedProperty={setSelectedProperty}
setFeatureCount={setFeatureCount}
Expand Down Expand Up @@ -292,7 +292,7 @@ const MapPage = ({ params }: MapPageProps) => {
featuresInView={featuresInView}
display={currentView as "detail" | "list"}
loading={loading}
loadingError={loadingError}
hasLoadingError={hasLoadingError}
selectedProperty={selectedProperty}
setSelectedProperty={setSelectedProperty}
setIsStreetViewModalOpen={setIsStreetViewModalOpen}
Expand Down
6 changes: 3 additions & 3 deletions src/components/PropertyDetailSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface PropertyDetailSectionProps {
featuresInView: MapGeoJSONFeature[];
display: "detail" | "list";
loading: boolean;
loadingError: boolean;
hasLoadingError: boolean;
selectedProperty: MapGeoJSONFeature | null;
setSelectedProperty: (property: MapGeoJSONFeature | null) => void;
setIsStreetViewModalOpen: Dispatch<SetStateAction<boolean>>;
Expand All @@ -64,7 +64,7 @@ const PropertyDetailSection: FC<PropertyDetailSectionProps> = ({
featuresInView,
display,
loading,
loadingError,
hasLoadingError,
selectedProperty,
setSelectedProperty,
setIsStreetViewModalOpen,
Expand Down Expand Up @@ -174,7 +174,7 @@ const PropertyDetailSection: FC<PropertyDetailSectionProps> = ({
return featuresInView.slice(start, end);
}, [page, featuresInView, smallScreenMode]);

return loadingError ? (
return hasLoadingError ? (
<div className="flex flex-col w-full items-center justify-center p-4 mt-24">
<div>
<p className="body-md">We are having technical issues.</p>
Expand Down
6 changes: 3 additions & 3 deletions src/components/PropertyMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ interface PropertyMapProps {
featuresInView: MapGeoJSONFeature[];
setFeaturesInView: Dispatch<SetStateAction<any[]>>;
setLoading: Dispatch<SetStateAction<boolean>>;
setLoadingError: Dispatch<SetStateAction<boolean>>;
setHasLoadingError: Dispatch<SetStateAction<boolean>>;
selectedProperty: MapGeoJSONFeature | null;
setSelectedProperty: (property: MapGeoJSONFeature | null) => void;
setFeatureCount: Dispatch<SetStateAction<number>>;
Expand All @@ -153,7 +153,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
featuresInView,
setFeaturesInView,
setLoading,
setLoadingError,
setHasLoadingError,
selectedProperty,
setSelectedProperty,
setFeatureCount,
Expand Down Expand Up @@ -441,7 +441,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
maxZoom={MAX_MAP_ZOOM}
interactiveLayerIds={layers}
onError={(e) => {
setLoadingError(true);
setHasLoadingError(true);
}}
onLoad={(e) => {
setMap(e.target);
Expand Down

0 comments on commit 4d43b07

Please sign in to comment.