Extract common function 'matchedUrl'

This commit is contained in:
René Pfeuffer
2020-09-18 17:38:10 +02:00
parent 4523e22feb
commit bbfe2b08bc
11 changed files with 43 additions and 79 deletions

View File

@@ -55,10 +55,6 @@ type Props = RouteComponentProps &
};
class Profile extends React.Component<Props> {
matchedUrl = () => {
return urls.stripEndingSlash(this.props.match.url);
};
mayChangePassword = () => {
const { me } = this.props;
return !!me?._links?.password;
@@ -70,7 +66,7 @@ class Profile extends React.Component<Props> {
};
render() {
const url = this.matchedUrl();
const url = urls.matchedUrl(this.props);
const { me, t } = this.props;