-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github-chisom:dhis2/maintenance-app-beta int…
…o DHIS2-18281/indicator-list
- Loading branch information
Showing
10 changed files
with
318 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import type { useMatches } from 'react-router-dom' | ||
import type { ModelSection } from '../../types' | ||
import type { UIMatch, useMatches } from 'react-router-dom' | ||
import type { ModelSection, OverviewSection } from '../../types' | ||
// utility type to type a match with a handle-property returned from useMatches | ||
// since handle is unknown, we need to cast it to the correct type | ||
type MatchWithHandle<THandle> = ReturnType<typeof useMatches>[number] & { | ||
handle?: THandle | ||
} | ||
|
||
export type BreadCrumbMatchInfo = Pick<UIMatch, 'params' | 'pathname'> | ||
|
||
// common type for possible handle-properties used in Route | ||
export type RouteHandle = { | ||
hideSidebar?: boolean | ||
section?: ModelSection | ||
section?: ModelSection | OverviewSection | ||
showFooter?: boolean | ||
crumb?: () => React.ReactNode | ||
crumb?: (matchInfo: BreadCrumbMatchInfo) => React.ReactNode | ||
} | ||
|
||
export type MatchRouteHandle = MatchWithHandle<RouteHandle> |
Oops, something went wrong.