mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
Extract common function 'matchedUrl'
This commit is contained in:
@@ -55,20 +55,17 @@ type Props = RouteComponentProps &
|
||||
};
|
||||
|
||||
class Admin extends React.Component<Props> {
|
||||
matchedUrl = () => {
|
||||
return urls.stripEndingSlash(this.props.match.url);
|
||||
};
|
||||
|
||||
matchesRoles = (route: any) => {
|
||||
const url = this.matchedUrl();
|
||||
const url = urls.matchedUrl(this.props);
|
||||
const regex = new RegExp(`${url}/role/`);
|
||||
return route.location.pathname.match(regex);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { links, availablePluginsLink, installedPluginsLink, t } = this.props;
|
||||
const { links, availablePluginsLink, installedPluginsLink, match, t } = this.props;
|
||||
|
||||
const url = this.matchedUrl();
|
||||
const url = urls.matchedUrl(this.props);
|
||||
const extensionProps = {
|
||||
links,
|
||||
url
|
||||
|
||||
Reference in New Issue
Block a user