mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 07:26:07 +02:00
Extract common function 'matchedUrl'
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
import queryString from "query-string";
|
||||
import { RouteComponentProps } from "react-router-dom";
|
||||
|
||||
//@ts-ignore
|
||||
export const contextPath = window.ctxPath || "";
|
||||
@@ -87,3 +88,12 @@ export function stripEndingSlash(url: string) {
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
export function matchedUrlFromMatch(match: any) {
|
||||
return stripEndingSlash(match.url);
|
||||
}
|
||||
|
||||
export function matchedUrl(props: RouteComponentProps) {
|
||||
const match = props.match;
|
||||
return matchedUrlFromMatch(match);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user