This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
index.ts
37 lines (30 loc) · 1.17 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {bindActionCreators, Dispatch} from 'redux';
import {connect} from 'react-redux';
import {verifyUserEmail, getMe} from 'mattermost-redux/actions/users';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getCurrentUserId, getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {clearErrors, logError} from 'mattermost-redux/actions/errors';
import {GenericAction} from 'mattermost-redux/types/actions';
import {GlobalState} from '../../types/store';
import DoVerifyEmail from './do_verify_email';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);
const siteName = config.SiteName;
return {
isLoggedIn: Boolean(getCurrentUserId(state)),
siteName,
};
}
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
return {
actions: bindActionCreators({
verifyUserEmail,
getMe,
logError,
clearErrors,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(DoVerifyEmail);