Merge pull request #430 from blackle/logout_mobile

Show logout button on getting started so it's available on mobile
remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Eugen 2017-01-08 01:24:06 +01:00 committed by GitHub
commit cec7e69827
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,8 @@ const messages = defineMessages({
heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, heading: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Public timeline' }, public_timeline: { id: 'navigation_bar.public_timeline', defaultMessage: 'Public timeline' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' } follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
sign_out: { id: 'navigation_bar.logout', defaultMessage: 'Sign out' }
}); });
const mapStateToProps = state => ({ const mapStateToProps = state => ({
@ -28,6 +29,7 @@ const GettingStarted = ({ intl, me }) => {
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' /> <ColumnLink icon='globe' text={intl.formatMessage(messages.public_timeline)} to='/timelines/public' />
<ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' /> <ColumnLink icon='cog' text={intl.formatMessage(messages.preferences)} href='/settings/preferences' />
<ColumnLink icon='sign-out' text={intl.formatMessage(messages.sign_out)} href='/auth/sign_out' method='delete' />
{followRequests} {followRequests}
</div> </div>

View File

@ -13,10 +13,10 @@ const iconStyle = {
marginRight: '5px' marginRight: '5px'
}; };
const ColumnLink = ({ icon, text, to, href }) => { const ColumnLink = ({ icon, text, to, href, method }) => {
if (href) { if (href) {
return ( return (
<a href={href} style={outerStyle} className='column-link'> <a href={href} style={outerStyle} className='column-link' data-method={method}>
<i className={`fa fa-fw fa-${icon}`} style={iconStyle} /> <i className={`fa fa-fw fa-${icon}`} style={iconStyle} />
{text} {text}
</a> </a>