2020-03-27 13:59:38 -07:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-04-14 14:37:17 -07:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2020-03-27 13:59:38 -07:00
|
|
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { openModal } from '../../../actions/modal';
|
2020-05-28 15:52:07 -07:00
|
|
|
import { logOut } from 'soapbox/actions/auth';
|
2021-03-25 16:56:07 -07:00
|
|
|
import { isStaff } from 'soapbox/utils/accounts';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
2020-04-11 13:36:54 -07:00
|
|
|
// FIXME: Let this be configured
|
|
|
|
const sourceCode = {
|
|
|
|
name: 'soapbox-fe',
|
|
|
|
url: 'https://gitlab.com/soapbox-pub/soapbox-fe',
|
2020-05-18 13:38:53 -07:00
|
|
|
repository: 'soapbox-pub/soapbox-fe',
|
2020-10-04 20:28:34 -07:00
|
|
|
version: '1.1.0',
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|
2020-04-11 13:36:54 -07:00
|
|
|
|
2020-04-01 19:20:47 -07:00
|
|
|
const mapStateToProps = state => {
|
|
|
|
const me = state.get('me');
|
|
|
|
return {
|
|
|
|
account: state.getIn(['accounts', me]),
|
2020-04-14 11:44:40 -07:00
|
|
|
};
|
2020-04-01 19:20:47 -07:00
|
|
|
};
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
onOpenHotkeys() {
|
|
|
|
dispatch(openModal('HOTKEYS'));
|
|
|
|
},
|
2020-04-11 12:41:13 -07:00
|
|
|
onClickLogOut(e) {
|
|
|
|
dispatch(logOut());
|
|
|
|
e.preventDefault();
|
|
|
|
},
|
2020-03-27 13:59:38 -07:00
|
|
|
});
|
|
|
|
|
2020-04-11 13:36:54 -07:00
|
|
|
const LinkFooter = ({ onOpenHotkeys, account, onClickLogOut }) => (
|
2020-03-27 13:59:38 -07:00
|
|
|
<div className='getting-started__footer'>
|
|
|
|
<ul>
|
2021-03-25 16:56:07 -07:00
|
|
|
{account && <>
|
|
|
|
<li><Link to='/blocks'><FormattedMessage id='navigation_bar.blocks' defaultMessage='Blocked users' /></Link></li>
|
|
|
|
<li><Link to='/mutes'><FormattedMessage id='navigation_bar.mutes' defaultMessage='Muted users' /></Link></li>
|
|
|
|
<li><Link to='/filters'><FormattedMessage id='navigation_bar.filters' defaultMessage='Muted words' /></Link></li>
|
|
|
|
<li><Link to='/domain_blocks'><FormattedMessage id='navigation_bar.domain_blocks' defaultMessage='Hidden domains' /></Link></li>
|
2021-03-27 08:50:21 -07:00
|
|
|
<li><Link to='/follow_requests'><FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' /></Link></li>
|
2021-03-25 16:56:07 -07:00
|
|
|
{isStaff(account) && <>
|
|
|
|
<li><a href='/pleroma/admin'><FormattedMessage id='navigation_bar.admin_settings' defaultMessage='Admin settings' /></a></li>
|
|
|
|
<li><Link to='/soapbox/config'><FormattedMessage id='navigation_bar.soapbox_config' defaultMessage='Soapbox config' /></Link></li>
|
|
|
|
</>}
|
|
|
|
<li><Link to='/settings/import'><FormattedMessage id='navigation_bar.import_data' defaultMessage='Import data' /></Link></li>
|
|
|
|
<li><a href='#' onClick={onOpenHotkeys}><FormattedMessage id='navigation_bar.keyboard_shortcuts' defaultMessage='Hotkeys' /></a></li>
|
|
|
|
</>}
|
|
|
|
<li><Link to='/about'><FormattedMessage id='navigation_bar.info' defaultMessage='About this server' /></Link></li>
|
2020-05-28 11:50:31 -07:00
|
|
|
{account && <li><Link to='/auth/sign_out' onClick={onClickLogOut}><FormattedMessage id='navigation_bar.logout' defaultMessage='Logout' /></Link></li>}
|
2020-03-27 13:59:38 -07:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<FormattedMessage
|
|
|
|
id='getting_started.open_source_notice'
|
2020-04-11 13:36:54 -07:00
|
|
|
defaultMessage='{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).'
|
|
|
|
values={{
|
|
|
|
code_name: sourceCode.name,
|
|
|
|
code_link: <a href={sourceCode.url} rel='noopener' target='_blank'>{sourceCode.repository}</a>,
|
|
|
|
code_version: sourceCode.version,
|
|
|
|
}}
|
2020-03-27 13:59:38 -07:00
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
LinkFooter.propTypes = {
|
2020-04-14 14:37:17 -07:00
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
onOpenHotkeys: PropTypes.func.isRequired,
|
|
|
|
onClickLogOut: PropTypes.func.isRequired,
|
2020-03-27 13:59:38 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(LinkFooter));
|