Skip to content

Commit

Permalink
fix: make onLoading prop optional and update the name of Pane
Browse files Browse the repository at this point in the history
  • Loading branch information
fityannugroho committed Nov 29, 2024
1 parent 15449c6 commit 54ec436
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/MapDashboard/AreaBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export type AreaBoundaryProps<A extends FeatureArea> = Omit<
> & {
area: A
code: string
onLoading: (isLoading: boolean) => void
onLoading?: (isLoading: boolean) => void
render?: (data?: GetSpecificDataReturn<A>['data']) => React.ReactNode
}

Expand All @@ -61,7 +61,7 @@ export default function AreaBoundary<A extends FeatureArea>({
const areaDetails = useArea(area, code)

useEffect(() => {
onLoading(boundary.status === 'pending')
onLoading?.(boundary.status === 'pending')
}, [boundary.status, onLoading])

if (boundary.status === 'pending') {
Expand All @@ -86,7 +86,7 @@ export default function AreaBoundary<A extends FeatureArea>({

return (
<Pane
name={area}
name={`boundary-${area}-${code}`}
style={{ zIndex: order ? defaultOverlayPaneZIndex + order : undefined }}
>
<FeatureGroup>
Expand Down

0 comments on commit 54ec436

Please sign in to comment.