Add back button to 'Don't have an account' page (#24994)
* Add back button to 'Don't have an account' screen * update track event based on pr comment Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> * fix absolute import --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Этот коммит содержится в:
@@ -1,20 +1,44 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {useEffect} from 'react';
|
||||
import React, {useCallback, useEffect} from 'react';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {useHistory} from 'react-router-dom';
|
||||
|
||||
import {trackEvent} from 'actions/telemetry_actions';
|
||||
|
||||
import AccessProblemSVG from 'components/common/svg_images_components/access_problem_svg';
|
||||
import type {CustomizeHeaderType} from 'components/header_footer_route/header_footer_route';
|
||||
|
||||
import './access_problem.scss';
|
||||
|
||||
const AccessProblem = () => {
|
||||
type AccessProblemProps = {
|
||||
onCustomizeHeader?: CustomizeHeaderType;
|
||||
}
|
||||
|
||||
const AccessProblem = ({
|
||||
onCustomizeHeader,
|
||||
}: AccessProblemProps) => {
|
||||
const {formatMessage} = useIntl();
|
||||
const history = useHistory();
|
||||
|
||||
const handleHeaderBackButtonOnClick = useCallback(() => {
|
||||
trackEvent('access_problem', 'click_back');
|
||||
history.goBack();
|
||||
}, [history]);
|
||||
|
||||
useEffect(() => {
|
||||
trackEvent('signup', 'click_login_no_account__closed_server');
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (onCustomizeHeader) {
|
||||
onCustomizeHeader({
|
||||
onBackButtonClick: handleHeaderBackButtonOnClick,
|
||||
});
|
||||
}
|
||||
}, [onCustomizeHeader, handleHeaderBackButtonOnClick]);
|
||||
|
||||
return (
|
||||
<div className='AccessProblem__body'>
|
||||
<AccessProblemSVG/>
|
||||
|
||||
Ссылка в новой задаче
Block a user