mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-28 16:07:51 +00:00
f11e9d5524
Port fd3d45d38f
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import { openModal } from 'flavours/glitch/actions/modal';
|
|
import { connect } from 'react-redux';
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
import Header from '../components/header';
|
|
import { logOut } from 'flavours/glitch/util/log_out';
|
|
|
|
const messages = defineMessages({
|
|
logoutMessage: { id: 'confirmations.logout.message', defaultMessage: 'Are you sure you want to log out?' },
|
|
logoutConfirm: { id: 'confirmations.logout.confirm', defaultMessage: 'Log out' },
|
|
});
|
|
|
|
const mapStateToProps = state => {
|
|
return {
|
|
columns: state.getIn(['settings', 'columns']),
|
|
unreadNotifications: state.getIn(['notifications', 'unread']),
|
|
showNotificationsBadge: state.getIn(['local_settings', 'notifications', 'tab_badge']),
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch, { intl }) => ({
|
|
onSettingsClick (e) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
dispatch(openModal('SETTINGS', {}));
|
|
},
|
|
onLogout () {
|
|
dispatch(openModal('CONFIRM', {
|
|
message: intl.formatMessage(messages.logoutMessage),
|
|
confirm: intl.formatMessage(messages.logoutConfirm),
|
|
onConfirm: () => logOut(),
|
|
}));
|
|
},
|
|
});
|
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Header));
|